Remove manual canvas scale from GTK

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9912
This commit is contained in:
Jon Evans 2021-12-09 18:36:44 -05:00
parent 62e6f542ed
commit 3cb7ca1db4
4 changed files with 43 additions and 37 deletions

View File

@ -181,6 +181,8 @@ static const wxChar ShowRepairSchematic[] = wxT( "ShowRepairSchematic" );
static const wxChar ShowEventCounters[] = wxT( "ShowEventCounters" );
static const wxChar AllowManualCanvasScale[] = wxT( "AllowManualCanvasScale" );
} // namespace KEYS
@ -288,6 +290,7 @@ ADVANCED_CFG::ADVANCED_CFG()
m_Skip3DModelMemoryCache = false;
m_HideVersionFromTitle = false;
m_ShowEventCounters = false;
m_AllowManualCanvasScale = false;
loadFromConfigFile();
}
@ -406,6 +409,9 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ShowEventCounters,
&m_ShowEventCounters, false ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::AllowManualCanvasScale,
&m_AllowManualCanvasScale, false ) );
// Special case for trace mask setting...we just grab them and set them immediately
// Because we even use wxLogTrace inside of advanced config
wxString traceMasks = "";
@ -416,6 +422,7 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
// Now actually set the trace masks
wxStringTokenizer traceMaskTokenizer( traceMasks, "," );
while( traceMaskTokenizer.HasMoreTokens() )
{
wxString mask = traceMaskTokenizer.GetNextToken();

View File

@ -95,10 +95,10 @@ PANEL_COMMON_SETTINGS::PANEL_COMMON_SETTINGS( DIALOG_SHIM* aDialog, wxWindow* aP
#endif
/*
* Automatic canvas scaling works fine on Mac and MSW, and on GTK under wxWidgets 3.1 or
* better.
* Automatic canvas scaling works fine on all supported platforms, so manual scaling is disabled
*/
#if defined( __WXGTK__ ) && !wxCHECK_VERSION( 3, 1, 0 )
if( ADVANCED_CFG::GetCfg().m_AllowManualCanvasScale )
{
static constexpr int dpi_scaling_precision = 1;
static constexpr double dpi_scaling_increment = 0.5;
@ -123,12 +123,14 @@ PANEL_COMMON_SETTINGS::PANEL_COMMON_SETTINGS( DIALOG_SHIM* aDialog, wxWindow* aP
"\n\n"
"On some platforms, the automatic value is incorrect and should be "
"set manually." ) );
#else
}
else
{
m_staticTextCanvasScale->Show( false );
m_canvasScaleCtrl->Show( false );
m_canvasScaleCtrl = nullptr;
m_canvasScaleAuto->Show( false );
#endif
}
/*
* Font scaling hacks are only needed on GTK under wxWidgets 3.0.

View File

@ -77,15 +77,10 @@ COMMON_SETTINGS::COMMON_SETTINGS() :
#endif
/*
* Automatic canvas scaling works fine on Mac and MSW, and on GTK under wxWidgets 3.1 or
* better.
* Automatic canvas scaling works fine on all supported platforms, so it's no longer exposed as
* a configuration option.
*/
#if defined( __WXGTK__ ) && !wxCHECK_VERSION( 3, 1, 0 )
m_params.emplace_back( new PARAM<double>( "appearance.canvas_scale",
&m_Appearance.canvas_scale, 1.0 ) );
#else
m_Appearance.canvas_scale = 0.0;
#endif
/*
* Menu icons are off by default on OSX and on for all other platforms.

View File

@ -202,6 +202,8 @@ public:
*/
bool m_ShowEventCounters;
bool m_AllowManualCanvasScale;
private:
ADVANCED_CFG();