Styling management for buttons and matching all button styles (#8184)

* Add button styling

* Fix dark mode compability

* printable area button

* Connection dialog icons

* Add aligment control

* Fix alignment

* add new styles

* Update BedShapeDialog.cpp

* Use darker text color on dark mode

* update code

* Update

* update

* Update

* Update WipeTowerDialog.cpp

* update

* Update Button.cpp

* update

* Update Button.cpp

* add enums for style and type

* update

* Update Button.cpp

* fix

* update

* Update DialogButtons.cpp

* Update UnsavedChangesDialog.cpp

* update

* update

* update

* Update Button.cpp

* cleanup

---------

Co-authored-by: Noisyfox <timemanager.rick@gmail.com>
This commit is contained in:
yw4z
2025-07-17 15:44:45 +03:00
committed by GitHub
parent 37d8bec3e1
commit e9e069c167
17 changed files with 199 additions and 583 deletions

View File

@@ -860,19 +860,7 @@ wxBoxSizer* PreferencesDialog::create_item_button(
m_staticTextPath->SetToolTip(tooltip);
auto m_button_download = new Button(parent, title2);
StateColor abort_bg(std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Disabled), std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered), std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Enabled),
std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Normal));
m_button_download->SetBackgroundColor(abort_bg);
StateColor abort_bd(std::pair<wxColour, int>(wxColour(144, 144, 144), StateColor::Disabled), std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
m_button_download->SetBorderColor(abort_bd);
StateColor abort_text(std::pair<wxColour, int>(wxColour(144, 144, 144), StateColor::Disabled), std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
m_button_download->SetTextColor(abort_text);
m_button_download->SetFont(Label::Body_10);
m_button_download->SetMinSize(wxSize(FromDIP(58), FromDIP(22)));
m_button_download->SetSize(wxSize(FromDIP(58), FromDIP(22)));
m_button_download->SetCornerRadius(FromDIP(12));
m_button_download->SetStyle(ButtonStyle::Regular, ButtonType::Window);
m_button_download->SetToolTip(tooltip2);
m_button_download->Bind(wxEVT_BUTTON, [this, onclick](auto &e) { onclick(); });
@@ -903,19 +891,7 @@ wxWindow* PreferencesDialog::create_item_downloads(wxWindow* parent, int padding
m_staticTextPath->Wrap(-1);
auto m_button_download = new Button(item_panel, _L("Browse"));
StateColor abort_bg(std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Disabled), std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered), std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Enabled),
std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Normal));
m_button_download->SetBackgroundColor(abort_bg);
StateColor abort_bd(std::pair<wxColour, int>(wxColour(144, 144, 144), StateColor::Disabled), std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
m_button_download->SetBorderColor(abort_bd);
StateColor abort_text(std::pair<wxColour, int>(wxColour(144, 144, 144), StateColor::Disabled), std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
m_button_download->SetTextColor(abort_text);
m_button_download->SetFont(Label::Body_10);
m_button_download->SetMinSize(wxSize(FromDIP(58), FromDIP(22)));
m_button_download->SetSize(wxSize(FromDIP(58), FromDIP(22)));
m_button_download->SetCornerRadius(FromDIP(12));
m_button_download->SetStyle(ButtonStyle::Regular, ButtonType::Window);
m_button_download->Bind(wxEVT_BUTTON, [this, m_staticTextPath, item_panel](auto& e) {
wxString defaultPath = wxT("/");
@@ -1491,10 +1467,7 @@ wxWindow* PreferencesDialog::create_debug_page()
StateColor btn_bd_white(std::pair<wxColour, int>(AMS_CONTROL_WHITE_COLOUR, StateColor::Disabled), std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
Button* debug_button = new Button(page, _L("debug save button"));
debug_button->SetBackgroundColor(btn_bg_white);
debug_button->SetBorderColor(btn_bd_white);
debug_button->SetFont(Label::Body_13);
debug_button->SetStyle(ButtonStyle::Regular, ButtonType::Window);
debug_button->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {
// success message box