Reworked sys_color_changed() functions

Fixed OSX specific bugs:
- toolbar flashing for some mainframe sizes (Retina specific)
- size of mainframe when settings layout in slNew mode

Added missed icons to the "white" folder
This commit is contained in:
YuSanka 2020-05-22 15:23:05 +02:00
parent c09d702045
commit a56bbea140
17 changed files with 135 additions and 11 deletions

View file

@ -272,6 +272,33 @@ void ObjectLayers::msw_rescale()
m_grid_sizer->Layout();
}
void ObjectLayers::sys_color_changed()
{
m_bmp_delete.msw_rescale();
m_bmp_add.msw_rescale();
m_grid_sizer->SetHGap(wxGetApp().em_unit());
// rescale edit-boxes
const int cells_cnt = m_grid_sizer->GetCols() * m_grid_sizer->GetEffectiveRowsCount();
for (int i = 0; i < cells_cnt; i++)
{
const wxSizerItem* item = m_grid_sizer->GetItem(i);
if (item->IsSizer()) {// case when we have editor with buttons
const std::vector<size_t> btns = {2, 3}; // del_btn, add_btn
for (auto btn : btns) {
wxSizerItem* b_item = item->GetSizer()->GetItem(btn);
if (b_item->IsWindow()) {
auto button = dynamic_cast<PlusMinusButton*>(b_item->GetWindow());
if (button != nullptr)
button->msw_rescale();
}
}
}
}
m_grid_sizer->Layout();
}
void ObjectLayers::reset_selection()
{
m_selectable_range = { 0.0, 0.0 };