mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-11 02:57:39 +00:00
Parameter box improvements (#5119)
* Parameter improvements • Added "Layers" side text for Bottom shell layers Number of slow layers Top shell layers • Added "Layer" side text for Full fan speed at layer • Added "x" side text for ratios. This one looks nice imo Internal bridge flow ratio Bridge flow ratio Top surface flow ratio Bottom surface flow ratio Flow ratio Scarf joint flow ratio • Added "mm" side text for Mesh margin Minimum wall length • Added "°C" side text for Softening temperature • Converted these to spin boxes. Currently it combines combo box and input box and it has weird usage. Using spin boxes better because other layer related input boxes uses this too Top interface layers Bottom interface layers * Fix for combo boxes without arrows * Add icon files for Point input boxes * Add side text for Point controls * Update width of point controls * Use TextInput for PointCtrl * Use TextInput for PointCtrl * Update style of Point Control * Better Background color for Disabled elements on dark mode * Use same color for disabled text on combo boxes * Use Slightly darker text color for disabled text elements * Revert changes for Top / Bottom interface layers parameter boxes * fix build error * update point control icons * Remove "x" side text from flow ratio related parameters * revert color related fixes --------- Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
@@ -45,6 +45,7 @@ void BedShape::append_option_line(ConfigOptionsGroupShp optgroup, Parameter para
|
||||
def.set_default_value(new ConfigOptionPoints{ Vec2d(200, 200) });
|
||||
def.min = 0;
|
||||
def.max = 214700;
|
||||
def.width = 7;
|
||||
def.label = get_option_label(param);
|
||||
def.tooltip = L("Size in X and Y of the rectangular plate.");
|
||||
key = "rect_size";
|
||||
@@ -54,6 +55,7 @@ void BedShape::append_option_line(ConfigOptionsGroupShp optgroup, Parameter para
|
||||
def.set_default_value(new ConfigOptionPoints{ Vec2d(0, 0) });
|
||||
def.min = -107350;
|
||||
def.max = 107350;
|
||||
def.width = 7;
|
||||
def.label = get_option_label(param);
|
||||
def.tooltip = L("Distance of the 0,0 G-code coordinate from the front left corner of the rectangle.");
|
||||
key = "rect_origin";
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#define FILAMENT_LIST_SIZE wxSize(FromDIP(560), FromDIP(100))
|
||||
#define FILAMENT_OPTION_SIZE wxSize(FromDIP(-1), FromDIP(30))
|
||||
#define PRESET_TEMPLATE_SIZE wxSize(FromDIP(-1), FromDIP(100))
|
||||
#define PRINTER_SPACE_SIZE wxSize(FromDIP(80), FromDIP(24))
|
||||
#define PRINTER_SPACE_SIZE wxSize(FromDIP(100), FromDIP(24)) // ORCA Match size with other components
|
||||
#define ORIGIN_TEXT_SIZE wxSize(FromDIP(10), FromDIP(24))
|
||||
#define PRINTER_PRESET_VENDOR_SIZE wxSize(FromDIP(150), FromDIP(24))
|
||||
#define PRINTER_PRESET_MODEL_SIZE wxSize(FromDIP(280), FromDIP(24))
|
||||
@@ -1793,26 +1793,20 @@ wxBoxSizer *CreatePrinterPresetDialog::create_bed_size_item(wxWindow *parent)
|
||||
horizontal_sizer->Add(optionSizer, 0, wxEXPAND | wxALL | wxALIGN_CENTER_VERTICAL, FromDIP(10));
|
||||
|
||||
wxBoxSizer * length_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
wxStaticText *static_length_text = new wxStaticText(parent, wxID_ANY, _L("X"), wxDefaultPosition, wxDefaultSize);
|
||||
static_length_text->SetMinSize(ORIGIN_TEXT_SIZE);
|
||||
static_length_text->SetSize(ORIGIN_TEXT_SIZE);
|
||||
length_sizer->Add(static_length_text, 0, wxEXPAND | wxALL, 0);
|
||||
// ORCA use icon on input box to match style with other Point fields
|
||||
horizontal_sizer->Add(length_sizer, 0, wxEXPAND | wxLEFT | wxTOP | wxALIGN_CENTER_VERTICAL, FromDIP(10));
|
||||
wxBoxSizer *length_input_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
m_bed_size_x_input = new TextInput(parent, "200", "mm", wxEmptyString, wxDefaultPosition, PRINTER_SPACE_SIZE, wxTE_CENTRE | wxTE_PROCESS_ENTER);
|
||||
m_bed_size_x_input = new TextInput(parent, "200", "mm", "inputbox_x", wxDefaultPosition, PRINTER_SPACE_SIZE, wxTE_PROCESS_ENTER);
|
||||
wxTextValidator validator(wxFILTER_DIGITS);
|
||||
m_bed_size_x_input->GetTextCtrl()->SetValidator(validator);
|
||||
length_input_sizer->Add(m_bed_size_x_input, 0, wxEXPAND | wxALL, 0);
|
||||
length_input_sizer->Add(m_bed_size_x_input, 0, wxEXPAND | wxLEFT, FromDIP(5));
|
||||
horizontal_sizer->Add(length_input_sizer, 0, wxEXPAND | wxALL | wxALIGN_CENTER_VERTICAL, FromDIP(5));
|
||||
|
||||
wxBoxSizer * width_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
wxStaticText *static_width_text = new wxStaticText(parent, wxID_ANY, _L("Y"), wxDefaultPosition, wxDefaultSize);
|
||||
static_width_text->SetMinSize(ORIGIN_TEXT_SIZE);
|
||||
static_width_text->SetSize(ORIGIN_TEXT_SIZE);
|
||||
width_sizer->Add(static_width_text, 0, wxEXPAND | wxALL, 0);
|
||||
// ORCA use icon on input box to match style with other Point fields
|
||||
horizontal_sizer->Add(width_sizer, 0, wxEXPAND | wxLEFT | wxTOP | wxALIGN_CENTER_VERTICAL, FromDIP(10));
|
||||
wxBoxSizer *width_input_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
m_bed_size_y_input = new TextInput(parent, "200", "mm", wxEmptyString, wxDefaultPosition, PRINTER_SPACE_SIZE, wxTE_CENTRE | wxTE_PROCESS_ENTER);
|
||||
m_bed_size_y_input = new TextInput(parent, "200", "mm", "inputbox_y", wxDefaultPosition, PRINTER_SPACE_SIZE, wxTE_PROCESS_ENTER);
|
||||
m_bed_size_y_input->GetTextCtrl()->SetValidator(validator);
|
||||
width_input_sizer->Add(m_bed_size_y_input, 0, wxEXPAND | wxALL, 0);
|
||||
horizontal_sizer->Add(width_input_sizer, 0, wxEXPAND | wxALL | wxALIGN_CENTER_VERTICAL, FromDIP(5));
|
||||
@@ -1832,26 +1826,20 @@ wxBoxSizer *CreatePrinterPresetDialog::create_origin_item(wxWindow *parent)
|
||||
horizontal_sizer->Add(optionSizer, 0, wxEXPAND | wxALL | wxALIGN_CENTER_VERTICAL, FromDIP(10));
|
||||
|
||||
wxBoxSizer * length_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
wxStaticText *static_origin_x_text = new wxStaticText(parent, wxID_ANY, _L("X"), wxDefaultPosition, wxDefaultSize);
|
||||
static_origin_x_text->SetMinSize(ORIGIN_TEXT_SIZE);
|
||||
static_origin_x_text->SetSize(ORIGIN_TEXT_SIZE);
|
||||
length_sizer->Add(static_origin_x_text, 0, wxEXPAND | wxALL, 0);
|
||||
// ORCA use icon on input box to match style with other Point fields
|
||||
horizontal_sizer->Add(length_sizer, 0, wxEXPAND | wxLEFT | wxTOP | wxALIGN_CENTER_VERTICAL, FromDIP(10));
|
||||
wxBoxSizer *length_input_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
m_bed_origin_x_input = new TextInput(parent, "0", "mm", wxEmptyString, wxDefaultPosition, PRINTER_SPACE_SIZE, wxTE_CENTRE | wxTE_PROCESS_ENTER);
|
||||
m_bed_origin_x_input = new TextInput(parent, "0", "mm", "inputbox_x", wxDefaultPosition, PRINTER_SPACE_SIZE, wxTE_PROCESS_ENTER);
|
||||
wxTextValidator validator(wxFILTER_DIGITS);
|
||||
m_bed_origin_x_input->GetTextCtrl()->SetValidator(validator);
|
||||
length_input_sizer->Add(m_bed_origin_x_input, 0, wxEXPAND | wxALL, 0);
|
||||
length_input_sizer->Add(m_bed_origin_x_input, 0, wxEXPAND | wxLEFT, FromDIP(5)); // Align with other
|
||||
horizontal_sizer->Add(length_input_sizer, 0, wxEXPAND | wxALL | wxALIGN_CENTER_VERTICAL, FromDIP(5));
|
||||
|
||||
wxBoxSizer * width_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
wxStaticText *static_origin_y_text = new wxStaticText(parent, wxID_ANY, _L("Y"), wxDefaultPosition, wxDefaultSize);
|
||||
static_origin_y_text->SetMinSize(ORIGIN_TEXT_SIZE);
|
||||
static_origin_y_text->SetSize(ORIGIN_TEXT_SIZE);
|
||||
width_sizer->Add(static_origin_y_text, 0, wxEXPAND | wxALL, 0);
|
||||
// ORCA use icon on input box to match style with other Point fields
|
||||
horizontal_sizer->Add(width_sizer, 0, wxEXPAND | wxLEFT | wxTOP | wxALIGN_CENTER_VERTICAL, FromDIP(10));
|
||||
wxBoxSizer *width_input_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
m_bed_origin_y_input = new TextInput(parent, "0", "mm", wxEmptyString, wxDefaultPosition, PRINTER_SPACE_SIZE, wxTE_CENTRE | wxTE_PROCESS_ENTER);
|
||||
m_bed_origin_y_input = new TextInput(parent, "0", "mm", "inputbox_y", wxDefaultPosition, PRINTER_SPACE_SIZE, wxTE_PROCESS_ENTER);
|
||||
m_bed_origin_y_input->GetTextCtrl()->SetValidator(validator);
|
||||
width_input_sizer->Add(m_bed_origin_y_input, 0, wxEXPAND | wxALL, 0);
|
||||
horizontal_sizer->Add(width_input_sizer, 0, wxEXPAND | wxALL | wxALIGN_CENTER_VERTICAL, FromDIP(5));
|
||||
@@ -1944,7 +1932,7 @@ wxBoxSizer *CreatePrinterPresetDialog::create_max_print_height_item(wxWindow *pa
|
||||
horizontal_sizer->Add(optionSizer, 0, wxEXPAND | wxALL | wxALIGN_CENTER_VERTICAL, FromDIP(10));
|
||||
|
||||
wxBoxSizer *hight_input_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
m_print_height_input = new TextInput(parent, "200", "mm", wxEmptyString, wxDefaultPosition, PRINTER_SPACE_SIZE, wxTE_CENTRE | wxTE_PROCESS_ENTER);
|
||||
m_print_height_input = new TextInput(parent, "200", "mm", wxEmptyString, wxDefaultPosition, PRINTER_SPACE_SIZE, wxTE_PROCESS_ENTER); // Use same alignment with all other input boxes
|
||||
wxTextValidator validator(wxFILTER_DIGITS);
|
||||
m_print_height_input->GetTextCtrl()->SetValidator(validator);
|
||||
hight_input_sizer->Add(m_print_height_input, 0, wxEXPAND | wxLEFT, FromDIP(5));
|
||||
|
||||
@@ -1737,8 +1737,10 @@ void ColourPicker::save_colors_to_config() {
|
||||
void PointCtrl::BUILD()
|
||||
{
|
||||
auto temp = new wxBoxSizer(wxHORIZONTAL);
|
||||
m_combine_side_text = true; // Prefer using side text in input box
|
||||
|
||||
const wxSize field_size(4 * m_em_unit, -1);
|
||||
//const wxSize field_size(4 * m_em_unit, -1);
|
||||
const wxSize field_size((m_opt.width >= 0 ? m_opt.width : def_width_wider()) * m_em_unit, -1); // ORCA match width with other components
|
||||
Slic3r::Vec2d default_pt;
|
||||
if(m_opt.type == coPoints)
|
||||
default_pt = m_opt.get_default_value<ConfigOptionPoints>()->values.at(0);
|
||||
@@ -1750,35 +1752,38 @@ void PointCtrl::BUILD()
|
||||
wxString Y = val - int(val) == 0 ? wxString::Format(_T("%i"), int(val)) : wxNumberFormatter::ToString(val, 2, wxNumberFormatter::Style_None);
|
||||
|
||||
long style = wxTE_PROCESS_ENTER;
|
||||
#ifdef _WIN32
|
||||
style |= wxBORDER_SIMPLE;
|
||||
#endif
|
||||
x_textctrl = new ::TextCtrl(m_parent, wxID_ANY, X, wxDefaultPosition, field_size, style);
|
||||
y_textctrl = new ::TextCtrl(m_parent, wxID_ANY, Y, wxDefaultPosition, field_size, style);
|
||||
//#ifdef _WIN32
|
||||
// style |= wxBORDER_SIMPLE;
|
||||
//#endif
|
||||
// ORCA add icons to point control boxes instead of using text for X / Y
|
||||
x_input = new ::TextInput(m_parent, X, m_opt.sidetext, "inputbox_x", wxDefaultPosition, field_size, style);
|
||||
y_input = new ::TextInput(m_parent, Y, m_opt.sidetext, "inputbox_y", wxDefaultPosition, field_size, style);
|
||||
x_textctrl = x_input->GetTextCtrl();
|
||||
y_textctrl = y_input->GetTextCtrl();
|
||||
if (parent_is_custom_ctrl && m_opt.height < 0)
|
||||
opt_height = (double)x_textctrl->GetSize().GetHeight() / m_em_unit;
|
||||
|
||||
x_textctrl->SetFont(Slic3r::GUI::wxGetApp().normal_font());
|
||||
x_textctrl->SetBackgroundStyle(wxBG_STYLE_PAINT);
|
||||
y_textctrl->SetFont(Slic3r::GUI::wxGetApp().normal_font());
|
||||
y_textctrl->SetBackgroundStyle(wxBG_STYLE_PAINT);
|
||||
x_input->SetFont(Slic3r::GUI::wxGetApp().normal_font());
|
||||
x_input->SetBackgroundStyle(wxBG_STYLE_PAINT);
|
||||
y_input->SetFont(Slic3r::GUI::wxGetApp().normal_font());
|
||||
y_input->SetBackgroundStyle(wxBG_STYLE_PAINT);
|
||||
|
||||
auto static_text_x = new wxStaticText(m_parent, wxID_ANY, "x : ");
|
||||
auto static_text_y = new wxStaticText(m_parent, wxID_ANY, " y : ");
|
||||
static_text_x->SetFont(Slic3r::GUI::wxGetApp().normal_font());
|
||||
static_text_x->SetBackgroundStyle(wxBG_STYLE_PAINT);
|
||||
static_text_y->SetFont(Slic3r::GUI::wxGetApp().normal_font());
|
||||
static_text_y->SetBackgroundStyle(wxBG_STYLE_PAINT);
|
||||
//auto static_text_x = new wxStaticText(m_parent, wxID_ANY, "x : ");
|
||||
//auto static_text_y = new wxStaticText(m_parent, wxID_ANY, " y : ");
|
||||
//static_text_x->SetFont(Slic3r::GUI::wxGetApp().normal_font());
|
||||
//static_text_x->SetBackgroundStyle(wxBG_STYLE_PAINT);
|
||||
//static_text_y->SetFont(Slic3r::GUI::wxGetApp().normal_font());
|
||||
//static_text_y->SetBackgroundStyle(wxBG_STYLE_PAINT);
|
||||
|
||||
wxGetApp().UpdateDarkUI(x_textctrl);
|
||||
wxGetApp().UpdateDarkUI(y_textctrl);
|
||||
wxGetApp().UpdateDarkUI(static_text_x, false, true);
|
||||
wxGetApp().UpdateDarkUI(static_text_y, false, true);
|
||||
wxGetApp().UpdateDarkUI(x_input);
|
||||
wxGetApp().UpdateDarkUI(y_input);
|
||||
//wxGetApp().UpdateDarkUI(static_text_x, false, true);
|
||||
//wxGetApp().UpdateDarkUI(static_text_y, false, true);
|
||||
|
||||
temp->Add(static_text_x, 0, wxALIGN_CENTER_VERTICAL, 0);
|
||||
temp->Add(x_textctrl);
|
||||
temp->Add(static_text_y, 0, wxALIGN_CENTER_VERTICAL, 0);
|
||||
temp->Add(y_textctrl);
|
||||
//temp->Add(static_text_x, 0, wxALIGN_CENTER_VERTICAL, 0);
|
||||
temp->Add(x_input);
|
||||
//temp->Add(static_text_y, 0, wxALIGN_CENTER_VERTICAL, 0);
|
||||
temp->Add(y_input);
|
||||
|
||||
x_textctrl->Bind(wxEVT_TEXT_ENTER, ([this](wxCommandEvent e) { propagate_value(x_textctrl); }), x_textctrl->GetId());
|
||||
y_textctrl->Bind(wxEVT_TEXT_ENTER, ([this](wxCommandEvent e) { propagate_value(y_textctrl); }), y_textctrl->GetId());
|
||||
@@ -1797,16 +1802,17 @@ void PointCtrl::msw_rescale()
|
||||
{
|
||||
Field::msw_rescale();
|
||||
|
||||
wxSize field_size(4 * m_em_unit, -1);
|
||||
//wxSize field_size(4 * m_em_unit, -1);
|
||||
wxSize field_size((m_opt.width >= 0 ? m_opt.width : def_width_wider()) * m_em_unit, -1); // ORCA match width with other components
|
||||
|
||||
if (parent_is_custom_ctrl) {
|
||||
field_size.SetHeight(lround(opt_height * m_em_unit));
|
||||
x_textctrl->SetSize(field_size);
|
||||
y_textctrl->SetSize(field_size);
|
||||
x_input->SetSize(field_size);
|
||||
y_input->SetSize(field_size);
|
||||
}
|
||||
else {
|
||||
x_textctrl->SetMinSize(field_size);
|
||||
y_textctrl->SetMinSize(field_size);
|
||||
x_input->SetMinSize(field_size);
|
||||
y_input->SetMinSize(field_size);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "GUI.hpp"
|
||||
#include "wxExtensions.hpp"
|
||||
#include "Widgets/SpinInput.hpp"
|
||||
#include "Widgets/TextInput.hpp"
|
||||
|
||||
#ifdef __WXMSW__
|
||||
#define wxMSW true
|
||||
@@ -502,6 +503,8 @@ public:
|
||||
wxSizer* sizer{ nullptr };
|
||||
wxTextCtrl* x_textctrl{ nullptr };
|
||||
wxTextCtrl* y_textctrl{ nullptr };
|
||||
TextInput* x_input{nullptr};
|
||||
TextInput* y_input{nullptr};
|
||||
|
||||
void BUILD() override;
|
||||
bool value_was_changed(wxTextCtrl* win);
|
||||
|
||||
@@ -57,7 +57,8 @@ ComboBox::ComboBox(wxWindow *parent,
|
||||
TextInput::SetBackgroundColor(StateColor(std::make_pair(0xF0F0F1, (int) StateColor::Disabled),
|
||||
std::make_pair(0xE5F0EE, (int) StateColor::Focused), // ORCA updated background color for focused item
|
||||
std::make_pair(*wxWHITE, (int) StateColor::Normal)));
|
||||
TextInput::SetLabelColor(StateColor(std::make_pair(0x909090, (int) StateColor::Disabled),
|
||||
TextInput::SetLabelColor(StateColor(
|
||||
std::make_pair(wxColour("#ACACAC"), (int) StateColor::Disabled), // ORCA: Use same color for disabled text on combo boxes
|
||||
std::make_pair(0x262E30, (int) StateColor::Normal)));
|
||||
}
|
||||
if (auto scroll = GetScrollParent(this))
|
||||
@@ -85,7 +86,7 @@ void ComboBox::SetSelection(int n)
|
||||
drop.SetSelection(n);
|
||||
SetLabel(drop.GetValue());
|
||||
if (drop.selection >= 0 && drop.iconSize.y > 0)
|
||||
SetIcon(icons[drop.selection]);
|
||||
SetIcon(icons[drop.selection].IsNull() ? create_scaled_bitmap("drop_down", nullptr, 16): icons[drop.selection]); // ORCA fix combo boxes without arrows
|
||||
}
|
||||
void ComboBox::SelectAndNotify(int n) {
|
||||
SetSelection(n);
|
||||
@@ -108,7 +109,7 @@ void ComboBox::SetValue(const wxString &value)
|
||||
drop.SetValue(value);
|
||||
SetLabel(value);
|
||||
if (drop.selection >= 0 && drop.iconSize.y > 0)
|
||||
SetIcon(icons[drop.selection]);
|
||||
SetIcon(icons[drop.selection].IsNull() ? create_scaled_bitmap("drop_down", nullptr, 16): icons[drop.selection]); // ORCA fix combo boxes without arrows
|
||||
}
|
||||
|
||||
void ComboBox::SetLabel(const wxString &value)
|
||||
|
||||
Reference in New Issue
Block a user