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

@@ -3611,25 +3611,10 @@ void TabFilament::build()
optgroup->append_single_option_line("filament_stamping_loading_speed");
optgroup->append_single_option_line("filament_stamping_distance");
create_line_with_widget(optgroup.get(), "filament_ramming_parameters", "", [this](wxWindow* parent) {
// ORCA modernize button style
Button* btn = new Button(parent, _(L("Set")) + " " + dots);
btn->SetFont(Label::Body_14);
btn->SetSize(wxSize(FromDIP(120), FromDIP(26)));
btn->SetCornerRadius(FromDIP(4));
StateColor clr_bg = StateColor(
std::pair(wxColour("#DFDFDF"), (int)StateColor::Disabled),
std::pair(wxColour("#DFDFDF"), (int)StateColor::Pressed),
std::pair(wxColour("#D4D4D4"), (int)StateColor::Hovered),
std::pair(wxColour("#DFDFDF"), (int)StateColor::Normal),
std::pair(wxColour("#DFDFDF"), (int)StateColor::Enabled)
);
btn->SetBackgroundColor(clr_bg);
btn->SetBorderColor(clr_bg);
btn->SetTextColor(StateColor(
std::pair(wxColour("#6B6A6A"), (int)StateColor::Disabled),
std::pair(wxColour("#262E30"), (int)StateColor::Hovered),
std::pair(wxColour("#262E30"), (int)StateColor::Normal)
));
btn->SetStyle(ButtonStyle::Regular, ButtonType::Parameter);
auto sizer = new wxBoxSizer(wxHORIZONTAL);
sizer->Add(btn);
@@ -6011,23 +5996,7 @@ wxSizer* Tab::compatible_widget_create(wxWindow* parent, PresetDependencies &dep
// ORCA modernize button style
Button* btn = new Button(parent, _(L("Set")) + " " + dots);
btn->SetFont(Label::Body_14);
btn->SetSize(wxSize(FromDIP(120), FromDIP(26)));
btn->SetCornerRadius(FromDIP(4));
StateColor clr_bg = StateColor(
std::pair(wxColour("#DFDFDF"), (int)StateColor::Disabled),
std::pair(wxColour("#DFDFDF"), (int)StateColor::Pressed),
std::pair(wxColour("#D4D4D4"), (int)StateColor::Hovered),
std::pair(wxColour("#DFDFDF"), (int)StateColor::Normal),
std::pair(wxColour("#DFDFDF"), (int)StateColor::Enabled)
);
btn->SetBackgroundColor(clr_bg);
btn->SetBorderColor(clr_bg);
btn->SetTextColor(StateColor(
std::pair(wxColour("#6B6A6A"), (int)StateColor::Disabled),
std::pair(wxColour("#262E30"), (int)StateColor::Hovered),
std::pair(wxColour("#262E30"), (int)StateColor::Normal)
));
btn->SetStyle(ButtonStyle::Regular, ButtonType::Parameter);
deps.btn = btn;
auto sizer = new wxBoxSizer(wxHORIZONTAL);
@@ -6138,25 +6107,9 @@ wxSizer* Tab::compatible_widget_create(wxWindow* parent, PresetDependencies &dep
// Return a callback to create a TabPrinter widget to edit bed shape
wxSizer* TabPrinter::create_bed_shape_widget(wxWindow* parent)
{
// ORCA modernize button style
// ORCA modernize button style
Button* btn = new Button(parent, _(L("Set")) + " " + dots);
btn->SetFont(Label::Body_14);
btn->SetSize(wxSize(FromDIP(120), FromDIP(26)));
btn->SetCornerRadius(FromDIP(4));
StateColor clr_bg = StateColor(
std::pair(wxColour("#DFDFDF"), (int)StateColor::Disabled),
std::pair(wxColour("#DFDFDF"), (int)StateColor::Pressed),
std::pair(wxColour("#D4D4D4"), (int)StateColor::Hovered),
std::pair(wxColour("#DFDFDF"), (int)StateColor::Normal),
std::pair(wxColour("#DFDFDF"), (int)StateColor::Enabled)
);
btn->SetBackgroundColor(clr_bg);
btn->SetBorderColor(clr_bg);
btn->SetTextColor(StateColor(
std::pair(wxColour("#6B6A6A"), (int)StateColor::Disabled),
std::pair(wxColour("#262E30"), (int)StateColor::Hovered),
std::pair(wxColour("#262E30"), (int)StateColor::Normal)
));
btn->SetStyle(ButtonStyle::Regular, ButtonType::Parameter);
auto sizer = new wxBoxSizer(wxHORIZONTAL);
sizer->Add(btn, 0, wxALIGN_CENTER_VERTICAL);