diff --git a/toonz/sources/toonz/mainwindow.cpp b/toonz/sources/toonz/mainwindow.cpp index 8696859..b3c3e51 100644 --- a/toonz/sources/toonz/mainwindow.cpp +++ b/toonz/sources/toonz/mainwindow.cpp @@ -520,9 +520,13 @@ centralWidget->setLayout(centralWidgetLayout);*/ &MainWindow::toggleTapeEndpointToLine); setCommandHandler(MI_TapeLineToLine, this, &MainWindow::toggleTapeLineToLine); - /*-- StylepickerAreas,StylepickerLinesに直接切り替えるコマンド --*/ + /*-- Style Picker tool + mode switching shortcuts --*/ + setCommandHandler(MI_PickStyleNextMode, this, + &MainWindow::togglePickStyleNextMode); setCommandHandler(MI_PickStyleAreas, this, &MainWindow::togglePickStyleAreas); setCommandHandler(MI_PickStyleLines, this, &MainWindow::togglePickStyleLines); + setCommandHandler(MI_PickStyleLinesAndAreas, this, + &MainWindow::togglePickStyleLinesAndAreas); setCommandHandler(MI_About, this, &MainWindow::onAbout); setCommandHandler(MI_OpenOnlineManual, this, &MainWindow::onOpenOnlineManual); @@ -2550,12 +2554,15 @@ void MainWindow::defineActions() { createAction(MI_TapeLineToLine, tr("Tape Tool - Line to Line"), "", ToolCommandType); - /*-- Style picker Area, Style picker Lineににキー1つで切り替えるためのコマンド - * --*/ + /*-- Style Picker tool + mode switching shortcuts --*/ + createAction(MI_PickStyleNextMode, tr("Style Picker Tool - Next Mode"), "", + ToolCommandType); createAction(MI_PickStyleAreas, tr("Style Picker Tool - Areas"), "", ToolCommandType); createAction(MI_PickStyleLines, tr("Style Picker Tool - Lines"), "", ToolCommandType); + createAction(MI_PickStyleLinesAndAreas, + tr("Style Picker Tool - Lines & Areas"), "", ToolCommandType); createMiscAction("A_FxSchematicToggle", tr("Toggle FX/Stage schematic"), ""); #ifdef WITH_STOPMOTION @@ -2926,8 +2933,14 @@ void MainWindow::toggleTapeLineToLine() { } //--------------------------------------------------------------------------------------- -/*-- Style picker Area, Style picker Lineににキー1つで切り替えるためのコマンド - * --*/ +/*-- Style Picker tool + mode switching shortcuts --*/ +void MainWindow::togglePickStyleNextMode() { + if (TApp::instance()->getCurrentTool()->getTool()->getName() == T_StylePicker) + CommandManager::instance()->getAction("A_ToolOption_Mode")->trigger(); + else + CommandManager::instance()->getAction(T_StylePicker)->trigger(); +} + void MainWindow::togglePickStyleAreas() { CommandManager::instance()->getAction(T_StylePicker)->trigger(); CommandManager::instance()->getAction("A_ToolOption_Mode:Areas")->trigger(); @@ -2938,6 +2951,13 @@ void MainWindow::togglePickStyleLines() { CommandManager::instance()->getAction("A_ToolOption_Mode:Lines")->trigger(); } +void MainWindow::togglePickStyleLinesAndAreas() { + CommandManager::instance()->getAction(T_StylePicker)->trigger(); + CommandManager::instance() + ->getAction("A_ToolOption_Mode:Lines & Areas") + ->trigger(); +} + //----------------------------------------------------------------------------- void MainWindow::onNewVectorLevelButtonPressed() { diff --git a/toonz/sources/toonz/mainwindow.h b/toonz/sources/toonz/mainwindow.h index 72cbb06..85aff95 100644 --- a/toonz/sources/toonz/mainwindow.h +++ b/toonz/sources/toonz/mainwindow.h @@ -167,9 +167,12 @@ public: void toggleTapeEndpointToLine(); void toggleTapeLineToLine(); - /*-- StylepickerAreas,StylepickerLinesに直接切り替えるコマンド --*/ + /*-- Style Picker tool + mode switching shortcuts --*/ + void togglePickStyleNextMode(); void togglePickStyleAreas(); void togglePickStyleLines(); + void togglePickStyleLinesAndAreas(); + void onNewVectorLevelButtonPressed(); void onNewToonzRasterLevelButtonPressed(); void onNewRasterLevelButtonPressed(); diff --git a/toonz/sources/toonz/menubarcommandids.h b/toonz/sources/toonz/menubarcommandids.h index 3089c1e..7f73d68 100644 --- a/toonz/sources/toonz/menubarcommandids.h +++ b/toonz/sources/toonz/menubarcommandids.h @@ -388,8 +388,10 @@ #define MI_TapeEndpointToLine "MI_TapeEndpointToLine" #define MI_TapeLineToLine "MI_TapeLineToLine" +#define MI_PickStyleNextMode "MI_PickStyleNextMode" #define MI_PickStyleAreas "MI_PickStyleAreas" #define MI_PickStyleLines "MI_PickStyleLines" +#define MI_PickStyleLinesAndAreas "MI_PickStyleLinesAndAreas" #define MI_DeactivateUpperColumns "MI_DeactivateUpperColumns" #define MI_CompareToSnapshot "MI_CompareToSnapshot"