Fix Swatch sizes
The swatches are surrounded by non-scaling icons. We should not scale the swatches unless we also scale the icons. This patch makes all elements in the appearance panel equally non-scaling This relates to https://gitlab.com/kicad/code/kicad/-/issues/11880
This commit is contained in:
parent
2ff2a6ffcd
commit
25c3a4681f
|
@ -124,13 +124,36 @@ COLOR_SWATCH::COLOR_SWATCH( wxWindow* aParent, const COLOR4D& aColor, int aID,
|
||||||
|
|
||||||
switch( aSwatchSize )
|
switch( aSwatchSize )
|
||||||
{
|
{
|
||||||
case SWATCH_MEDIUM: m_size = ConvertDialogToPixels( SWATCH_SIZE_MEDIUM_DU ); break;
|
case SWATCH_MEDIUM:
|
||||||
case SWATCH_SMALL: m_size = ConvertDialogToPixels( SWATCH_SIZE_SMALL_DU ); break;
|
m_size = ConvertDialogToPixels( SWATCH_SIZE_MEDIUM_DU );
|
||||||
case SWATCH_LARGE: m_size = ConvertDialogToPixels( SWATCH_SIZE_LARGE_DU ); break;
|
m_checkerboardSize = ConvertDialogToPixels( CHECKERBOARD_SIZE_DU );
|
||||||
case SWATCH_EXPAND: m_size = ConvertDialogToPixels( SWATCH_SIZE_LARGE_DU ); break;
|
break;
|
||||||
|
case SWATCH_SMALL:
|
||||||
|
m_size = ConvertDialogToPixels( SWATCH_SIZE_SMALL_DU );
|
||||||
|
m_checkerboardSize = ConvertDialogToPixels( CHECKERBOARD_SIZE_DU );
|
||||||
|
break;
|
||||||
|
case SWATCH_LARGE:
|
||||||
|
m_size = ConvertDialogToPixels( SWATCH_SIZE_LARGE_DU );
|
||||||
|
m_checkerboardSize = ConvertDialogToPixels( CHECKERBOARD_SIZE_DU );
|
||||||
|
break;
|
||||||
|
case SWATCH_EXPAND:
|
||||||
|
m_size = ConvertDialogToPixels( SWATCH_SIZE_LARGE_DU );
|
||||||
|
m_checkerboardSize = ConvertDialogToPixels( CHECKERBOARD_SIZE_DU );
|
||||||
|
break;
|
||||||
|
case SWATCH_FIXED_SMALL:
|
||||||
|
m_size = SWATCH_SIZE_SMALL_PX;
|
||||||
|
m_checkerboardSize = CHECKERBOARD_SIZE_PX;
|
||||||
|
break;
|
||||||
|
case SWATCH_FIXED_MEDIUM:
|
||||||
|
m_size = SWATCH_SIZE_MEDIUM_PX;
|
||||||
|
m_checkerboardSize = CHECKERBOARD_SIZE_PX;
|
||||||
|
break;
|
||||||
|
case SWATCH_FIXED_LARGE:
|
||||||
|
m_size = SWATCH_SIZE_LARGE_PX;
|
||||||
|
m_checkerboardSize = CHECKERBOARD_SIZE_PX;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_checkerboardSize = ConvertDialogToPixels( CHECKERBOARD_SIZE_DU );
|
|
||||||
m_checkerboardBg = aParent->GetBackgroundColour();
|
m_checkerboardBg = aParent->GetBackgroundColour();
|
||||||
|
|
||||||
auto sizer = new wxBoxSizer( wxHORIZONTAL );
|
auto sizer = new wxBoxSizer( wxHORIZONTAL );
|
||||||
|
|
|
@ -43,7 +43,7 @@ GRID_CELL_COLOR_RENDERER::GRID_CELL_COLOR_RENDERER( wxWindow* aParent, SWATCH_SI
|
||||||
case SWATCH_MEDIUM: m_size = m_parent->ConvertDialogToPixels( SWATCH_SIZE_MEDIUM_DU ); break;
|
case SWATCH_MEDIUM: m_size = m_parent->ConvertDialogToPixels( SWATCH_SIZE_MEDIUM_DU ); break;
|
||||||
case SWATCH_SMALL: m_size = m_parent->ConvertDialogToPixels( SWATCH_SIZE_SMALL_DU ); break;
|
case SWATCH_SMALL: m_size = m_parent->ConvertDialogToPixels( SWATCH_SIZE_SMALL_DU ); break;
|
||||||
case SWATCH_LARGE: m_size = m_parent->ConvertDialogToPixels( SWATCH_SIZE_LARGE_DU ); break;
|
case SWATCH_LARGE: m_size = m_parent->ConvertDialogToPixels( SWATCH_SIZE_LARGE_DU ); break;
|
||||||
case SWATCH_EXPAND: m_size = wxDefaultSize; break;
|
default: m_size = wxDefaultSize; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_checkerboardSize = m_parent->ConvertDialogToPixels( CHECKERBOARD_SIZE_DU );
|
m_checkerboardSize = m_parent->ConvertDialogToPixels( CHECKERBOARD_SIZE_DU );
|
||||||
|
|
|
@ -40,7 +40,10 @@ enum SWATCH_SIZE
|
||||||
SWATCH_SMALL,
|
SWATCH_SMALL,
|
||||||
SWATCH_MEDIUM,
|
SWATCH_MEDIUM,
|
||||||
SWATCH_LARGE,
|
SWATCH_LARGE,
|
||||||
SWATCH_EXPAND
|
SWATCH_EXPAND,
|
||||||
|
SWATCH_FIXED_SMALL,
|
||||||
|
SWATCH_FIXED_MEDIUM,
|
||||||
|
SWATCH_FIXED_LARGE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,6 +52,11 @@ const static wxSize SWATCH_SIZE_MEDIUM_DU( 24, 10 );
|
||||||
const static wxSize SWATCH_SIZE_LARGE_DU( 24, 16 );
|
const static wxSize SWATCH_SIZE_LARGE_DU( 24, 16 );
|
||||||
const static wxSize CHECKERBOARD_SIZE_DU( 3, 3 );
|
const static wxSize CHECKERBOARD_SIZE_DU( 3, 3 );
|
||||||
|
|
||||||
|
const static wxSize SWATCH_SIZE_SMALL_PX( 24, 24 );
|
||||||
|
const static wxSize SWATCH_SIZE_MEDIUM_PX( 48, 48 );
|
||||||
|
const static wxSize SWATCH_SIZE_LARGE_PX( 64, 64 );
|
||||||
|
const static wxSize CHECKERBOARD_SIZE_PX( 9, 12 );
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A simple color swatch of the kind used to set layer colors.
|
* A simple color swatch of the kind used to set layer colors.
|
||||||
|
|
|
@ -1461,7 +1461,7 @@ void APPEARANCE_CONTROLS::rebuildLayers()
|
||||||
|
|
||||||
COLOR_SWATCH* swatch = new COLOR_SWATCH( panel, COLOR4D::UNSPECIFIED, layer,
|
COLOR_SWATCH* swatch = new COLOR_SWATCH( panel, COLOR4D::UNSPECIFIED, layer,
|
||||||
bgColor, theme->GetColor( layer ),
|
bgColor, theme->GetColor( layer ),
|
||||||
SWATCH_SMALL );
|
SWATCH_FIXED_SMALL );
|
||||||
swatch->SetToolTip( _( "Double click or middle click for color change, "
|
swatch->SetToolTip( _( "Double click or middle click for color change, "
|
||||||
"right click for menu" ) );
|
"right click for menu" ) );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue