UI fixes / improvements (#12513)

* bbl device selector search box

* align file and more menus with its button

* fix multiline inputbox border color on windows

* fix multiline inputbox border color on windows

* preferences: use content width on combobox dropdowns

* about:  match version text size on macOS

* msg dialog improvements

* fix canvas menu overlapping with sliced plates toolbar

* bbl bind dialog button placement

* bbl color picker

* Update StepMeshDialog.cpp

* drop file dialog

* drop dialog revert fonts

* revert windows multiline border

* Update StepMeshDialog.cpp

* update

* Flushing Volumes: match style of combobox

* fix hyperlink color on canvas notifications

* fix possible issues with shared profiles notification
This commit is contained in:
yw4z
2026-05-15 20:12:30 +03:00
committed by GitHub
parent 7fdb03df45
commit 25d611d642
17 changed files with 164 additions and 200 deletions

View File

@@ -248,12 +248,7 @@ AboutDialog::AboutDialog()
wxStaticText* credits_string = new wxStaticText(this, wxID_ANY, wxString::Format("Build %s", std::string(GIT_COMMIT_HASH)), wxDefaultPosition, wxDefaultSize);
credits_string->SetFont(_build_string_font);
wxFont version_font = GetFont();
#ifdef __WXMSW__
version_font.SetPointSize(version_font.GetPointSize()-1);
#else
version_font.SetPointSize(11);
#endif
version_font.SetPointSize(20);
version_font = version_font.Scaled(1.85f); // SetPointSize(20) not works on macOS because it uses a 72 PPI reference
version->SetFont(version_font);
version->SetForegroundColour(wxColour("#949494"));
credits_string->SetForegroundColour(wxColour("#949494"));

View File

@@ -653,7 +653,8 @@ void BBLTopbar::OnFileToolItem(wxAuiToolBarEvent& evt)
tb->SetToolSticky(evt.GetId(), true);
if (!m_skip_popup_file_menu) {
GetParent()->PopupMenu(m_file_menu, wxPoint(FromDIP(1), this->GetSize().GetHeight() - 2));
auto rec = this->GetToolRect(ID_TOP_FILE_MENU);
GetParent()->PopupMenu(m_file_menu, wxPoint(rec.GetLeft(), this->GetSize().GetHeight() - 2));
}
else {
m_skip_popup_file_menu = false;
@@ -670,7 +671,8 @@ void BBLTopbar::OnDropdownToolItem(wxAuiToolBarEvent& evt)
tb->SetToolSticky(evt.GetId(), true);
if (!m_skip_popup_dropdown_menu) {
GetParent()->PopupMenu(&m_top_menu, wxPoint(FromDIP(1), this->GetSize().GetHeight() - 2));
auto rec = this->GetToolRect(ID_TOP_DROPDOWN_MENU);
GetParent()->PopupMenu(&m_top_menu, wxPoint(rec.GetLeft(), this->GetSize().GetHeight() - 2));
}
else {
m_skip_popup_dropdown_menu = false;

View File

@@ -151,6 +151,7 @@ PingCodeBindDialog::PingCodeBindDialog(Plater* plater /*= nullptr*/)
sizer_request->Add(0, 0, 0, wxTOP, FromDIP(5));
sizer_request->Add(ping_code_input, 0, wxLEFT, FromDIP(10));
sizer_request->Add(0, 0, 0, wxTOP, FromDIP(10));
sizer_request->AddStretchSpacer();
sizer_request->Add(m_sizer_button, 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM, ButtonProps::ChoiceButtonGap());
request_bind_panel->SetSizer(sizer_request);
request_bind_panel->Layout();

View File

@@ -73,7 +73,7 @@ FilamentPickerDialog::FilamentPickerDialog(wxWindow *parent, const wxString& fil
wxString color_name = m_color_query->GetFilaColorName(fila_id, fila_color);
m_cur_color_name = new wxString(color_name);
wxBoxSizer *container_sizer = new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer *container_sizer = new wxBoxSizer(wxVERTICAL);
wxBoxSizer *main_sizer = new wxBoxSizer(wxVERTICAL);
// Preview panel (always present)
@@ -94,16 +94,16 @@ FilamentPickerDialog::FilamentPickerDialog(wxWindow *parent, const wxString& fil
// "More colours" button (always present)
CreateMoreInfoButton();
main_sizer->Add(m_more_btn, 0, wxEXPAND | wxTOP | wxBOTTOM, FromDIP(8));
main_sizer->AddSpacer(FromDIP(8));
main_sizer->Add(m_more_btn, 0, wxEXPAND | wxTOP, FromDIP(8));
//main_sizer->AddSpacer(FromDIP(8));
// OK / Cancel buttons
auto dlg_btns = new DialogButtons(this, {"OK", "Cancel"});
m_ok_btn = dlg_btns->GetOK();
m_cancel_btn = dlg_btns->GetCANCEL();
main_sizer->Add(dlg_btns, 0, wxEXPAND);
container_sizer->Add(main_sizer, 1, wxEXPAND | wxALL, FromDIP(16));
container_sizer->Add(main_sizer, 1, wxEXPAND | wxALL, FromDIP(10));
container_sizer->Add(dlg_btns, 0, wxEXPAND);
SetSizer(container_sizer);
Layout();
@@ -533,17 +533,7 @@ void FilamentPickerDialog::UpdateButtonStates(wxBitmapButton* selected_btn)
void FilamentPickerDialog::CreateMoreInfoButton()
{
m_more_btn = new Button(this, "+ " + _L("More Colors"));
m_more_btn->SetMinSize(wxSize(-1, FromDIP(36)));
StateColor btn_bg(
std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(248, 248, 248), StateColor::Normal)
);
m_more_btn->SetBackgroundColor(btn_bg);
m_more_btn->SetBorderStyle(wxPENSTYLE_SHORT_DASH);
m_more_btn->SetCornerRadius(FromDIP(0));
m_more_btn->SetStyle(ButtonStyle::Regular, ButtonType::Expanded);
}
wxColourData FilamentPickerDialog::GetSingleColorData()

View File

@@ -8179,6 +8179,9 @@ void GLCanvas3D::_render_imgui_select_plate_toolbar()
if (wxGetApp().show_3d_navigator()) {
window_height_max -= (128 * f_scale + 5);
}
else { // ORCA spacing for canvas menu
window_height_max -= (96 * f_scale + 5);
}
// ORCA simplify and correct window size and margin calculations and get values from style
ImGuiWrapper& imgui = *wxGetApp().imgui();

View File

@@ -58,7 +58,7 @@ MsgDialog::MsgDialog(wxWindow *parent, const wxString &title, const wxString &he
main_sizer->Add(topsizer, 1, wxEXPAND);
m_dsa_sizer = new wxBoxSizer(wxHORIZONTAL);
btn_sizer->Add(0, 0, 0, wxLEFT, FromDIP(120));
btn_sizer->Add(0, 0, 0, wxLEFT, FromDIP(LOGO_SPACING + 64 + LOGO_GAP));
btn_sizer->Add(m_dsa_sizer, 0, wxEXPAND);
btn_sizer->AddStretchSpacer();
main_sizer->Add(btn_sizer, 0, wxBOTTOM | wxRIGHT | wxEXPAND | wxTOP, FromDIP(10));
@@ -76,7 +76,7 @@ MsgDialog::MsgDialog(wxWindow *parent, const wxString &title, const wxString &he
void MsgDialog::show_dsa_button(wxString const &title)
{
m_checkbox_dsa = new CheckBox(this);
m_dsa_sizer->Add(m_checkbox_dsa, 0, wxALL | wxALIGN_CENTER, FromDIP(2));
m_dsa_sizer->Add(m_checkbox_dsa, 0, wxALIGN_CENTER);
m_checkbox_dsa->Bind(wxEVT_TOGGLEBUTTON, [this](wxCommandEvent& e) {
auto event = wxCommandEvent(EVT_CHECKBOX_CHANGE);
event.SetInt(m_checkbox_dsa->GetValue()?1:0);
@@ -86,7 +86,17 @@ void MsgDialog::show_dsa_button(wxString const &title)
});
auto m_text_dsa = new wxStaticText(this, wxID_ANY, title.IsEmpty() ? _L("Don't show again") : title, wxDefaultPosition, wxDefaultSize, 0);
auto on_toggle = [this]() {
m_checkbox_dsa->SetValue(!m_checkbox_dsa->GetValue());
wxCommandEvent ev(wxEVT_TOGGLEBUTTON, m_checkbox_dsa->GetId());
ev.SetEventObject(m_checkbox_dsa);
m_checkbox_dsa->GetEventHandler()->ProcessEvent(ev);
};
m_text_dsa->Bind(wxEVT_LEFT_DOWN, [on_toggle](wxMouseEvent& e) {if(!e.LeftDClick()) on_toggle();});
m_text_dsa->Bind(wxEVT_LEFT_DCLICK, [on_toggle](wxMouseEvent& e) {on_toggle();});
m_dsa_sizer->Add(m_text_dsa, 0, wxALL | wxALIGN_CENTER, FromDIP(2));
m_dsa_sizer->AddSpacer(FromDIP(10)); // spacing after checkbox
m_text_dsa->SetFont(::Label::Body_13);
m_text_dsa->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#323A3D")));
btn_sizer->Layout();
@@ -169,7 +179,7 @@ Button* MsgDialog::add_button(wxWindowID btn_id, bool set_focus /*= false*/, con
if (set_focus)
btn->SetFocus();
btn_sizer->Add(btn, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, FromDIP(ButtonProps::ChoiceButtonGap()));
btn_sizer->Add(btn, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, FromDIP(ButtonProps::ChoiceButtonGap()));
btn->Bind(wxEVT_BUTTON, [this, btn_id](wxCommandEvent&) { EndModal(btn_id); });
MsgButton *mb = new MsgButton;
@@ -289,7 +299,8 @@ static void add_msg_content(wxWindow *parent,
}
else {
wxClientDC dc(parent);
wxSize msg_sz = dc.GetMultiLineTextExtent(msg);
dc.SetFont(font); // ORCA without this it calculates bigger size
wxSize msg_sz = dc.GetMultiLineTextExtent(msg) + parent->FromDIP(wxSize(10,5)); // added extra spacing to prevent wrapping
page_size = wxSize(std::min(msg_sz.GetX(), info_width), std::min(msg_sz.GetY(), info_width));
// Extra line breaks in message dialog
@@ -355,7 +366,7 @@ ErrorDialog::ErrorDialog(wxWindow *parent, const wxString &temp_msg, bool monosp
add_msg_content(this, content_sizer, msg, monospaced_font);
// Use a small bitmap with monospaced font, as the error text will not be wrapped.
logo->SetBitmap(create_scaled_bitmap("OrcaSlicer_192px_grayscale.png", this, monospaced_font ? 48 : /*1*/84));
logo->SetBitmap(create_scaled_bitmap("OrcaSlicer_192px_grayscale.png", this, monospaced_font ? 48 : /*1*/64));
SetMaxSize(MSG_DLG_MAX_SIZE);
@@ -563,7 +574,7 @@ Newer3mfVersionDialog::Newer3mfVersionDialog(wxWindow *parent, const Semver *fil
main_sizer->Add(0, 0, 0, wxTOP, FromDIP(5));
wxBoxSizer * content_sizer = new wxBoxSizer(wxHORIZONTAL);
wxStaticBitmap *info_bitmap = new wxStaticBitmap(this, wxID_ANY, create_scaled_bitmap("info", nullptr, 60), wxDefaultPosition, wxSize(FromDIP(70), FromDIP(70)), 0);
wxStaticBitmap *info_bitmap = new wxStaticBitmap(this, wxID_ANY, create_scaled_bitmap("info", nullptr, 64), wxDefaultPosition, wxSize(FromDIP(70), FromDIP(70)), 0);
wxBoxSizer * msg_sizer = get_msg_sizer();
content_sizer->Add(info_bitmap, 0, wxEXPAND | wxALL, FromDIP(5));
content_sizer->Add(msg_sizer, 0, wxEXPAND | wxALL, FromDIP(5));

View File

@@ -71,7 +71,7 @@ struct MsgDialog : DPIDialog
protected:
enum {
BORDER = 20,
LOGO_SPACING = 35,
LOGO_SPACING = 25,
LOGO_GAP = 20,
CONTENT_WIDTH = 242,
CONTENT_MAX_HEIGHT = 60,//TO

View File

@@ -239,6 +239,8 @@ void NotificationManager::PopNotification::use_bbl_theme()
m_WindowBkgColor = m_is_dark ? ImVec4(45 / 255.f, 45 / 255.f, 49 / 255.f, 1.f) : ImVec4(1, 1, 1, 1);
m_TextColor = m_is_dark ? ImVec4(224 / 255.f, 224 / 255.f, 224 / 255.f, 1.f) : ImVec4(.2f, .2f, .2f, 1.0f);
m_HyperTextColor = m_is_dark ? ImVec4(0, 0.588, 0.533, 1) : ImVec4(0, 0.588, 0.533, 1);
m_HyperTextColorHover = m_is_dark ? ImVec4(38.f / 255.f, 166.f / 255.f, 154.f / 255.f, 1) : ImVec4(0.f, 129.f / 255.f, 114.f / 255.f, 1); //#26A69A / #008172;
m_is_dark ? push_style_color(ImGuiCol_Border, {62 / 255.f, 62 / 255.f, 69 / 255.f, 1.f}, true, m_current_fade_opacity) : push_style_color(ImGuiCol_Border, m_CurrentColor, true, m_current_fade_opacity);
push_style_color(ImGuiCol_WindowBg, m_WindowBkgColor, true, m_current_fade_opacity);
push_style_color(ImGuiCol_Text, m_TextColor, true, m_current_fade_opacity);
@@ -759,11 +761,17 @@ void NotificationManager::PopNotification::render_hypertext(ImGuiWrapper& imgui,
HyperColor = ImVec4(135.f / 255.f, 43 / 255.f, 43 / 255.f, 1);
if (ImGui::IsItemHovered(ImGuiHoveredFlags_RectOnly))
{
HyperColor.y += 0.1f;
if (m_data.level == NotificationLevel::SeriousWarningNotificationLevel || m_data.level == NotificationLevel::SeriousWarningNotificationLevel)
HyperColor.x += 0.2f;
if (m_data.level == NotificationLevel::SeriousWarningNotificationLevel){
HyperColor.y += 0.1f;
HyperColor.x += 0.2f;
}
else if(m_data.level == NotificationLevel::ErrorNotificationLevel){
HyperColor.y += 0.1f;
}
else {
HyperColor = m_HyperTextColorHover;
}
}
//text
push_style_color(ImGuiCol_Text, HyperColor, m_state == EState::FadingOut, m_current_fade_opacity);
@@ -2255,8 +2263,9 @@ void NotificationManager::push_import_finished_notification(const std::string& p
void NotificationManager::SharedProfilesNotification::init()
{
PopNotification::init();
// Add one extra line for the hyperlink row ("Browse shared profiles" + "Don't show again")
m_lines_count++;
// Add two extra lines for the hyperlink row ("Browse shared profiles" + "Don't show again")
// and 1 more additional line for adding spacing between them to make it easier to click
m_lines_count = m_lines_count + 2; // ORCA
}
void NotificationManager::SharedProfilesNotification::render_text(ImGuiWrapper& imgui,
@@ -2283,18 +2292,18 @@ void NotificationManager::SharedProfilesNotification::render_text(ImGuiWrapper&
}
// Render "Browse shared profiles" hyperlink on the next line
float hyper_y = starting_y + m_endlines.size() * shift_y;
float hyper_y = starting_y + m_endlines.size() * shift_y - m_line_height / 2.f;
render_hypertext(imgui, x_offset, hyper_y, m_hypertext);
// Render "Don't show again" hyperlink after the browse link
{
float dont_show_x = x_offset + ImGui::CalcTextSize((m_hypertext + " ").c_str()).x;
float dont_show_y = hyper_y + ImGui::CalcTextSize((m_hypertext + " ").c_str()).y + m_line_height / 2.f;
std::string dont_show_text = _u8L("Don't show again");
ImVec2 part_size = ImGui::CalcTextSize(dont_show_text.c_str());
// Invisible button
ImGui::SetCursorPosX(dont_show_x - 4);
ImGui::SetCursorPosY(hyper_y - 5);
ImGui::SetCursorPosX(x_offset); // ORCA render on new line to prevent long translations from being cut off
ImGui::SetCursorPosY(dont_show_y);
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(.0f, .0f, .0f, .0f));
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(.0f, .0f, .0f, .0f));
ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(.0f, .0f, .0f, .0f));
@@ -2308,12 +2317,12 @@ void NotificationManager::SharedProfilesNotification::render_text(ImGuiWrapper&
// Hover color
ImVec4 color = m_HyperTextColor;
if (ImGui::IsItemHovered(ImGuiHoveredFlags_RectOnly))
color.y += 0.1f;
color = m_HyperTextColorHover;
// Text
push_style_color(ImGuiCol_Text, color, m_state == EState::FadingOut, m_current_fade_opacity);
ImGui::SetCursorPosX(dont_show_x);
ImGui::SetCursorPosY(hyper_y);
ImGui::SetCursorPosX(x_offset);
ImGui::SetCursorPosY(dont_show_y);
imgui.text(dont_show_text.c_str());
ImGui::PopStyleColor();
@@ -2354,7 +2363,7 @@ void NotificationManager::SharedProfilesNotification::render_hypertext(ImGuiWrap
// Hover color
ImVec4 HyperColor = m_HyperTextColor;
if (ImGui::IsItemHovered(ImGuiHoveredFlags_RectOnly))
HyperColor.y += 0.1f;
HyperColor = m_HyperTextColorHover;
// Text
push_style_color(ImGuiCol_Text, HyperColor, m_state == EState::FadingOut, m_current_fade_opacity);

View File

@@ -543,6 +543,7 @@ private:
ImVec4 m_TextColor;
ImVec4 m_HyperTextColor;
ImVec4 m_HyperTextColorHover;
ImVec4 m_ErrorColor;
ImVec4 m_WarnColor;

View File

@@ -13941,7 +13941,6 @@ public:
wxPanel * m_top_line;
wxStaticText *m_fname_title;
wxStaticText *m_fname_f;
wxStaticText *m_fname_s;
StaticBox * m_panel_select;
void on_select_ok(wxCommandEvent &event);
@@ -13951,7 +13950,6 @@ public:
void set_action(int index) { m_action = index; }
wxBoxSizer *create_remember_checkbox(wxString title, wxWindow* parent, wxString tooltip);
wxBoxSizer *create_item_radiobox(wxString title, wxWindow *parent, int select_id, int groupid);
protected:
void on_dpi_changed(const wxRect &suggested_rect) override;
@@ -13969,10 +13967,6 @@ ProjectDropDialog::ProjectDropDialog(const std::string &filename)
// def setting
SetBackgroundColour(m_def_color);
// icon
std::string icon_path = (boost::format("%1%/images/OrcaSlicerTitle.ico") % resources_dir()).str();
SetIcon(wxIcon(encode_path(icon_path.c_str()), wxBITMAP_TYPE_ICO));
wxBoxSizer *m_sizer_main = new wxBoxSizer(wxVERTICAL);
m_top_line = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
@@ -13980,37 +13974,23 @@ ProjectDropDialog::ProjectDropDialog(const std::string &filename)
m_sizer_main->Add(m_top_line, 0, wxEXPAND, 0);
m_sizer_main->Add(0, 0, 0, wxEXPAND | wxTOP, 20);
wxBoxSizer *m_sizer_name = new wxBoxSizer(wxVERTICAL);
wxBoxSizer *m_sizer_fline = new wxBoxSizer(wxHORIZONTAL);
m_sizer_main->AddSpacer(FromDIP(15));
// ORCA use file name on new line to create room for longer names
m_fname_title = new wxStaticText(this, wxID_ANY, _L("Please select an action"), wxDefaultPosition, wxDefaultSize, 0);
m_fname_title->Wrap(-1);
m_fname_title->SetFont(::Label::Body_14);
m_fname_title->SetForegroundColour(wxColour(107, 107, 107));
m_fname_title->SetBackgroundColour(wxColour(255, 255, 255));
m_fname_title->SetForegroundColour(wxColour("#363636"));
m_sizer_fline->Add(m_fname_title, 0, wxALL, 0);
m_sizer_fline->Add(0, 0, 0, wxEXPAND | wxLEFT, 5);
m_fname_f = new wxStaticText(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
m_fname_f = new wxStaticText(this, wxID_ANY, filename);
m_fname_f->SetFont(::Label::Head_14);
m_fname_f->Wrap(-1);
m_fname_f->SetForegroundColour(wxColour(38, 46, 48));
m_fname_f->SetMaxSize(wxSize(FromDIP(300),-1));
m_fname_f->Wrap(FromDIP(300));
m_fname_f->SetForegroundColour(wxColour("#363636"));
m_sizer_fline->Add(m_fname_f, 1, wxALL, 0);
m_sizer_name->Add(m_sizer_fline, 1, wxEXPAND, 0);
m_fname_s = new wxStaticText(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
m_fname_s->SetFont(::Label::Head_14);
m_fname_s->Wrap(-1);
m_fname_s->SetForegroundColour(wxColour(38, 46, 48));
m_sizer_name->Add(m_fname_s, 1, wxALL, 0);
m_sizer_main->Add(m_sizer_name, 1, wxEXPAND | wxLEFT | wxRIGHT, 20);
m_sizer_main->Add(m_fname_title, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(20));
m_sizer_main->AddSpacer(FromDIP(10));
m_sizer_main->Add(m_fname_f , 1, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(20));
m_sizer_main->AddSpacer(FromDIP(10));
auto radio_group = new RadioGroup(this, {
_L("Open as project"), // 0
@@ -14022,9 +14002,9 @@ ProjectDropDialog::ProjectDropDialog(const std::string &filename)
set_action(radio_group->GetSelection() + 1);
});
m_sizer_main->Add(radio_group, 0, wxEXPAND | wxLEFT | wxRIGHT, 20);
m_sizer_main->Add(radio_group, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(20));
m_sizer_main->Add(0, 0, 0, wxEXPAND | wxTOP, 10);
m_sizer_main->AddSpacer(FromDIP(10));
// wxBoxSizer *m_sizer_bottom = new wxBoxSizer(wxHORIZONTAL);
// Orca: hide the "Don't show again" checkbox, people keeps accidentally checked this then forgot
@@ -14048,29 +14028,6 @@ ProjectDropDialog::ProjectDropDialog(const std::string &filename)
Fit();
Centre(wxBOTH);
auto limit_width = m_fname_f->GetSize().GetWidth() - 2;
auto current_width = 0;
auto cut_index = 0;
auto fstring = wxString("");
auto bstring = wxString("");
//auto file_name = from_u8(filename.c_str());
auto file_name = wxString(filename);
for (int x = 0; x < file_name.length(); x++) {
current_width += m_fname_s->GetTextExtent(file_name[x]).GetWidth();
cut_index = x;
if (current_width > limit_width) {
bstring += file_name[x];
} else {
fstring += file_name[x];
}
}
m_fname_f->SetLabel(fstring);
m_fname_s->SetLabel(bstring);
wxGetApp().UpdateDlgDarkUI(this);
}

View File

@@ -69,6 +69,7 @@ std::tuple<wxBoxSizer*, ComboBox*> PreferencesDialog::create_item_combobox_base(
auto combobox = new ::ComboBox(m_parent, wxID_ANY, wxEmptyString, wxDefaultPosition, DESIGN_LARGE_COMBOBOX_SIZE, 0, nullptr, wxCB_READONLY);
combobox->SetFont(::Label::Body_14);
combobox->GetDropDown().SetFont(::Label::Body_14);
combobox->GetDropDown().SetUseContentWidth(true);
std::vector<wxString>::iterator iter;
for (iter = vlist.begin(); iter != vlist.end(); iter++) {
@@ -190,6 +191,7 @@ wxBoxSizer *PreferencesDialog::create_item_language_combobox(wxString title, wxS
auto combobox = new ::ComboBox(m_parent, wxID_ANY, wxEmptyString, wxDefaultPosition, DESIGN_LARGE_COMBOBOX_SIZE, 0, nullptr, wxCB_READONLY);
combobox->SetFont(::Label::Body_14);
combobox->GetDropDown().SetFont(::Label::Body_14);
combobox->GetDropDown().SetUseContentWidth(true);
auto language = app_config->get(param);
m_current_language_selected = -1;
std::vector<wxString>::iterator iter;
@@ -354,6 +356,7 @@ wxBoxSizer *PreferencesDialog::create_item_region_combobox(wxString title, wxStr
auto combobox = new ::ComboBox(m_parent, wxID_ANY, wxEmptyString, wxDefaultPosition, DESIGN_LARGE_COMBOBOX_SIZE, 0, nullptr, wxCB_READONLY);
combobox->SetFont(::Label::Body_14);
combobox->GetDropDown().SetFont(::Label::Body_14);
combobox->GetDropDown().SetUseContentWidth(true);
m_sizer_combox->Add(combobox, 0, wxALIGN_CENTER | wxLEFT, FromDIP(5));
std::vector<wxString>::iterator iter;
@@ -433,6 +436,7 @@ wxBoxSizer *PreferencesDialog::create_item_loglevel_combobox(wxString title, wxS
auto combobox = new ::ComboBox(m_parent, wxID_ANY, wxEmptyString, wxDefaultPosition, DESIGN_COMBOBOX_SIZE, 0, nullptr, wxCB_READONLY);
combobox->SetFont(::Label::Body_14);
combobox->GetDropDown().SetFont(::Label::Body_14);
combobox->GetDropDown().SetUseContentWidth(true);
std::vector<wxString>::iterator iter;
for (iter = vlist.begin(); iter != vlist.end(); iter++) { combobox->Append(*iter); }

View File

@@ -335,12 +335,12 @@ SelectMachinePopup::SelectMachinePopup(wxWindow *parent)
#if defined(__WINDOWS__)
m_sizer_search_bar = new wxBoxSizer(wxVERTICAL);
m_search_bar = new wxSearchCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_search_bar = new wxSearchCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxNO_BORDER );
m_search_bar->SetDescriptiveText(_L("Search"));
m_search_bar->ShowSearchButton( true );
m_search_bar->ShowCancelButton( false );
m_sizer_search_bar->Add( m_search_bar, 1, wxALL| wxEXPAND, 1 );
m_sizer_main->Add(m_sizer_search_bar, 0, wxALL | wxEXPAND, FromDIP(2));
m_sizer_main->Add(m_sizer_search_bar, 0, wxTOP | wxRIGHT | wxLEFT | wxEXPAND, FromDIP(1));
m_search_bar->Bind( wxEVT_COMMAND_TEXT_UPDATED, &SelectMachinePopup::update_machine_list, this );
#endif
auto own_title = create_title_panel(_L("My Device"));

View File

@@ -11,6 +11,7 @@
#include "Widgets/Button.hpp"
#include "Widgets/TextInput.hpp"
#include "Widgets/DialogButtons.hpp"
#include "Widgets/RoundedRectangle.hpp"
#include <chrono>
using namespace Slic3r;
@@ -19,9 +20,9 @@ using namespace Slic3r::GUI;
static int _scale(const int val) { return val * Slic3r::GUI::wxGetApp().em_unit() / 10; }
static int _ITEM_WIDTH() { return _scale(30); }
#define MIN_DIALOG_WIDTH FromDIP(400)
#define SLIDER_WIDTH FromDIP(200)
#define SLIDER_WIDTH FromDIP(220)
#define SLIDER_HEIGHT FromDIP(25)
#define TEXT_CTRL_WIDTH FromDIP(70)
#define TEXT_CTRL_WIDTH FromDIP(100)
#define BUTTON_SIZE wxSize(FromDIP(58), FromDIP(24))
#define BUTTON_BORDER FromDIP(int(400 - 58 * 2) / 8)
#define SLIDER_SCALE(val) ((val) / 0.001)
@@ -29,7 +30,7 @@ static int _ITEM_WIDTH() { return _scale(30); }
#define SLIDER_SCALE_10(val) ((val) / 0.01)
#define SLIDER_UNSCALE_10(val) ((val) * 0.01)
#define LEFT_RIGHT_PADING FromDIP(20)
#define FONT_COLOR wxColour("#6B6B6B")
#define FONT_COLOR wxColour("#262E30")
wxDEFINE_EVENT(wxEVT_THREAD_DONE, wxCommandEvent);
@@ -85,9 +86,9 @@ StepMeshDialog::StepMeshDialog(wxWindow* parent, Slic3r::Step& file, double line
SetBackgroundColour(*wxWHITE);
wxBoxSizer* bSizer = new wxBoxSizer(wxVERTICAL);
bSizer->SetMinSize(wxSize(MIN_DIALOG_WIDTH, -1));
//bSizer->SetMinSize(wxSize(MIN_DIALOG_WIDTH, -1));
auto image_bitmap = create_scaled_bitmap("step_mesh_info", this, FromDIP(120));
//auto image_bitmap = create_scaled_bitmap("step_mesh_info", this, FromDIP(120));
// wxPanel* overlay_panel = new wxPanel(this, wxID_ANY, wxDefaultPosition, image_bitmap.GetSize(), wxTAB_TRAVERSAL);
// overlay_panel->SetBackgroundStyle(wxBG_STYLE_PAINT);
@@ -114,23 +115,31 @@ StepMeshDialog::StepMeshDialog(wxWindow* parent, Slic3r::Step& file, double line
// bSizer->Add(overlay_panel, 0, wxALIGN_CENTER | wxALL, 10);
auto tip_frame = new RoundedRectangle(this, StateColor::darkModeColorFor(wxColour("#F1F1F1")), wxDefaultPosition, wxSize(-1,-1), 6, 0);
wxBoxSizer* tips_sizer = new wxBoxSizer(wxVERTICAL);
wxStaticText* info = new wxStaticText(this, wxID_ANY, _L("Smaller linear and angular deflections result in higher-quality transformations but increase the processing time."));
info->SetForegroundColour(StateColor::darkModeColorFor(FONT_COLOR));
wxStaticText* info = new wxStaticText(tip_frame, wxID_ANY, _L("Smaller linear and angular deflections result in higher-quality transformations but increase the processing time."));
info->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#363636")));
info->SetBackgroundColour(StateColor::darkModeColorFor(wxColour("#F1F1F1")));
info->SetFont(::Label::Body_14);
info->Wrap(FromDIP(450));
// ORCA standardized HyperLink
HyperLink *tips = new HyperLink(this, _L("Wiki Guide"), "https://www.orcaslicer.com/wiki/import_export#step");
tips->SetFont(::Label::Body_12);
info->Wrap(FromDIP(400));
tips_sizer->Add(info, 0, wxALIGN_LEFT);
tips_sizer->Add(tips, 0, wxALIGN_LEFT);
bSizer->Add(tips_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, LEFT_RIGHT_PADING);
HyperLink *tips = new HyperLink(tip_frame, _L("Wiki Guide"), "https://www.orcaslicer.com/wiki/import_export#step");
tips->SetBackgroundColour(StateColor::darkModeColorFor(wxColour("#F1F1F1")));
tips_sizer->Add(info, 0, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, FromDIP(10));
tips_sizer->Add(tips, 0, wxALL, FromDIP(10));
tip_frame->SetSizer(tips_sizer);
tip_frame->Layout();
bSizer->Add(tip_frame, 0, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, LEFT_RIGHT_PADING);
wxBoxSizer* linear_sizer = new wxBoxSizer(wxHORIZONTAL);
//linear_sizer->SetMinSize(wxSize(MIN_DIALOG_WIDTH, -1));
wxStaticText* linear_title = new wxStaticText(this,
wxID_ANY, _L("Linear Deflection") + ": ");
linear_title->SetFont(::Label::Body_14);
linear_title->SetForegroundColour(StateColor::darkModeColorFor(FONT_COLOR));
linear_sizer->Add(linear_title, 0, wxALIGN_LEFT);
linear_sizer->AddStretchSpacer(1);
@@ -142,7 +151,7 @@ StepMeshDialog::StepMeshDialog(wxWindow* parent, Slic3r::Step& file, double line
linear_sizer->Add(linear_slider, 0, wxALIGN_RIGHT | wxLEFT, FromDIP(5));
auto linear_input = new ::TextInput(this, m_linear_last, wxEmptyString, wxEmptyString, wxDefaultPosition, wxSize(TEXT_CTRL_WIDTH, -1), wxTE_CENTER);
linear_input->GetTextCtrl()->SetFont(Label::Body_12);
linear_input->GetTextCtrl()->SetFont(Label::Body_14);
linear_input->GetTextCtrl()->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
linear_sizer->Add(linear_input, 0, wxALIGN_RIGHT | wxLEFT, FromDIP(5));
linear_input->Bind(wxEVT_KILL_FOCUS, ([this, linear_input](wxFocusEvent& e) {
@@ -179,11 +188,13 @@ StepMeshDialog::StepMeshDialog(wxWindow* parent, Slic3r::Step& file, double line
e.Skip();
}));
bSizer->Add(linear_sizer, 1, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, LEFT_RIGHT_PADING);
bSizer->Add(linear_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, LEFT_RIGHT_PADING);
bSizer->AddSpacer(FromDIP(5));
wxBoxSizer* angle_sizer = new wxBoxSizer(wxHORIZONTAL);
wxStaticText* angle_title = new wxStaticText(this,
wxID_ANY, _L("Angle Deflection") + ": ");
angle_title->SetFont(::Label::Body_14);
angle_title->SetForegroundColour(StateColor::darkModeColorFor(FONT_COLOR));
angle_sizer->Add(angle_title, 0, wxALIGN_LEFT);
angle_sizer->AddStretchSpacer(1);
@@ -195,7 +206,7 @@ StepMeshDialog::StepMeshDialog(wxWindow* parent, Slic3r::Step& file, double line
angle_sizer->Add(angle_slider, 0, wxALIGN_RIGHT | wxLEFT, FromDIP(5));
auto angle_input = new ::TextInput(this, m_angle_last, wxEmptyString, wxEmptyString, wxDefaultPosition, wxSize(TEXT_CTRL_WIDTH, -1), wxTE_CENTER);
angle_input->GetTextCtrl()->SetFont(Label::Body_12);
angle_input->GetTextCtrl()->SetFont(Label::Body_14);
angle_input->GetTextCtrl()->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
angle_sizer->Add(angle_input, 0, wxALIGN_RIGHT | wxLEFT, FromDIP(5));
angle_input->Bind(wxEVT_KILL_FOCUS, ([this, angle_input](wxFocusEvent& e) {
@@ -233,28 +244,32 @@ StepMeshDialog::StepMeshDialog(wxWindow* parent, Slic3r::Step& file, double line
e.Skip();
}));
bSizer->Add(angle_sizer, 1, wxEXPAND | wxLEFT | wxRIGHT, LEFT_RIGHT_PADING);
bSizer->Add(angle_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, LEFT_RIGHT_PADING);
wxBoxSizer* check_sizer = new wxBoxSizer(wxHORIZONTAL);
m_split_compound_checkbox = new wxCheckBox(this, wxID_ANY, _L("Split compound and compsolid into multiple objects"), wxDefaultPosition, wxDefaultSize, 0);
m_split_compound_checkbox->SetFont(::Label::Body_14);
m_split_compound_checkbox->SetForegroundColour(StateColor::darkModeColorFor(FONT_COLOR));
m_split_compound_checkbox->SetValue(wxGetApp().app_config->get_bool("is_split_compound"));
check_sizer->Add(m_split_compound_checkbox, 0, wxALIGN_LEFT);
bSizer->Add(check_sizer, 1, wxEXPAND | wxLEFT | wxRIGHT, LEFT_RIGHT_PADING);
bSizer->Add(check_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, LEFT_RIGHT_PADING);
wxBoxSizer* mesh_face_number_sizer = new wxBoxSizer(wxHORIZONTAL);
wxStaticText *mesh_face_number_title = new wxStaticText(this, wxID_ANY, _L("Number of triangular facets") + ": ");
mesh_face_number_title->SetFont(::Label::Body_14);
mesh_face_number_title->SetForegroundColour(StateColor::darkModeColorFor(FONT_COLOR));
mesh_face_number_text = new wxStaticText(this, wxID_ANY, "0");
mesh_face_number_text->SetFont(::Label::Body_14);
mesh_face_number_text->SetForegroundColour(StateColor::darkModeColorFor(FONT_COLOR));
mesh_face_number_text->SetMinSize(wxSize(FromDIP(150), -1));
mesh_face_number_sizer->Add(mesh_face_number_title, 0, wxALIGN_LEFT);
mesh_face_number_sizer->Add(mesh_face_number_text, 0, wxALIGN_LEFT);
bSizer->Add(mesh_face_number_sizer, 1, wxEXPAND | wxLEFT | wxRIGHT, LEFT_RIGHT_PADING);
bSizer->Add(mesh_face_number_sizer, 0, wxEXPAND | wxALL, LEFT_RIGHT_PADING);
wxBoxSizer* bSizer_button = new wxBoxSizer(wxHORIZONTAL);
bSizer_button->SetMinSize(wxSize(FromDIP(100), -1));
m_checkbox = new wxCheckBox(this, wxID_ANY, _L("Don't show again"), wxDefaultPosition, wxDefaultSize, 0);
m_checkbox->SetFont(::Label::Body_14);
m_checkbox->SetForegroundColour(StateColor::darkModeColorFor(FONT_COLOR));
bSizer_button->Add(m_checkbox, 0, wxALIGN_LEFT | wxLEFT | wxALIGN_CENTER_VERTICAL, LEFT_RIGHT_PADING);
bSizer_button->AddStretchSpacer(1);