mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-07 15:07:31 -06:00
Modernize wxButtons on Parameters & Physical Printer window (#9459)
* update * Update Tab.hpp
This commit is contained in:
parent
2a6c15d15a
commit
07634d2ba2
5 changed files with 101 additions and 34 deletions
|
@ -3545,14 +3545,30 @@ 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) {
|
||||
auto ramming_dialog_btn = new wxButton(parent, wxID_ANY, _(L("Ramming settings"))+dots, wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
|
||||
wxGetApp().UpdateDarkUI(ramming_dialog_btn);
|
||||
ramming_dialog_btn->SetFont(Slic3r::GUI::wxGetApp().normal_font());
|
||||
ramming_dialog_btn->SetSize(ramming_dialog_btn->GetBestSize());
|
||||
auto sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
sizer->Add(ramming_dialog_btn);
|
||||
// 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)
|
||||
));
|
||||
|
||||
ramming_dialog_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent& e) {
|
||||
auto sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
sizer->Add(btn);
|
||||
|
||||
btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent& e) {
|
||||
RammingDialog dlg(this,(m_config->option<ConfigOptionStrings>("filament_ramming_parameters"))->get_at(0));
|
||||
if (dlg.ShowModal() == wxID_OK) {
|
||||
load_key_value("filament_ramming_parameters", dlg.get_parameters());
|
||||
|
@ -5907,10 +5923,27 @@ wxSizer* Tab::compatible_widget_create(wxWindow* parent, PresetDependencies &dep
|
|||
deps.checkbox = new wxCheckBox(parent, wxID_ANY, _(L("All")));
|
||||
deps.checkbox->SetFont(Slic3r::GUI::wxGetApp().normal_font());
|
||||
wxGetApp().UpdateDarkUI(deps.checkbox, false, true);
|
||||
deps.btn = new ScalableButton(parent, wxID_ANY, "printer", from_u8((boost::format(" %s %s") % _utf8(L("Set")) % std::string(dots.ToUTF8())).str()),
|
||||
wxDefaultSize, wxDefaultPosition, wxBU_LEFT | wxBU_EXACTFIT, true);
|
||||
deps.btn->SetFont(Slic3r::GUI::wxGetApp().normal_font());
|
||||
deps.btn->SetSize(deps.btn->GetBestSize());
|
||||
|
||||
// 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)
|
||||
));
|
||||
deps.btn = btn;
|
||||
|
||||
auto sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
sizer->Add((deps.checkbox), 0, wxALIGN_CENTER_VERTICAL);
|
||||
|
@ -5994,10 +6027,25 @@ 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)
|
||||
{
|
||||
ScalableButton* btn = new ScalableButton(parent, wxID_ANY, "printer", " " + _(L("Set")) + " " + dots,
|
||||
wxDefaultSize, wxDefaultPosition, wxBU_LEFT | wxBU_EXACTFIT, true);
|
||||
btn->SetFont(wxGetApp().normal_font());
|
||||
btn->SetSize(btn->GetBestSize());
|
||||
// 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)
|
||||
));
|
||||
|
||||
auto sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
sizer->Add(btn, 0, wxALIGN_CENTER_VERTICAL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue