From 75bc1ef6a7fce447ba67a123f7cd453b36fa487a Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Wed, 5 Aug 2020 23:09:38 +0100 Subject: [PATCH] pleditor: Remove background color toggle action The new color theme system replaces the need to toggle the background color in the editor. Fixes https://gitlab.com/kicad/code/kicad/issues/5050 --- pagelayout_editor/menubar.cpp | 1 - pagelayout_editor/pl_editor_frame.cpp | 7 ------- pagelayout_editor/tools/pl_actions.cpp | 5 ----- pagelayout_editor/tools/pl_actions.h | 1 - pagelayout_editor/tools/pl_editor_control.cpp | 13 ------------- pagelayout_editor/tools/pl_editor_control.h | 1 - 6 files changed, 28 deletions(-) diff --git a/pagelayout_editor/menubar.cpp b/pagelayout_editor/menubar.cpp index b75e625a37..3fcb028c8b 100644 --- a/pagelayout_editor/menubar.cpp +++ b/pagelayout_editor/menubar.cpp @@ -109,7 +109,6 @@ void PL_EDITOR_FRAME::ReCreateMenuBar() viewMenu->Add( ACTIONS::zoomRedraw ); viewMenu->AppendSeparator(); - viewMenu->Add( PL_ACTIONS::toggleBackground, ACTION_MENU::CHECK ); viewMenu->Add( ACTIONS::toggleGrid, ACTION_MENU::CHECK ); viewMenu->Add( ACTIONS::toggleCursorStyle, ACTION_MENU::CHECK ); diff --git a/pagelayout_editor/pl_editor_frame.cpp b/pagelayout_editor/pl_editor_frame.cpp index 441365cd51..251ee45233 100644 --- a/pagelayout_editor/pl_editor_frame.cpp +++ b/pagelayout_editor/pl_editor_frame.cpp @@ -276,13 +276,6 @@ void PL_EDITOR_FRAME::setupUIConditions() // Not a tool, just a way to activate the action mgr->SetConditions( PL_ACTIONS::appendImportedWorksheet, CHECK( SELECTION_CONDITIONS::ShowNever ) ); - auto whiteBackgroundCondition = [ this ] ( const SELECTION& aSel ) { - return GetDrawBgColor() == WHITE; - }; - - mgr->SetConditions( PL_ACTIONS::toggleBackground, Check( whiteBackgroundCondition ) ); - - auto titleBlockNormalMode = [] ( const SELECTION& ) { diff --git a/pagelayout_editor/tools/pl_actions.cpp b/pagelayout_editor/tools/pl_actions.cpp index 6f2d8b3a76..cd77de66e1 100644 --- a/pagelayout_editor/tools/pl_actions.cpp +++ b/pagelayout_editor/tools/pl_actions.cpp @@ -76,11 +76,6 @@ TOOL_ACTION PL_ACTIONS::appendImportedWorksheet( "plEditor.InteractiveEdit.appen // PL_EDITOR_CONTROL // -TOOL_ACTION PL_ACTIONS::toggleBackground( "plEditor.EditorControl.ToggleBackground", - AS_GLOBAL, 0, "", - _( "Background White" ), _( "Switch between white and black background" ), - palette_xpm ); - TOOL_ACTION PL_ACTIONS::showInspector( "plEditor.EditorControl.ShowInspector", AS_GLOBAL, 0, "", _( "Show Design Inspector" ), _( "Show the list of items in page layout" ), diff --git a/pagelayout_editor/tools/pl_actions.h b/pagelayout_editor/tools/pl_actions.h index 6de2939b28..5ee9889bf3 100644 --- a/pagelayout_editor/tools/pl_actions.h +++ b/pagelayout_editor/tools/pl_actions.h @@ -75,7 +75,6 @@ public: // Miscellaneous static TOOL_ACTION refreshPreview; - static TOOL_ACTION toggleBackground; static TOOL_ACTION showInspector; static TOOL_ACTION previewSettings; diff --git a/pagelayout_editor/tools/pl_editor_control.cpp b/pagelayout_editor/tools/pl_editor_control.cpp index d62414ff24..2317df91e3 100644 --- a/pagelayout_editor/tools/pl_editor_control.cpp +++ b/pagelayout_editor/tools/pl_editor_control.cpp @@ -119,18 +119,6 @@ int PL_EDITOR_CONTROL::Plot( const TOOL_EVENT& aEvent ) } -int PL_EDITOR_CONTROL::ToggleBackgroundColor( const TOOL_EVENT& aEvent ) -{ - m_frame->SetDrawBgColor( m_frame->GetDrawBgColor() == WHITE ? BLACK : WHITE ); - getView()->GetPainter()->GetSettings()->SetBackgroundColor( m_frame->GetDrawBgColor() ); - - m_frame->GetCanvas()->GetView()->UpdateAllLayersColor(); - m_frame->GetCanvas()->Refresh(); - - return 0; -} - - int PL_EDITOR_CONTROL::ShowInspector( const TOOL_EVENT& aEvent ) { m_frame->ShowDesignInspector(); @@ -194,7 +182,6 @@ void PL_EDITOR_CONTROL::setTransitions() Go( &PL_EDITOR_CONTROL::Plot, ACTIONS::plot.MakeEvent() ); Go( &PL_EDITOR_CONTROL::PageSetup, PL_ACTIONS::previewSettings.MakeEvent() ); - Go( &PL_EDITOR_CONTROL::ToggleBackgroundColor, PL_ACTIONS::toggleBackground.MakeEvent() ); Go( &PL_EDITOR_CONTROL::ShowInspector, PL_ACTIONS::showInspector.MakeEvent() ); Go( &PL_EDITOR_CONTROL::TitleBlockDisplayMode, PL_ACTIONS::layoutEditMode.MakeEvent() ); Go( &PL_EDITOR_CONTROL::TitleBlockDisplayMode, PL_ACTIONS::layoutNormalMode.MakeEvent() ); diff --git a/pagelayout_editor/tools/pl_editor_control.h b/pagelayout_editor/tools/pl_editor_control.h index e2d90a7a54..6c14109e2e 100644 --- a/pagelayout_editor/tools/pl_editor_control.h +++ b/pagelayout_editor/tools/pl_editor_control.h @@ -60,7 +60,6 @@ public: int Print( const TOOL_EVENT& aEvent ); int Plot( const TOOL_EVENT& aEvent ); - int ToggleBackgroundColor( const TOOL_EVENT& aEvent ); int ShowInspector( const TOOL_EVENT& aEvent ); int TitleBlockDisplayMode( const TOOL_EVENT& aEvent );