From 881cf9dfcf46cd23ca61d12ec3c39aed31015bc2 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 25 Oct 2023 13:21:35 +0100 Subject: [PATCH] Minor improvements to clarity and conformity for Display Options. --- common/widgets/gal_options_panel.cpp | 11 +- common/widgets/gal_options_panel_base.cpp | 40 +++- common/widgets/gal_options_panel_base.fbp | 235 ++++++++++++++++++++-- common/widgets/gal_options_panel_base.h | 11 +- 4 files changed, 256 insertions(+), 41 deletions(-) diff --git a/common/widgets/gal_options_panel.cpp b/common/widgets/gal_options_panel.cpp index 89febae832..f0b4f7bce8 100644 --- a/common/widgets/gal_options_panel.cpp +++ b/common/widgets/gal_options_panel.cpp @@ -63,13 +63,8 @@ GAL_OPTIONS_PANEL::GAL_OPTIONS_PANEL( wxWindow* aParent, APP_SETTINGS_BASE* aApp // Rendering engine #ifdef __WXMAC__ // On MAC, Cairo render does not work. - m_renderingEngine->Hide(); + m_renderingSizer->Show( false ); #endif - m_renderingEngine->SetItemToolTip( 0, _( "Hardware-accelerated graphics (recommended)" ) ); - m_renderingEngine->SetItemToolTip( 1, _( "Software graphics (for computers which do not " - "support KiCad's hardware acceleration " - "requirements)" ) ); - // Grid settings subpanel int selection = 0; // default selection @@ -95,9 +90,9 @@ bool GAL_OPTIONS_PANEL::TransferDataToWindow() auto canvasType = static_cast( m_cfg->m_Graphics.canvas_type ); if( canvasType == EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL ) - m_renderingEngine->SetSelection( 0 ); + m_rbAccelerated->SetValue( true ); else - m_renderingEngine->SetSelection( 1 ); + m_rbFallback->SetValue( true ); #endif m_gridSnapOptions->SetSelection( m_cfg->m_Window.grid.snap ); diff --git a/common/widgets/gal_options_panel_base.cpp b/common/widgets/gal_options_panel_base.cpp index f8fc7a3f21..0c1c62131b 100644 --- a/common/widgets/gal_options_panel_base.cpp +++ b/common/widgets/gal_options_panel_base.cpp @@ -14,19 +14,37 @@ GAL_OPTIONS_PANEL_BASE::GAL_OPTIONS_PANEL_BASE( wxWindow* parent, wxWindowID id, wxBoxSizer* mainSizer; mainSizer = new wxBoxSizer( wxVERTICAL ); - wxBoxSizer* sLeftSizer; - sLeftSizer = new wxBoxSizer( wxVERTICAL ); + m_renderingSizer = new wxBoxSizer( wxVERTICAL ); - wxString m_renderingEngineChoices[] = { _("Accelerated graphics"), _("Fallback graphics") }; - int m_renderingEngineNChoices = sizeof( m_renderingEngineChoices ) / sizeof( wxString ); - m_renderingEngine = new wxRadioBox( this, wxID_ANY, _("Rendering Engine"), wxDefaultPosition, wxDefaultSize, m_renderingEngineNChoices, m_renderingEngineChoices, 1, wxRA_SPECIFY_COLS ); - m_renderingEngine->SetSelection( 0 ); - sLeftSizer->Add( m_renderingEngine, 0, wxALL, 5 ); + m_staticText9 = new wxStaticText( this, wxID_ANY, _("Rendering Engine"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText9->Wrap( -1 ); + m_renderingSizer->Add( m_staticText9, 0, wxTOP|wxRIGHT|wxLEFT, 13 ); + + m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + m_renderingSizer->Add( m_staticline3, 0, wxEXPAND|wxBOTTOM, 5 ); + + wxFlexGridSizer* fgSizer2; + fgSizer2 = new wxFlexGridSizer( 0, 1, 4, 0 ); + fgSizer2->SetFlexibleDirection( wxBOTH ); + fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_rbAccelerated = new wxRadioButton( this, wxID_ANY, _("Accelerated graphics"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); + m_rbAccelerated->SetToolTip( _("Hardware-accelerated graphics (recommended)") ); + + fgSizer2->Add( m_rbAccelerated, 0, wxLEFT, 5 ); + + m_rbFallback = new wxRadioButton( this, wxID_ANY, _("Fallback graphics"), wxDefaultPosition, wxDefaultSize, 0 ); + m_rbFallback->SetToolTip( _("Software graphics (for computers which do not support KiCad's hardware acceleration requirements)") ); + + fgSizer2->Add( m_rbFallback, 0, wxLEFT, 5 ); - mainSizer->Add( sLeftSizer, 0, wxEXPAND, 5 ); + m_renderingSizer->Add( fgSizer2, 0, wxEXPAND|wxALL, 5 ); - m_staticText1 = new wxStaticText( this, wxID_ANY, _("Grid Options"), wxDefaultPosition, wxDefaultSize, 0 ); + + mainSizer->Add( m_renderingSizer, 0, wxEXPAND|wxBOTTOM, 5 ); + + m_staticText1 = new wxStaticText( this, wxID_ANY, _("Grid Display"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText1->Wrap( -1 ); mainSizer->Add( m_staticText1, 0, wxTOP|wxRIGHT|wxLEFT, 13 ); @@ -50,7 +68,7 @@ GAL_OPTIONS_PANEL_BASE::GAL_OPTIONS_PANEL_BASE( wxWindow* parent, wxWindowID id, bSizerGridStyle->Add( m_rbCrosses, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - mainSizer->Add( bSizerGridStyle, 0, wxEXPAND|wxALL, 5 ); + mainSizer->Add( bSizerGridStyle, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); wxGridBagSizer* gbGridSettings; gbGridSettings = new wxGridBagSizer( 5, 5 ); @@ -99,7 +117,7 @@ GAL_OPTIONS_PANEL_BASE::GAL_OPTIONS_PANEL_BASE( wxWindow* parent, wxWindowID id, mainSizer->Add( 0, 5, 0, 0, 5 ); - m_stGridLabel = new wxStaticText( this, wxID_ANY, _("Cursor Options"), wxDefaultPosition, wxDefaultSize, 0 ); + m_stGridLabel = new wxStaticText( this, wxID_ANY, _("Cursor"), wxDefaultPosition, wxDefaultSize, 0 ); m_stGridLabel->Wrap( -1 ); mainSizer->Add( m_stGridLabel, 0, wxTOP|wxRIGHT|wxLEFT, 13 ); diff --git a/common/widgets/gal_options_panel_base.fbp b/common/widgets/gal_options_panel_base.fbp index ef88454849..327f4ef73f 100644 --- a/common/widgets/gal_options_panel_base.fbp +++ b/common/widgets/gal_options_panel_base.fbp @@ -59,18 +59,18 @@ none 5 - wxEXPAND + wxEXPAND|wxBOTTOM 0 - sLeftSizer + m_renderingSizer wxVERTICAL - none + protected - 5 - wxALL + 13 + wxTOP|wxRIGHT|wxLEFT 0 - + 1 1 1 @@ -84,7 +84,6 @@ 1 0 - "Accelerated graphics" "Fallback graphics" 1 1 @@ -100,7 +99,7 @@ 0 wxID_ANY Rendering Engine - 1 + 0 0 @@ -108,7 +107,7 @@ 0 1 - m_renderingEngine + m_staticText9 1 @@ -116,20 +115,220 @@ 1 Resizable - 0 1 - wxRA_SPECIFY_COLS + ; ; forward_declare 0 - - wxFILTER_NONE - wxDefaultValidator - + -1 + + + + 5 + wxEXPAND|wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_staticline3 + 1 + + + protected + 1 + + Resizable + 1 + + wxLI_HORIZONTAL + ; ; forward_declare + 0 + + + + + + + + 5 + wxEXPAND|wxALL + 0 + + 1 + wxBOTH + + + 0 + + fgSizer2 + wxFLEX_GROWMODE_SPECIFIED + none + 0 + 4 + + 5 + wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Accelerated graphics + + 0 + + + 0 + + 1 + m_rbAccelerated + 1 + + + protected + 1 + + Resizable + 1 + + wxRB_GROUP + ; ; forward_declare + 0 + Hardware-accelerated graphics (recommended) + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + + + 5 + wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Fallback graphics + + 0 + + + 0 + + 1 + m_rbFallback + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + Software graphics (for computers which do not support KiCad's hardware acceleration requirements) + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + @@ -166,7 +365,7 @@ 0 0 wxID_ANY - Grid Options + Grid Display 0 0 @@ -255,7 +454,7 @@ 5 - wxEXPAND|wxALL + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT 0 @@ -1095,7 +1294,7 @@ 0 0 wxID_ANY - Cursor Options + Cursor 0 0 diff --git a/common/widgets/gal_options_panel_base.h b/common/widgets/gal_options_panel_base.h index 72f5d62098..ae5dd79d1b 100644 --- a/common/widgets/gal_options_panel_base.h +++ b/common/widgets/gal_options_panel_base.h @@ -11,15 +11,14 @@ #include #include #include -#include +#include #include #include #include #include -#include -#include #include #include +#include #include #include #include @@ -37,7 +36,11 @@ class GAL_OPTIONS_PANEL_BASE : public wxPanel private: protected: - wxRadioBox* m_renderingEngine; + wxBoxSizer* m_renderingSizer; + wxStaticText* m_staticText9; + wxStaticLine* m_staticline3; + wxRadioButton* m_rbAccelerated; + wxRadioButton* m_rbFallback; wxStaticText* m_staticText1; wxStaticLine* m_staticline1; wxStaticText* m_gridStyleLabel;