diff --git a/resources/images/completed_2.svg b/resources/images/completed_2.svg index 99b723b387..98dc19e550 100644 --- a/resources/images/completed_2.svg +++ b/resources/images/completed_2.svg @@ -1,4 +1 @@ - - - - + \ No newline at end of file diff --git a/resources/images/dev_rack_home.svg b/resources/images/dev_rack_home.svg index 76b59944de..5f97953fa9 100644 --- a/resources/images/dev_rack_home.svg +++ b/resources/images/dev_rack_home.svg @@ -1,3 +1 @@ - - - + \ No newline at end of file diff --git a/resources/images/leaf.svg b/resources/images/leaf.svg index 48a3acf795..e25b7a9c95 100644 --- a/resources/images/leaf.svg +++ b/resources/images/leaf.svg @@ -1,4 +1 @@ - - - - + \ No newline at end of file diff --git a/resources/images/refresh_nozzle.svg b/resources/images/refresh_nozzle.svg index dcff81bcaa..3e21194ea4 100644 --- a/resources/images/refresh_nozzle.svg +++ b/resources/images/refresh_nozzle.svg @@ -2,8 +2,8 @@ - - + + diff --git a/resources/images/refresh_nozzle_1.svg b/resources/images/refresh_nozzle_1.svg index aa85d1e888..5329e754f4 100644 --- a/resources/images/refresh_nozzle_1.svg +++ b/resources/images/refresh_nozzle_1.svg @@ -2,8 +2,8 @@ - - + + diff --git a/resources/images/refresh_nozzle_2.svg b/resources/images/refresh_nozzle_2.svg index 5209c851b0..63569a64f7 100644 --- a/resources/images/refresh_nozzle_2.svg +++ b/resources/images/refresh_nozzle_2.svg @@ -2,8 +2,8 @@ - - + + diff --git a/resources/images/refresh_nozzle_3.svg b/resources/images/refresh_nozzle_3.svg index f59dded8b8..a44b9ed99e 100644 --- a/resources/images/refresh_nozzle_3.svg +++ b/resources/images/refresh_nozzle_3.svg @@ -2,8 +2,8 @@ - - + + diff --git a/resources/images/refresh_nozzle_4.svg b/resources/images/refresh_nozzle_4.svg index 2d89fec145..8aab7a44f4 100644 --- a/resources/images/refresh_nozzle_4.svg +++ b/resources/images/refresh_nozzle_4.svg @@ -2,8 +2,8 @@ - - + + diff --git a/resources/images/shield.svg b/resources/images/shield.svg index 643ada60ad..f23430303c 100644 --- a/resources/images/shield.svg +++ b/resources/images/shield.svg @@ -1,4 +1 @@ - - - - + \ No newline at end of file diff --git a/src/slic3r/GUI/Auxiliary.cpp b/src/slic3r/GUI/Auxiliary.cpp index cabda0fc84..d523b7eae3 100644 --- a/src/slic3r/GUI/Auxiliary.cpp +++ b/src/slic3r/GUI/Auxiliary.cpp @@ -1152,6 +1152,7 @@ void AuxiliaryPanel::update_all_cover() m_sizer_description->Add(m_text_description, 0, wxALIGN_TOP | wxRIGHT, FromDIP(10)); m_input_description = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(FromDIP(450), FromDIP(300)), wxTE_MULTILINE | wxTE_PROCESS_ENTER); + m_input_description->SetBackgroundColour(*wxWHITE); m_input_description->SetFont(::Label::Body_14); m_sizer_description->Add(m_input_description, 0, wxALIGN_CENTER, 0); diff --git a/src/slic3r/GUI/EditGCodeDialog.cpp b/src/slic3r/GUI/EditGCodeDialog.cpp index c9646295c0..917ff56013 100644 --- a/src/slic3r/GUI/EditGCodeDialog.cpp +++ b/src/slic3r/GUI/EditGCodeDialog.cpp @@ -78,6 +78,7 @@ EditGCodeDialog::EditGCodeDialog(wxWindow* parent, const std::string& key, const m_search_bar->ShowCancelButton(true); m_search_bar->SetDescriptiveText(_L("Search G-code placeholders")); m_search_bar->SetForegroundColour(*wxBLACK); + m_search_bar->SetBackgroundColour(*wxWHITE); wxGetApp().UpdateDarkUI(m_search_bar); m_search_bar->Bind(wxEVT_SET_FOCUS, [](wxFocusEvent&) { @@ -90,6 +91,7 @@ EditGCodeDialog::EditGCodeDialog(wxWindow* parent, const std::string& key, const param_sizer->Add(m_search_bar, 0, wxEXPAND | wxALL, border); m_params_list = new ParamsViewCtrl(this, wxDefaultSize); + m_params_list->SetBackgroundColour(*wxWHITE); m_params_list->SetFont(wxGetApp().code_font()); wxGetApp().UpdateDarkUI(m_params_list); param_sizer->Add(m_params_list, 1, wxEXPAND | wxALL, border); @@ -104,6 +106,7 @@ EditGCodeDialog::EditGCodeDialog(wxWindow* parent, const std::string& key, const ); m_gcode_editor->SetFont(wxGetApp().code_font()); + m_gcode_editor->SetBackgroundColour(*wxWHITE); m_gcode_editor->SetInsertionPointEnd(); wxGetApp().UpdateDarkUI(m_gcode_editor); diff --git a/src/slic3r/GUI/Field.cpp b/src/slic3r/GUI/Field.cpp index 8ca4722e3d..183a1a5048 100644 --- a/src/slic3r/GUI/Field.cpp +++ b/src/slic3r/GUI/Field.cpp @@ -1015,8 +1015,11 @@ void TextCtrl::BUILD() { if (m_opt.is_code) temp->SetFont(Slic3r::GUI::wxGetApp().normal_font()); + if(m_opt.multiline){ + temp->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#262E30"))); // only effects wxTextCtrl + temp->SetBackgroundColour(StateColor::darkModeColorFor(*wxWHITE)); + } - temp->SetForegroundColour(StateColor::darkModeColorFor(*wxBLACK)); wxGetApp().UpdateDarkUI(temp); if (! m_opt.multiline && !wxOSX) @@ -2505,7 +2508,7 @@ nlohmann::json plugin_overrides_as_json(const std::string& text) void PluginConfigField::BUILD() { - m_button = new ::Button(m_parent, _L("Configure")); + m_button = new ::Button(m_parent, _L("Configure") + dots); // ButtonType::Parameter gives the button the same height as the parameter fields above it. m_button->SetStyle(ButtonStyle::Regular, ButtonType::Parameter); @@ -2535,7 +2538,7 @@ void PluginConfigField::update_button_label() const nlohmann::json entries = plugin_overrides_as_json(m_json); const size_t count = entries.is_array() ? entries.size() : 0; - m_button->SetLabel(count == 0 ? _L("Configure") + m_button->SetLabel(count == 0 ? _L("Configure" + dots) : wxString::Format(_L("Configure (%d)"), int(count))); } diff --git a/src/slic3r/GUI/FilamentMapDialog.cpp b/src/slic3r/GUI/FilamentMapDialog.cpp index e23d0c5d0f..5c3a72596b 100644 --- a/src/slic3r/GUI/FilamentMapDialog.cpp +++ b/src/slic3r/GUI/FilamentMapDialog.cpp @@ -340,7 +340,7 @@ FilamentMapDialog::FilamentMapDialog(wxWindow *parent, bottom_sizer->Add(dlg_btns, 0, wxEXPAND); } - main_sizer->Add(bottom_panel, 0, wxEXPAND); + main_sizer->Add(bottom_panel, 0, wxEXPAND | wxTOP, FromDIP(15)); m_ok_btn->Bind(wxEVT_BUTTON, &FilamentMapDialog::on_ok, this); m_cancel_btn->Bind(wxEVT_BUTTON, &FilamentMapDialog::on_cancel, this); diff --git a/src/slic3r/GUI/FilamentMapPanel.cpp b/src/slic3r/GUI/FilamentMapPanel.cpp index 599a41dff8..60dc0cf42b 100644 --- a/src/slic3r/GUI/FilamentMapPanel.cpp +++ b/src/slic3r/GUI/FilamentMapPanel.cpp @@ -524,22 +524,26 @@ GUI::FilamentMapBtnPanel::FilamentMapBtnPanel(wxWindow *parent, const wxString & m_btn = new wxBitmapButton(this, wxID_ANY, icon_enabled, wxDefaultPosition, wxDefaultSize, wxNO_BORDER); m_btn->SetBackgroundStyle(wxBG_STYLE_PAINT); + auto icon_sizer = new wxBoxSizer(wxVERTICAL); + icon_sizer->Add(m_btn , 0, wxLEFT, horizontal_margin); + m_label = new wxStaticText(this, wxID_ANY, label); m_label->SetFont(Label::Head_14); m_label->SetForegroundColour(TextNormalBlackColor); - auto label_sizer = new wxBoxSizer(wxHORIZONTAL); - label_sizer->AddStretchSpacer(); - label_sizer->Add(m_btn, 0, wxEXPAND | wxLEFT, FromDIP(1)); - label_sizer->Add(m_label, 0, wxEXPAND| wxALL, FromDIP(3)); - label_sizer->AddStretchSpacer(); + auto label_sizer = new wxBoxSizer(wxVERTICAL); + label_sizer->Add(m_label, 0, wxLEFT, horizontal_margin); m_disable_tip = new Label(this, _L("(Sync with printer)")); + m_disable_tip->SetFont(Label::Body_12); + label_sizer->AddSpacer(FromDIP(2)); + label_sizer->Add(m_disable_tip, 0, wxLEFT, horizontal_margin); - sizer->AddSpacer(FromDIP(32)); + sizer->AddSpacer(FromDIP(15)); + sizer->Add(icon_sizer, 0, wxEXPAND); + sizer->AddSpacer(FromDIP(10)); sizer->Add(label_sizer, 0, wxEXPAND); - sizer->Add(m_disable_tip, 0, wxALIGN_CENTER); - sizer->AddSpacer(FromDIP(3)); + sizer->AddSpacer(FromDIP(6)); auto detail_sizer = new wxBoxSizer(wxHORIZONTAL); m_detail = new Label(this, detail); diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index e3d7d14d30..6c56e4fa54 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -675,7 +675,14 @@ void GCodeViewer::SequentialView::Marker::render_position_window(const libvgcode ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse); ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, ImVec2(9.f, 1.f) * m_scale); ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0.f, 0.f)); + + ImVec4 scroll_col = ImVec4(0.77f, 0.77f, 0.77f, m_is_dark ? .6f : 1.0f); // same color with sliced plates toolbar scrollbar + ImGui::PushStyleColor(ImGuiCol_ScrollbarBg, ImVec4(0.f, 0.f, 0.f, 0.f)); // ORCA using background color with opacity creates a second color. This prevents secondary color + ImGui::PushStyleColor(ImGuiCol_ScrollbarGrabActive, scroll_col); + ImGui::PushStyleColor(ImGuiCol_ScrollbarGrabHovered, scroll_col); + ImGui::PushStyleColor(ImGuiCol_ScrollbarGrab, scroll_col); ImGui::PushStyleColor(ImGuiCol_HeaderHovered , style.Colors[ImGuiCol_TableHeaderBg]); + const int hover_id = m_actual_speed_imgui_widget.plot("##ActualSpeedProfile", { -1.f, plot_height}); const ImGuiTableFlags table_flags = ImGuiTableFlags_Borders | (needs_scroll ? ImGuiTableFlags_ScrollY : 0); if (ImGui::BeginTable("ToolPositionTable", 2, table_flags, ImVec2(0.0f, needs_scroll ? table_view_h : 0.0f))) { @@ -703,7 +710,7 @@ void GCodeViewer::SequentialView::Marker::render_position_window(const libvgcode ImGui::EndTable(); } ImGui::PopStyleVar(2); - ImGui::PopStyleColor(1); + ImGui::PopStyleColor(5); imgui.end(); } diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 3ac425db0a..502b22234b 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -9627,7 +9627,7 @@ void GLCanvas3D::_render_imgui_select_plate_toolbar() int item_count = m_sel_plate_toolbar.m_items.size() + (m_sel_plate_toolbar.show_stats_item ? 1 : 0); float window_height_calc = (item_count * (button_height + (margin_size + button_margin) * 2.0f) + (item_count - 1) * ImGui::GetStyle().ItemSpacing.y + ImGui::GetStyle().WindowPadding.y * 2.0f); bool show_scroll = m_sel_plate_toolbar.is_display_scrollbar && (window_height_calc > window_height_max); - float scrollbar_size = 10.0f * f_scale ; + float scrollbar_size = 14.0f * f_scale; float window_height = std::min(window_height_calc, window_height_max); float window_width = button_width + (margin_size + button_margin + ImGui::GetStyle().WindowPadding.x) * 2 + (show_scroll ? scrollbar_size : 0); @@ -9653,7 +9653,7 @@ void GLCanvas3D::_render_imgui_select_plate_toolbar() ImGui::PushStyleVar(ImGuiStyleVar_ScrollbarSize, scrollbar_size); ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.0f); - ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, show_scroll ? (4.0f * f_scale) : (button_radius + margin_size + frame_padding + ImGui::GetStyle().WindowPadding.x)); + ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, show_scroll ? (6.f * f_scale) : (button_radius + margin_size + frame_padding + ImGui::GetStyle().WindowPadding.x)); ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, button_radius + margin_size); imgui.set_next_window_pos(canvas_w * 0 + 5.0f * f_scale, canvas_h * 0 + y_offset, ImGuiCond_Always, 0, 0); // ORCA Add slight gap on left edge so toolbar looks like floating and it creates separation with sidebar @@ -10132,7 +10132,7 @@ void GLCanvas3D::_render_canvas_toolbar() ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding , ImVec2(4.f, 10.f) * sc); ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing , ImVec2(0.f, 8.f ) * sc); - if (ImGui::BeginPopup("CanvasToolbarMenu")) { + if (ImGui::BeginPopup("CanvasToolbarMenu", ImGuiWindowFlags_NoMove)) { ImGui::PushItemFlag(ImGuiItemFlags_SelectableDontClosePopup, true); Plater* p = wxGetApp().plater(); diff --git a/src/slic3r/GUI/GUI_ObjectTable.cpp b/src/slic3r/GUI/GUI_ObjectTable.cpp index 526592a5cc..c21f9a0361 100644 --- a/src/slic3r/GUI/GUI_ObjectTable.cpp +++ b/src/slic3r/GUI/GUI_ObjectTable.cpp @@ -2938,10 +2938,10 @@ void ObjectTablePanel::load_data() m_object_grid->SetColLabelValue(ObjectGridTable::col_printable, _L("Printable")); m_object_grid->SetColLabelValue(ObjectGridTable::col_printable_reset, ""); - m_object_grid->SetColLabelValue(ObjectGridTable::col_plate_index, wxString::Format("%S%S", _L("Plate"), wxString::FromUTF8("\u2191\u2193"))); + m_object_grid->SetColLabelValue(ObjectGridTable::col_plate_index, wxString::Format("%S %S", _L("Plate"), wxString::FromUTF8("\u2191\u2193"))); /*m_object_grid->SetColLabelValue(ObjectGridTable::col_assemble_name, L("Module"));*/ - m_object_grid->SetColLabelValue(ObjectGridTable::col_name, wxString::Format("%S%S", _L("Name"), wxString::FromUTF8("\u2191\u2193"))); - m_object_grid->SetColLabelValue(ObjectGridTable::col_filaments, wxString::Format("%S%S", _L("Filament"), wxString::FromUTF8("\u2191\u2193"))); + m_object_grid->SetColLabelValue(ObjectGridTable::col_name, wxString::Format("%S %S", _L("Name"), wxString::FromUTF8("\u2191\u2193"))); + m_object_grid->SetColLabelValue(ObjectGridTable::col_filaments, wxString::Format("%S %S", _L("Filament"), wxString::FromUTF8("\u2191\u2193"))); m_object_grid->SetColLabelValue(ObjectGridTable::col_filaments_reset, ""); m_object_grid->SetColLabelValue(ObjectGridTable::col_layer_height, _L("Layer height")); m_object_grid->SetColLabelValue(ObjectGridTable::col_layer_height_reset, ""); @@ -2956,8 +2956,8 @@ void ObjectTablePanel::load_data() m_object_grid->SetColLabelValue(ObjectGridTable::col_speed_perimeter, _L("Outer wall speed")); m_object_grid->SetColLabelValue(ObjectGridTable::col_speed_perimeter_reset, ""); m_object_grid->SetLabelFont(Label::Head_13); - m_object_grid->SetLabelTextColour(StateColor::darkModeColorFor(wxColour("#303A3C"))); - m_object_grid->SetLabelBackgroundColour( wxColour("#FFFFFF")); + m_object_grid->SetLabelTextColour(StateColor::darkModeColorFor(wxColour("#363636"))); + m_object_grid->SetLabelBackgroundColour( StateColor::darkModeColorFor(wxColour("#D9D9D9"))); #else m_object_grid->HideColLabels(); #endif @@ -2996,6 +2996,12 @@ void ObjectTablePanel::load_data() //m_object_grid->SetSelectionForeground(wxColour(0xDB,0xFD,0xE7)); //m_object_grid->SetSelectionBackground(*wxWHITE); m_object_grid->SetDefaultCellBackgroundColour(StateColor::darkModeColorFor(*wxWHITE)); + m_object_grid->SetSelectionBackground(StateColor::darkModeColorFor(wxColour("#BFE1DE"))); // its not fully working since background of control's covers cell + + m_object_grid->SetCellHighlightColour(StateColor::darkModeColorFor(wxColour("#009688"))); + m_object_grid->SetCellHighlightPenWidth(FromDIP(1)); + m_object_grid->SetCellHighlightROPenWidth(FromDIP(1)); // Highlight for read-only cells + for (int col = 0; col < cols; col++) { ObjectGridTable::ObjectGridCol* grid_col = m_object_grid_table->get_grid_col(col); diff --git a/src/slic3r/GUI/GUI_Utils.cpp b/src/slic3r/GUI/GUI_Utils.cpp index f8ec0d3c90..63172ad9f8 100644 --- a/src/slic3r/GUI/GUI_Utils.cpp +++ b/src/slic3r/GUI/GUI_Utils.cpp @@ -665,6 +665,42 @@ void RemoveInputBorder(wxWindow* win) ); #endif } + +void SetGaugeColor(wxGauge* gauge, const wxString& barColor, const wxString& troughColor) +{ + GtkWidget* widget = gauge->GetHandle(); // native GtkWidget* + if (!widget) return; + +#if GTK_CHECK_VERSION(3, 0, 0) + // GTK3+: use CSS provider + GtkCssProvider* provider = gtk_css_provider_new(); + wxString css = wxString::Format( + "progressbar trough { background-color: %s; }" + "progressbar progress { background-color: %s; background-image: none; }", + troughColor, + barColor + ); + +#if GTK_CHECK_VERSION(4, 0, 0) + // GTK4 + gtk_css_provider_load_from_data(provider, css.utf8_str(), -1); +#else + // GTK3 + gtk_css_provider_load_from_data(provider, css.utf8_str(), -1, nullptr); +#endif + + GtkStyleContext* ctx = gtk_widget_get_style_context(widget); + gtk_style_context_add_provider( + ctx, + GTK_STYLE_PROVIDER(provider), + GTK_STYLE_PROVIDER_PRIORITY_APPLICATION + ); + + g_object_unref(provider); + +#endif +} + #endif // __WXGTK__ #ifdef __linux__ diff --git a/src/slic3r/GUI/GUI_Utils.hpp b/src/slic3r/GUI/GUI_Utils.hpp index f77e6b6bc0..67c66ac642 100644 --- a/src/slic3r/GUI/GUI_Utils.hpp +++ b/src/slic3r/GUI/GUI_Utils.hpp @@ -37,6 +37,10 @@ #include "libslic3r/Utils.hpp" #include "libslic3r/Color.hpp" +#ifdef __WXGTK__ +#include "wx/gauge.h" +#endif + class wxCheckBox; class wxTopLevelWindow; @@ -495,6 +499,7 @@ void set_window_corner_radius(wxWindow* win, int radius); #ifdef __WXGTK__ void RemoveButtonBorder(wxWindow* win); // for wxButton/wxBitmapToggleButton based controls (SwitchButton, CheckBox) void RemoveInputBorder(wxWindow* win); // for TextCtrl based controls (TextInput, ComboBox, SpinInput..) +void SetGaugeColor(wxGauge* gauge, const wxString& barColor, const wxString& troughColor); #endif #if defined(__WXOSX__) || defined(__linux__) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp b/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp index d505dd5845..f4f8dc0151 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp @@ -1055,7 +1055,7 @@ void GLGizmoMmuSegmentation::render_filament_remap_ui(float window_width, float ImGui::PushStyleColor(ImGuiCol_PopupBg, ImGui::GetStyleColorVec4(ImGuiCol_WindowBg)); ImGui::PushStyleColor(ImGuiCol_Border , ImGui::ColorConvertFloat4ToU32(ImGuiWrapper::COL_ORCA)); - if (ImGui::BeginPopup(pop_id.c_str())) { + if (ImGui::BeginPopup(pop_id.c_str(), ImGuiWindowFlags_NoMove)) { m_imgui->text(_L("To:")); diff --git a/src/slic3r/GUI/IMSlider.cpp b/src/slic3r/GUI/IMSlider.cpp index dab0c229e2..ce2aa2ecba 100644 --- a/src/slic3r/GUI/IMSlider.cpp +++ b/src/slic3r/GUI/IMSlider.cpp @@ -1524,7 +1524,7 @@ void IMSlider::render_add_menu() ImGui::OpenPopup("slider_add_menu_popup"); m_show_menu = false; } - if (ImGui::BeginPopup("slider_add_menu_popup")) { + if (ImGui::BeginPopup("slider_add_menu_popup", ImGuiWindowFlags_NoMove)) { bool menu_item_enable = m_draw_mode != dmSequentialFffPrint; bool hovered = false; { @@ -1579,7 +1579,7 @@ void IMSlider::render_edit_menu(const TickCode& tick) ImGui::OpenPopup("slider_edit_menu_popup"); m_show_menu = false; } - if (ImGui::BeginPopup("slider_edit_menu_popup")) { + if (ImGui::BeginPopup("slider_edit_menu_popup", ImGuiWindowFlags_NoMove)) { switch (tick.type) { case CustomGCode::PausePrint: diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index a86d205a11..ca33ef37b1 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -936,7 +936,7 @@ struct Sidebar::priv // that Orca's sidebar has no counterpart for, so these are parented to p->scrolled. wxPanel* m_btn_add_mixed_filament{nullptr}; // "+ Add Mixed Filament" full-width button wxPanel* m_panel_mixed_title{nullptr}; // title row: "Mixed Filament" + add/del buttons - wxStaticText* m_text_mixed_title{nullptr}; + StaticLine* m_text_mixed_title{nullptr}; ScalableButton* m_btn_mixed_add{nullptr}; ScalableButton* m_btn_mixed_del{nullptr}; wxScrolledWindow* m_mixed_scroll_area{nullptr}; // independent scrollbar for mixed rows @@ -3436,10 +3436,10 @@ Sidebar::Sidebar(Plater *parent) p->m_panel_mixed_title->SetBackgroundColour(StateColor::darkModeColorFor(*wxWHITE)); { auto* title_sizer = new wxBoxSizer(wxHORIZONTAL); - p->m_text_mixed_title = new wxStaticText(p->m_panel_mixed_title, wxID_ANY, _L("Mixed Filament")); + p->m_text_mixed_title = new StaticLine(p->m_panel_mixed_title, false, _L("Mixed Filament")); p->m_text_mixed_title->SetFont(::Label::Head_14); - title_sizer->Add(p->m_text_mixed_title, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(SidebarProps::TitlebarMargin())); - title_sizer->AddStretchSpacer(); + p->m_text_mixed_title->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#363636"))); + title_sizer->Add(p->m_text_mixed_title, 1, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(SidebarProps::TitlebarMargin())); p->m_btn_mixed_del = new ScalableButton(p->m_panel_mixed_title, wxID_ANY, "delete_filament"); p->m_btn_mixed_del->SetToolTip(_L("Remove last mixed filament")); @@ -3579,6 +3579,7 @@ Sidebar::Sidebar(Plater *parent) search_sizer->Fit(p->m_search_bar); p->m_object_list = new ObjectList(p->scrolled); + p->m_object_list->SetBackgroundColour(*wxWHITE); p->m_object_list->Bind(wxCUSTOMEVT_EXIT_SEARCH, [this](wxCommandEvent&) { #ifdef __WXGTK__ this->p->m_search_item->Enable(true); @@ -4306,7 +4307,7 @@ void Sidebar::update_mixed_filament_list() wxWindowUpdateLocker noUpdates(this); const wxColour mc_bg = StateColor::darkModeColorFor(*wxWHITE); - const wxColour mc_border = StateColor::darkModeColorFor(wxColour("#CECECE")); + const wxColour mc_border = StateColor::darkModeColorFor(wxColour("#DBDBDB")); // same color with filament combo box border const wxColour mc_text = StateColor::darkModeColorFor(wxColour("#262E30")); const wxColour mc_dim = StateColor::darkModeColorFor(wxColour("#ACACAC")); @@ -4420,8 +4421,9 @@ void Sidebar::update_mixed_filament_list() for (size_t i = 0; i < mixed_indices.size(); ++i) { size_t cfg_idx = mixed_indices[i]; auto* combo_and_btn_sizer = new wxBoxSizer(wxHORIZONTAL); - - combo_and_btn_sizer->Add(FromDIP(10), 0, 0, 0, 0); + + if (i == 0 || i % 2 == 0) // dont add left margin for right column items so all horizontal margins will be equal like on filaments section + combo_and_btn_sizer->AddSpacer(FromDIP(SidebarProps::ContentMargin())); // Parse components and ratios from config strings (supports 2-N components) std::vector comp_ids; @@ -4511,10 +4513,12 @@ void Sidebar::update_mixed_filament_list() dc.DrawText(txt, (sz.GetWidth() - txt_sz.GetWidth()) / 2, (sz.GetHeight() - txt_sz.GetHeight()) / 2); }); - combo_and_btn_sizer->Add(grad_panel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, FromDIP(4)); + grad_panel->Bind(wxEVT_LEFT_UP, [this, i](wxMouseEvent&) { edit_mixed_filament(i); }); // ORCA also open edit color dialog with clicking swatch + combo_and_btn_sizer->Add(grad_panel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, FromDIP(SidebarProps::ElementSpacing()) - FromDIP(2)); // ElementSpacing - 2 (from combo box)) } else { - combo_and_btn_sizer->Add(make_swatch_panel(p->m_panel_mixed_content, mix_col, mix_num), - 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, FromDIP(4)); + auto swatch_panel = make_swatch_panel(p->m_panel_mixed_content, mix_col, mix_num); + swatch_panel->Bind(wxEVT_LEFT_UP, [this, i](wxMouseEvent&) { edit_mixed_filament(i); }); // ORCA also open edit color dialog with clicking swatch + combo_and_btn_sizer->Add(swatch_panel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, FromDIP(SidebarProps::ElementSpacing()) - FromDIP(2)); // ElementSpacing - 2 (from combo box)) } auto* content_panel = new wxPanel(p->m_panel_mixed_content, wxID_ANY); @@ -4738,9 +4742,9 @@ void Sidebar::update_mixed_filament_list() PopupMenu(&menu); }); - combo_and_btn_sizer->Add(menu_btn, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(4)); + combo_and_btn_sizer->Add(menu_btn, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(SidebarProps::ElementSpacing()) - FromDIP(2)); // ElementSpacing - 2 (from combo box)) - combo_and_btn_sizer->Add(FromDIP(16), 0, 0, 0, 0); + combo_and_btn_sizer->Add(FromDIP(SidebarProps::ContentMargin()), 0, 0, 0, 0); int side = i % 2; auto* col = (side == 0) ? left_col : right_col; diff --git a/src/slic3r/GUI/Preferences.cpp b/src/slic3r/GUI/Preferences.cpp index ae6d65883a..c56a4175c9 100644 --- a/src/slic3r/GUI/Preferences.cpp +++ b/src/slic3r/GUI/Preferences.cpp @@ -2305,18 +2305,18 @@ void PreferencesDialog::create_items() auto item_show_unsupported = create_item_checkbox(_L("Show unsupported presets"), _L("Show incompatible/unsupported presets in the printer and filament dropdown lists. These presets cannot be selected."), "show_unsupported_presets"); g_sizer->Add(item_show_unsupported); - auto item_plugin_printer_agents = create_item_checkbox( - _L("(Experimental) Use printer agents instead of print hosts"), _L( - "Route print jobs for non-Bambu printers through printer plug-in agents instead of the classic print-host upload flow.\nWhen disabled, OrcaSlicer uses the legacy print-host behavior."), - "use_printer_agents"); - g_sizer->Add(item_plugin_printer_agents); - //// DEVELOPER > Experimental Features g_sizer->Add(create_item_title(_L("Experimental Features")), 1, wxEXPAND); auto item_keep_painting = create_item_checkbox(_L("Keep painted feature after mesh change"), _L("Attempt to keep painted features (color/seam/support/fuzzy etc.) after changing the object mesh (such as cut/reload from disk/simplify/fix etc.)\nHighly experimental! Slow and may create artifact."), "keep_painting"); g_sizer->Add(item_keep_painting); + auto item_plugin_printer_agents = create_item_checkbox( + _L("Use printer agents instead of print hosts"), _L( + "Route print jobs for non-Bambu printers through printer plug-in agents instead of the classic print-host upload flow.\nWhen disabled, OrcaSlicer uses the legacy print-host behavior."), + "use_printer_agents"); + g_sizer->Add(item_plugin_printer_agents); + //// DEVELOPER > Storage g_sizer->Add(create_item_title(_L("Storage")), 1, wxEXPAND); diff --git a/src/slic3r/GUI/PurgeModeDialog.cpp b/src/slic3r/GUI/PurgeModeDialog.cpp index 8bd06d6c65..1445ac03a1 100644 --- a/src/slic3r/GUI/PurgeModeDialog.cpp +++ b/src/slic3r/GUI/PurgeModeDialog.cpp @@ -22,15 +22,16 @@ #include "GUI_App.hpp" #include "wxExtensions.hpp" #include "Widgets/Button.hpp" +#include "Widgets/DialogButtons.hpp" #include "libslic3r/Utils.hpp" namespace Slic3r { namespace GUI { static const wxColour BgNormalColor = wxColour("#FFFFFF"); -static const wxColour BgSelectColor = wxColour("#EBF9F0"); +static const wxColour BgSelectColor = wxColour("#E5F0EE"); static const wxColour BorderNormalColor = wxColour("#CECECE"); -static const wxColour BorderSelectedColor = wxColour("#00AE42"); +static const wxColour BorderSelectedColor = wxColour("#009688"); static const wxColour TextNormalBlackColor = wxColour("#262E30"); static const wxColour TextNormalGreyColor = wxColour("#6B6B6B"); @@ -41,8 +42,6 @@ PurgeModeDialog::PurgeModeDialog(wxWindow *parent, PurgeModeDialogType dialog_ty SetBackgroundColour(*wxWHITE); SetMinSize(wxSize(FromDIP(520), FromDIP(320))); SetMaxSize(wxSize(FromDIP(520), FromDIP(320))); - std::string icon_path = (boost::format("%1%/images/OrcaSlicerTitle.ico") % resources_dir()).str(); - SetIcon(wxIcon(encode_path(icon_path.c_str()), wxBITMAP_TYPE_ICO)); auto main_sizer = new wxBoxSizer(wxVERTICAL); @@ -87,18 +86,10 @@ PurgeModeDialog::PurgeModeDialog(wxWindow *parent, PurgeModeDialogType dialog_ty auto btn_sizer = new wxBoxSizer(wxHORIZONTAL); btn_sizer->AddStretchSpacer(); - auto ok_btn = new Button(this, _L("Confirm")); - ok_btn->SetStyle(ButtonStyle::Confirm, ButtonType::Compact); - ok_btn->SetId(wxID_OK); + auto dlg_btns = new DialogButtons(this, {"OK", "Cancel"}); + dlg_btns->GetOK()->SetLabel(_L("Confirm")); - auto cancel_btn = new Button(this, _L("Cancel")); - cancel_btn->SetStyle(ButtonStyle::Regular, ButtonType::Compact); - cancel_btn->SetId(wxID_CANCEL); - - btn_sizer->Add(ok_btn, 0, wxRIGHT, FromDIP(12)); - btn_sizer->Add(cancel_btn, 0); - - main_sizer->Add(btn_sizer, 0, wxEXPAND | wxALL, FromDIP(20)); + main_sizer->Add(dlg_btns, 0, wxEXPAND); SetSizer(main_sizer); Fit(); @@ -128,7 +119,7 @@ void PurgeModeDialog::on_dpi_changed(const wxRect &suggested_rect) { const int &em = em_unit(); - msw_buttons_rescale(this, em, {wxID_OK, wxID_CANCEL}); + //msw_buttons_rescale(this, em, {wxID_OK, wxID_CANCEL}); const wxSize &size = wxSize(70 * em, 32 * em); SetMinSize(size); diff --git a/src/slic3r/GUI/StepMeshDialog.cpp b/src/slic3r/GUI/StepMeshDialog.cpp index 6316d10292..07dc559528 100644 --- a/src/slic3r/GUI/StepMeshDialog.cpp +++ b/src/slic3r/GUI/StepMeshDialog.cpp @@ -279,6 +279,8 @@ StepMeshDialog::StepMeshDialog(wxWindow* parent, Slic3r::Step& file, double line mesh_face_number_sizer->Add(mesh_face_number_text, 0, wxALIGN_LEFT); bSizer->Add(mesh_face_number_sizer, 0, wxEXPAND | wxALL, LEFT_RIGHT_PADING); + bSizer->AddSpacer(FromDIP(10)); + wxBoxSizer* save_default_sizer = new wxBoxSizer(wxHORIZONTAL); m_save_default_checkbox = new wxCheckBox(this, wxID_ANY, _L("Save these settings as default"), wxDefaultPosition, wxDefaultSize, 0); m_save_default_checkbox->SetFont(::Label::Body_14); diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 770e14de9f..95ce50a5d6 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -5177,7 +5177,7 @@ void TabPrinter::build_fff() { option = optgroup->get_option("printer_agent"); option.opt.gui_type = ConfigOptionDef::GUIType::printer_agent_select; - option.opt.width = 3 * Field::def_width_wider() / 2; + option.opt.width = Field::def_width_wider(); option.opt.tooltip = L("Select the network agent implementation for printer communication. " "Available agents are registered at startup."); optgroup->append_single_option_line(option); diff --git a/src/slic3r/GUI/UnsavedChangesDialog.cpp b/src/slic3r/GUI/UnsavedChangesDialog.cpp index 9619debd59..dffc86a25c 100644 --- a/src/slic3r/GUI/UnsavedChangesDialog.cpp +++ b/src/slic3r/GUI/UnsavedChangesDialog.cpp @@ -622,6 +622,7 @@ DiffViewCtrl::DiffViewCtrl(wxWindow* parent, wxSize size) ), m_em_unit(em_unit(parent)) { + SetBackgroundColour(wxColour("#FFFFFF")); wxGetApp().UpdateDVCDarkUI(this); model = new DiffModel(parent); @@ -896,7 +897,7 @@ void UnsavedChangesDialog::build(Preset::Type type, PresetCollection *dependent_ m_action_line = new wxStaticText(this, wxID_ANY, wxEmptyString, wxDefaultPosition, UNSAVE_CHANGE_DIALOG_ACTION_LINE_SIZE, 0); m_action_line->SetFont(::Label::Body_13); - m_action_line->SetForegroundColour(GREY900); + m_action_line->SetForegroundColour(wxColour("#363636")); m_action_line->Wrap(-1); m_sizer_main->Add(m_action_line, 0, wxLEFT | wxRIGHT, 20); @@ -909,11 +910,11 @@ void UnsavedChangesDialog::build(Preset::Type type, PresetCollection *dependent_ } m_panel_tab = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(UNSAVE_CHANGE_DIALOG_SCROLL_WINDOW_SIZE.x, -1), wxTAB_TRAVERSAL); - m_panel_tab->SetBackgroundColour(GREY200); + m_panel_tab->SetBackgroundColour(wxColour("#D9D9D9")); wxBoxSizer *m_sizer_tab = new wxBoxSizer(wxVERTICAL); m_table_top = new wxPanel(m_panel_tab, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); - m_table_top->SetBackgroundColour(wxColour(107, 107, 107)); + m_table_top->SetBackgroundColour(wxColour("#D9D9D9")); wxBoxSizer *m_sizer_top = new wxBoxSizer(wxHORIZONTAL); @@ -925,7 +926,7 @@ void UnsavedChangesDialog::build(Preset::Type type, PresetCollection *dependent_ static_temp_title = new wxStaticText(m_panel_temp, wxID_ANY, _L("Settings"), wxDefaultPosition, wxDefaultSize, 0); static_temp_title->SetFont(::Label::Body_13); static_temp_title->Wrap(-1); - static_temp_title->SetForegroundColour(*wxWHITE); + static_temp_title->SetForegroundColour(wxColour("#363636")); top_title_temp_h->Add(static_temp_title, 0, wxALIGN_CENTER | wxBOTTOM | wxTOP, 5); top_title_temp_v->Add(top_title_temp_h, 1, wxALIGN_CENTER, 0); m_panel_temp->SetSizer(top_title_temp_v); @@ -944,7 +945,7 @@ void UnsavedChangesDialog::build(Preset::Type type, PresetCollection *dependent_ static_oldv_title = new wxStaticText(m_panel_oldv, wxID_ANY, params ? _L(DevPrinterConfigUtil::get_toolhead_display_name(ucd_pt, DEPUTY_EXTRUDER_ID, ToolHeadComponent::Nozzle, ToolHeadNameCase::SentenceCase)) + ": " + get_nozzle_volume_type_name(params->nozzle) : _L("Old Value"), wxDefaultPosition, wxDefaultSize, 0); static_oldv_title->SetFont(::Label::Body_13); static_oldv_title->Wrap(-1); - static_oldv_title->SetForegroundColour(params && params->left_to_right ? wxGetApp().get_label_clr_modified() : *wxWHITE); + static_oldv_title->SetForegroundColour(params && params->left_to_right ? wxGetApp().get_label_clr_modified() : wxColour("#363636")); top_title_oldv_h->Add(static_oldv_title, 0, wxALIGN_CENTER | wxBOTTOM | wxTOP, 5); top_title_oldv->Add(top_title_oldv_h, 1, wxALIGN_CENTER, 0); m_panel_oldv->SetSizer(top_title_oldv); @@ -964,7 +965,7 @@ void UnsavedChangesDialog::build(Preset::Type type, PresetCollection *dependent_ wxDefaultPosition, wxDefaultSize, 0); static_newv_title->SetFont(::Label::Body_13); static_newv_title->Wrap(-1); - static_newv_title->SetForegroundColour(params && !params->left_to_right ? wxGetApp().get_label_clr_modified() : *wxWHITE); + static_newv_title->SetForegroundColour(params && !params->left_to_right ? wxGetApp().get_label_clr_modified() : wxColour("#363636")); top_title_newv_h->Add(static_newv_title, 0, wxALIGN_CENTER | wxBOTTOM | wxTOP, 5); @@ -1014,7 +1015,7 @@ void UnsavedChangesDialog::build(Preset::Type type, PresetCollection *dependent_ checkbox_sizer->Show(bool(m_buttons & REMEMBER_CHOISE)); if (dependent_presets != nullptr) { - auto wiki = new HyperLink(this, _L("Help"), "https://www.orcaslicer.com/wiki/transfer_discard_changes"); + auto wiki = new HyperLink(this, _L("Wiki Guide"), "https://www.orcaslicer.com/wiki/transfer_discard_changes"); m_sizer_button->Add(wiki, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, FromDIP(22)); } diff --git a/src/slic3r/GUI/Widgets/Button.cpp b/src/slic3r/GUI/Widgets/Button.cpp index 1a5816d1da..5ecbafda2b 100644 --- a/src/slic3r/GUI/Widgets/Button.cpp +++ b/src/slic3r/GUI/Widgets/Button.cpp @@ -315,7 +315,7 @@ void Button::render(wxDC& dc) auto szContent = textSize; // Whether the measured content reserved the text/icon gap. macOS measures an empty label // as 0-high, so the gap is skipped there; the dot must not advance past it in that case. - const bool gap_reserved = szContent.y > 0; + const bool gap_reserved = !text.IsEmpty(); // ORCA check empty string instead text size. fixes icon centering on linux if (icon.bmp().IsOk()) { if (gap_reserved) { // BBS norrow size between text and icon @@ -409,10 +409,11 @@ void Button::messureSize() if (this->active_icon.bmp().IsOk()) { if (szContent.y > 0) { // BBS narrow size between text and icon + int spacing_after_icon = !GetLabel().IsEmpty() ? 0 : m_icon_spacing; // ORCA check empty string instead text size. fixes icon centering on linux if (vertical) - szContent.y += m_icon_spacing; + szContent.y += spacing_after_icon; else - szContent.x += m_icon_spacing; + szContent.x += spacing_after_icon; } wxSize szIcon = this->active_icon.GetBmpSize(); if (vertical) { diff --git a/src/slic3r/GUI/Widgets/ProgressDialog.cpp b/src/slic3r/GUI/Widgets/ProgressDialog.cpp index 82d2efa0eb..3e34a0dd05 100644 --- a/src/slic3r/GUI/Widgets/ProgressDialog.cpp +++ b/src/slic3r/GUI/Widgets/ProgressDialog.cpp @@ -32,6 +32,11 @@ #include "wx/evtloop.h" #include "Label.hpp" +#ifdef __WXGTK__ +#include "slic3r/GUI/Widgets/StateColor.hpp" +#include "slic3r/GUI/GUI_Utils.hpp" +#endif + // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- @@ -237,10 +242,19 @@ bool ProgressDialog::Create(const wxString &title, const wxString &message, int if (!HasPDFlag(wxPD_NO_PROGRESS)) { m_gauge = new wxGauge(this, wxID_ANY, maximum, wxDefaultPosition, PROGRESSDIALOG_GAUGE_SIZE, gauge_style); +#ifdef __WXGTK__ + SetGaugeColor(m_gauge, + StateColor::darkModeColorFor(wxColour("#009688")).GetAsString(), + StateColor::darkModeColorFor(wxColour("#D9D9D9")).GetAsString() + ); + m_gauge->SetValue(0); +#else + m_gauge->Pulse(); // colors not applied without this. probably it switches to a dc painted version of progressbar m_gauge->SetValue(0); m_gauge->SetForegroundColour(wxColour("#009688")); m_gauge->SetBackgroundColour(wxColour("#D9D9D9")); wxGetApp().UpdateDarkUI(m_gauge); +#endif m_sizer_main->Add(m_gauge, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(28)); } @@ -837,7 +851,7 @@ ProgressDialog::~ProgressDialog() void ProgressDialog::DoSetSize(int x, int y, int width, int height, int sizeFlags /*= wxSIZE_AUTO*/) { - if (m_button_cancel != nullptr) { m_button_cancel->SetMinSize(PROGRESSDIALOG_CANCEL_BUTTON_SIZE); } + //if (m_button_cancel != nullptr) { m_button_cancel->SetMinSize(PROGRESSDIALOG_CANCEL_BUTTON_SIZE); } #ifdef __WXMSW__ //if (m_block_left != nullptr && m_block_right != nullptr) { diff --git a/src/slic3r/GUI/Widgets/ProgressDialog.hpp b/src/slic3r/GUI/Widgets/ProgressDialog.hpp index e151428b84..93bc5e07f2 100644 --- a/src/slic3r/GUI/Widgets/ProgressDialog.hpp +++ b/src/slic3r/GUI/Widgets/ProgressDialog.hpp @@ -30,7 +30,7 @@ class WXDLLIMPEXP_FWD_CORE wxStaticText; class WXDLLIMPEXP_FWD_CORE wxWindowDisabler; #define PROGRESSDIALOG_SIMPLEBOOK_SIZE wxSize(FromDIP(320),FromDIP(38)) -#define PROGRESSDIALOG_GAUGE_SIZE wxSize(FromDIP(320), FromDIP(6)) +#define PROGRESSDIALOG_GAUGE_SIZE wxSize(FromDIP(320), FromDIP(8)) #define PROGRESSDIALOG_CANCEL_BUTTON_SIZE wxSize(FromDIP(60), FromDIP(24)) #define PROGRESSDIALOG_DEF_BK wxColour(255,255,255) #define PROGRESSDIALOG_GREY_700 wxColour(54,54,54) // #363636 label color diff --git a/src/slic3r/GUI/Widgets/StateColor.cpp b/src/slic3r/GUI/Widgets/StateColor.cpp index 8d9cded8a6..e21d052c30 100644 --- a/src/slic3r/GUI/Widgets/StateColor.cpp +++ b/src/slic3r/GUI/Widgets/StateColor.cpp @@ -48,7 +48,7 @@ static std::map gDarkColors{ {"#2B3436", "#808080"}, // rgb(43, 52, 54) Not Used anymore // Leftover from BBS. Was used as main fill color of icons {"#ABABAB", "#ABABAB"}, {"#D9D9D9", "#27272A"}, // rgb(217, 217, 217) Sidebar > Toggle button track color - {"#FFFEFE", "#D9D9D9"}, // rgb(255, 254, 254) Sidebar > Toggle button thumb color + {"#FFFEFE", "#D8D9D9"}, // rgb(255, 254, 254) Sidebar > Toggle button thumb color {"#EBF9F0", "#293F34"}, //{"#F0F0F0", "#4C4C54"}, // ORCA diff --git a/src/slic3r/GUI/Widgets/SwitchButton.cpp b/src/slic3r/GUI/Widgets/SwitchButton.cpp index 6ac9d2210f..2b4cf00b58 100644 --- a/src/slic3r/GUI/Widgets/SwitchButton.cpp +++ b/src/slic3r/GUI/Widgets/SwitchButton.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include "slic3r/GUI/Widgets/StateHandler.hpp" #include @@ -158,17 +159,16 @@ void SwitchButton::Rescale() } for (int i = 0; i < 2; ++i) { wxMemoryDC memdc(&dc); -#ifdef __WXMSW__ - wxBitmap bmp(trackSize.x, trackSize.y); - memdc.SelectObject(bmp); - memdc.SetBackground(wxBrush(GetBackgroundColour())); - memdc.Clear(); -#else wxImage image(trackSize); +#ifndef __WXMSW__ // DrawText doesn't work properly on Windows with Alpha channel image.InitAlpha(); memset(image.GetAlpha(), 0, trackSize.GetWidth() * trackSize.GetHeight()); +#endif wxBitmap bmp(std::move(image)); memdc.SelectObject(bmp); +#ifdef __WXMSW__ + memdc.SetBackground(wxBrush(GetBackgroundColour())); + memdc.Clear(); #endif memdc.SetFont(dc.GetFont()); #ifdef __WXMSW__ @@ -276,6 +276,7 @@ ModeSwitchButton::ModeSwitchButton(wxWindow* parent, wxWindowID id) StaticBox::Create(parent, id, wxDefaultPosition, wxDefaultSize, 0); SetBackgroundColour(StaticBox::GetParentBackgroundColor(parent)); SetCursor(wxCursor(wxCURSOR_HAND)); + SetFont(Label::Body_12); m_tooltips[0] = _L("Simple settings"); m_tooltips[1] = _L("Advanced settings"); @@ -374,6 +375,14 @@ void ModeSwitchButton::doRender(wxDC& dc) } } else { // Developer mode + double scale = 1.00; +#ifdef __WXOSX__ + scale = Slic3r::GUI::mac_max_scaling_factor(); + dc.SetFont(dc.GetFont().Scaled(scale)); +#elif defined(__WXMSW__) + scale = m_parent->GetDPIScaleFactor(); + dc.SetFont(dc.GetFont().Scaled(scale)); +#endif wxString str = "DEV"; int kerning = 3; // pixels between chars dc.SetTextForeground(text_color.colorForStates(states)); @@ -383,8 +392,17 @@ void ModeSwitchButton::doRender(wxDC& dc) totalWidth += dc.GetTextExtent(wxString(c)).x + kerning; totalWidth -= kerning; - wxCoord x = bounds.x + (bounds.width - totalWidth) / 2; - wxCoord y = bounds.y + (bounds.height - dc.GetTextExtent(str).y) / 2 - 1; + wxCoord x = bounds.x + (bounds.width - totalWidth) * 0.50; + + wxFontMetrics fm = dc.GetFontMetrics(); + int lineHeight = fm.ascent + fm.descent + fm.internalLeading; + + double y_offset = scale; +#if defined(__WXGTK__) + y_offset = 0; +#endif + + wxCoord y = std::floor(v_center - lineHeight * 0.50 - y_offset); for (char c : str) { wxString ch(c);