mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-26 08:04:01 -06:00
DarkMode for MSW (#6632)
* MSW specific: Dark Mode: First implementation * Use menu instead of NoteBook * Implemented MessageDialog + Fixed DarkMode for all dialogs and ColorPicker * MSW DarkMode: Added missed updates for the switching between modes * MSW DarkMode: Updated all existed context menus after switching of the mode + Added markers for the menu item witch is related to the selected tab * Used wxFrame instead of wxDialog for SettingsDialog (this change allow us to use menu bar in SettingsDialog) + fix for #6548 - Prusa Slicer 2.3.1 not activating non-modal settings window if settings window is minimized * Implemented "Always use Dark mode colors" preference option * Fixes for non_MSW build * Next fixes for non-MSW builds * Preferences: Fixed selection of the Settings Layout for non-MSW platforms + Updated DarkMode for colorpickers * Windows DarkMode next fixes * MSWDarkMode: Suppress to use system color to the PrusaSlicer Select "Preferences -> Use Dark color mode (experimental)" to allow dark mode for the application * Fixed MSW build * MSWDarkMode: Upadteed color mode for ExtruderSequenceDialog and for dialogs related to the DoubleSlider * Implemented Auto recreation of the PrusaSlicer when color mode is changed. * Preferences: Added option "Set settings tabs as menu items (experimental)"
This commit is contained in:
parent
65f440c2ba
commit
fd071421cb
66 changed files with 2011 additions and 443 deletions
|
@ -411,6 +411,7 @@ bool OptionsGroup::activate(std::function<void()> throw_if_canceled)
|
|||
stb = new wxStaticBox(m_parent, wxID_ANY, _(title));
|
||||
if (!wxOSX) stb->SetBackgroundStyle(wxBG_STYLE_PAINT);
|
||||
stb->SetFont(wxOSX ? wxGetApp().normal_font() : wxGetApp().bold_font());
|
||||
wxGetApp().UpdateDarkUI(stb);
|
||||
}
|
||||
else
|
||||
stb = nullptr;
|
||||
|
@ -738,6 +739,39 @@ void ConfigOptionsGroup::msw_rescale()
|
|||
|
||||
void ConfigOptionsGroup::sys_color_changed()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
if (staticbox && stb) {
|
||||
wxGetApp().UpdateAllStaticTextDarkUI(stb);
|
||||
// update bitmaps for extra column items (like "delete" buttons on settings panel)
|
||||
for (auto extra_col : m_extra_column_item_ptrs)
|
||||
wxGetApp().UpdateDarkUI(extra_col);
|
||||
}
|
||||
|
||||
auto update = [](wxSizer* sizer) {
|
||||
for (wxSizerItem* item : sizer->GetChildren())
|
||||
if (item->IsWindow()) {
|
||||
wxWindow* win = item->GetWindow();
|
||||
// check if window is ScalableButton
|
||||
if (ScalableButton* sc_btn = dynamic_cast<ScalableButton*>(win)) {
|
||||
sc_btn->msw_rescale();
|
||||
return;
|
||||
}
|
||||
wxGetApp().UpdateDarkUI(win, dynamic_cast<wxButton*>(win) != nullptr);
|
||||
}
|
||||
};
|
||||
|
||||
// scale widgets and extra widgets if any exists
|
||||
for (const Line& line : m_lines) {
|
||||
if (line.widget_sizer)
|
||||
update(line.widget_sizer);
|
||||
if (line.extra_widget_sizer)
|
||||
update(line.extra_widget_sizer);
|
||||
}
|
||||
|
||||
if (custom_ctrl)
|
||||
wxGetApp().UpdateDarkUI(custom_ctrl);
|
||||
#endif
|
||||
|
||||
// update undo buttons : rescale bitmaps
|
||||
for (const auto& field : m_fields)
|
||||
field.second->sys_color_changed();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue