MSW specific: Fixed rescaling for the BitmapComboBox control and Notebook tab buttons

This commit is contained in:
YuSanka 2021-07-19 12:35:48 +02:00
parent 558336f325
commit 4b5cf004bd
9 changed files with 58 additions and 8 deletions

View file

@ -694,7 +694,9 @@ void ModeButton::focus_button(const bool focus)
// ----------------------------------------------------------------------------
ModeSizer::ModeSizer(wxWindow *parent, int hgap/* = 0*/) :
wxFlexGridSizer(3, 0, hgap)
wxFlexGridSizer(3, 0, hgap),
m_parent(parent),
m_hgap_unscaled((double)(hgap)/em_unit(parent))
{
SetFlexibleDirection(wxHORIZONTAL);
@ -739,6 +741,7 @@ void ModeSizer::set_items_border(int border)
void ModeSizer::msw_rescale()
{
this->SetHGap(std::lround(m_hgap_unscaled * em_unit(m_parent)));
for (size_t m = 0; m < m_mode_btns.size(); m++)
m_mode_btns[m]->msw_rescale();
}