mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 18:12:10 +00:00
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:
@@ -136,25 +136,8 @@ void PhysicalPrinterDialog::build_printhost_settings(ConfigOptionsGroup* m_optgr
|
||||
m_optgroup->append_single_option_line("host_type");
|
||||
|
||||
auto create_sizer_with_btn = [](wxWindow* parent, Button** btn, const std::string& icon_name, const wxString& label) {
|
||||
*btn = new Button(parent, label, ""/*icon_name*/, 0, parent->FromDIP(16));
|
||||
(*btn)->SetFont(Label::Body_14);
|
||||
(*btn)->SetMinSize(wxSize(parent->FromDIP(120), parent->FromDIP(26)));
|
||||
(*btn)->SetSize(wxSize(parent->FromDIP(120), parent->FromDIP(26)));
|
||||
(*btn)->SetCornerRadius(parent->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 = new Button(parent, label);
|
||||
(*btn)->SetStyle(ButtonStyle::Regular, ButtonType::Parameter);
|
||||
|
||||
auto sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
sizer->Add(*btn);
|
||||
@@ -253,6 +236,7 @@ void PhysicalPrinterDialog::build_printhost_settings(ConfigOptionsGroup* m_optgr
|
||||
//add_scaled_button(parent, &m_printhost_port_browse_btn, "browse", _(L("Refresh Printers")), wxBU_LEFT | wxBU_EXACTFIT);
|
||||
auto sizer = create_sizer_with_btn(parent, &m_printhost_port_browse_btn, "monitor_signal_strong", _L("Refresh") + " " + dots);
|
||||
Button* btn = m_printhost_port_browse_btn;
|
||||
btn->SetStyle(ButtonStyle::Regular, ButtonType::Parameter);
|
||||
btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent e) { update_printers(); });
|
||||
return sizer;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user