UI Fixes / Improvements (#15074)

* plates-toolbar-scrollbar-size

* update

* filament grouping dialog

* mixed filament list

* Update StepMeshDialog.cpp

* moves plot scrollbar

* fix position of popups

* printer agent combo box width

* match multiline text control background

* add dots to configure button

* also correct label color for multiline input

* side tools connecting text color

* recenter dialog text color

* preferences experimental features

* upgrade panel hyperlink color + right margin

* fix position of + sign on printer selector

* speed control popup

* bbl fan control window

* AMS materials setting

* monitor > ams section

* match background color of multiline text editor on project page

* Fix SwitchButton colors

* bbl camera popup

* BBL > Send print dialog

* Revert "BBL > Send print dialog"

This reverts commit 128e145897.

* Revert "bbl fan control window"

This reverts commit 4a0db62790.

* Revert "bbl camera popup"

This reverts commit e2301e3237.

* Revert "monitor > ams section"

This reverts commit 66e6894eb1.

* Revert "fix position of + sign on printer selector"

This reverts commit 1523ba24c0.

* Revert "upgrade panel hyperlink color + right margin"

This reverts commit 541f2514c5.

* Revert "side tools connecting text color"

This reverts commit a9ab074247.

* Revert "recenter dialog text color"

This reverts commit f4670d32b2.

* Revert "AMS materials setting"

This reverts commit b12827f9b5.

* Revert "Fix SwitchButton colors"

This reverts commit 2d4f1d1fe9.

* match object list background color

* match compare dialog wxDataViewCtrl background color

* fix centering of iconized buttons on linux

* fix compare dialog background color not applied on linux

* edit gcode dialog components background color

* Update Plater.cpp

* fix dev button font size

* Fix scaling issue on SwitchButton while using 150%

* transfer or discard changes dialog wiki label

* "Transfer or Discard changes" / "Unsaved Changes" dialog header color

* object table colors & header spacing

* progress dialog

* fix progressbar look on linux

* fix build

* fix build

* fix centering of iconized icon again

* fix header background color

* revert bbl fan control

* add includes

---------

Co-authored-by: Noisyfox <timemanager.rick@gmail.com>
This commit is contained in:
yw4z
2026-10-05 19:06:24 +03:00
committed by GitHub
co-authored by Noisyfox
parent 6b8df05d40
commit 1496906939
32 changed files with 190 additions and 105 deletions
+26 -8
View File
@@ -14,6 +14,7 @@
#include <wx/image.h>
#include <cstring>
#include <wx/dc.h>
#include <cmath>
#include <vector>
#include "slic3r/GUI/Widgets/StateHandler.hpp"
#include <wx/scrolwin.h>
@@ -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);