diff --git a/resources/images/param_add.svg b/resources/images/param_add.svg
index 71ea5092af..b00140b68a 100644
--- a/resources/images/param_add.svg
+++ b/resources/images/param_add.svg
@@ -1,8 +1,4 @@
-
+
\ No newline at end of file
diff --git a/src/slic3r/GUI/Field.cpp b/src/slic3r/GUI/Field.cpp
index b7564551f8..b8cb698ff9 100644
--- a/src/slic3r/GUI/Field.cpp
+++ b/src/slic3r/GUI/Field.cpp
@@ -2154,6 +2154,7 @@ void PrinterAgentChoice::msw_rescale()
void PluginField::BUILD()
{
auto* panel = new wxPanel(m_parent, wxID_ANY);
+ panel->SetBackgroundColour(*wxWHITE);
wxGetApp().UpdateDarkUI(panel);
window = panel;
@@ -2196,9 +2197,8 @@ void PluginField::rebuild_ui()
m_rows.clear();
m_standalone_add_btn = nullptr;
- if (m_values.empty()) {
- add_empty_state_row();
- } else {
+ add_empty_state_row();
+ if (!m_values.empty()) {
for (size_t i = 0; i < m_values.size(); ++i)
add_plugin_row(display_name_for_value(m_values[i]), i == m_values.size() - 1);
}
@@ -2215,94 +2215,43 @@ void PluginField::rebuild_ui()
void PluginField::add_empty_state_row()
{
- const auto button_size = wxSize(def_width_thinner() * m_em_unit, -1);
- auto row_sizer = new wxBoxSizer(wxHORIZONTAL);
-
- wxTextCtrl* display = new wxTextCtrl(window, wxID_ANY, _L("No plugin selected"),
- wxDefaultPosition, wxSize(def_width_wider() * m_em_unit, wxDefaultCoord),
- wxTE_READONLY);
- display->SetEditable(false);
- wxGetApp().UpdateDarkUI(display);
- display->SetToolTip(_L("No plugin selected"));
-
- auto add_btn = new ScalableButton(window, wxID_ANY, "param_add", wxEmptyString,
- button_size, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, true, 16);
- wxGetApp().UpdateDarkUI(add_btn);
- add_btn->SetToolTip(_L("Add plugin"));
+ auto add_btn = new Button(window, _L("Add plugin"), "param_add", 0, 16);
+ add_btn->SetStyle(ButtonStyle::Regular, ButtonType::Parameter);
add_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { on_add_clicked(); });
- row_sizer->Add(display, 1, wxALIGN_CENTER_VERTICAL | wxRIGHT, 4);
- row_sizer->Add(add_btn, 0, wxALIGN_CENTER_VERTICAL);
- m_main_sizer->Add(row_sizer, 0, wxEXPAND);
-
- PluginRow row;
- row.display = display;
- row.add_btn = add_btn;
- row.sizer = row_sizer;
- m_rows.push_back(row);
+ m_main_sizer->Add(add_btn, 0, wxEXPAND | wxBOTTOM, window->FromDIP(SidebarProps::ContentMarginV()));
m_standalone_add_btn = add_btn;
}
void PluginField::add_plugin_row(const wxString& value, bool is_last)
{
- const auto button_size = wxSize(def_width_thinner() * m_em_unit, -1);
auto row_sizer = new wxBoxSizer(wxHORIZONTAL);
- ScalableButton* select_btn = new ScalableButton(window, wxID_ANY, "search", wxEmptyString,
- button_size, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, true, 16);
- wxGetApp().UpdateDarkUI(select_btn);
- select_btn->SetToolTip(_L("Select plugin"));
-
- wxTextCtrl* display = new wxTextCtrl(window, wxID_ANY, value,
- wxDefaultPosition, wxSize(def_width_wider() * m_em_unit, wxDefaultCoord),
- wxTE_READONLY);
- display->SetEditable(false);
- wxGetApp().UpdateDarkUI(display);
+ ComboBox* display = new ComboBox(window, wxID_ANY, value, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY | CB_NO_DROP_ICON);
+ display->SetIcon("edit");
display->SetToolTip(get_tooltip_text(value));
- ScalableButton* remove_btn = nullptr;
- if (!m_opt.readonly) {
- remove_btn = new ScalableButton(window, wxID_ANY, "cross", wxEmptyString,
- button_size, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, true, 16);
- wxGetApp().UpdateDarkUI(remove_btn);
- remove_btn->SetToolTip(_L("Remove plugin"));
- }
+ ScalableButton* remove_btn = new ScalableButton(window, wxID_ANY, "cross", wxEmptyString,
+ wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, true, 16);
+ remove_btn->SetToolTip(_L("Remove plugin"));
- ScalableButton* add_btn = nullptr;
- if (is_last && !m_opt.readonly) {
- add_btn = new ScalableButton(window, wxID_ANY, "param_add", wxEmptyString,
- button_size, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, true, 16);
- wxGetApp().UpdateDarkUI(add_btn);
- add_btn->SetToolTip(_L("Add plugin"));
- add_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { on_add_clicked(); });
- }
+ if (m_opt.readonly)
+ remove_btn->Disable();
const size_t row_index = m_rows.size();
- select_btn->Bind(wxEVT_BUTTON, [this, row_index](wxCommandEvent&) { on_select_clicked(row_index); });
- if (remove_btn)
- remove_btn->Bind(wxEVT_BUTTON, [this, row_index](wxCommandEvent&) { on_remove_clicked(row_index); });
+ display->Bind(wxEVT_LEFT_DOWN, [this, row_index](wxMouseEvent& ) { on_select_clicked(row_index); });
+ remove_btn->Bind(wxEVT_BUTTON, [this, row_index](wxCommandEvent&) { on_remove_clicked(row_index); });
- row_sizer->Add(select_btn, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 4);
- row_sizer->Add(display, 1, wxALIGN_CENTER_VERTICAL | wxRIGHT, 4);
- if (remove_btn)
- row_sizer->Add(remove_btn, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 4);
- if (add_btn)
- row_sizer->Add(add_btn, 0, wxALIGN_CENTER_VERTICAL);
- else if (!m_opt.readonly) {
- // Reserve space equal to the add button so all rows align.
- row_sizer->Add(button_size.GetWidth(), button_size.GetHeight(), 0, wxALIGN_CENTER_VERTICAL);
- }
+ row_sizer->Add(display , 1, wxALIGN_CENTER_VERTICAL);
+ row_sizer->Add(remove_btn, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, window->FromDIP(SidebarProps::ElementSpacing()));
- const int bottom_gap = is_last ? 0 : 4;
- m_main_sizer->Add(row_sizer, 0, wxEXPAND | (bottom_gap > 0 ? wxBOTTOM : 0), bottom_gap);
+ m_main_sizer->Add(row_sizer, 0, wxEXPAND | wxBOTTOM, window->FromDIP(is_last ? SidebarProps::ContentMarginV() : 4));
PluginRow row;
- row.select_btn = select_btn;
row.display = display;
row.remove_btn = remove_btn;
- row.add_btn = add_btn;
row.sizer = row_sizer;
m_rows.push_back(row);
}
@@ -2354,9 +2303,9 @@ void PluginField::on_add_clicked()
m_values.push_back(selected);
m_value = m_values;
- rebuild_ui();
-
- on_change_field();
+ // Defer: don't destroy the clicked button from inside its own handler.
+ if(window)
+ window->CallAfter([this]() {rebuild_ui(); on_change_field();});
}
void PluginField::on_remove_clicked(size_t index)
@@ -2367,8 +2316,9 @@ void PluginField::on_remove_clicked(size_t index)
m_values.erase(m_values.begin() + index);
m_value = m_values;
- rebuild_ui();
- on_change_field();
+ // Defer: don't destroy the clicked button from inside its own handler.
+ if(window)
+ window->CallAfter([this]() {rebuild_ui(); on_change_field();});
}
wxString PluginField::get_row_value(size_t index) const
@@ -2382,7 +2332,7 @@ void PluginField::set_row_value(size_t index, const wxString& value)
{
if (index >= m_rows.size() || !m_rows[index].display)
return;
- m_rows[index].display->ChangeValue(value);
+ m_rows[index].display->SetValue(value);
m_rows[index].display->SetToolTip(get_tooltip_text(value));
}
@@ -2425,14 +2375,10 @@ boost::any& PluginField::get_value()
void PluginField::enable()
{
for (auto& row : m_rows) {
- if (row.select_btn)
- row.select_btn->Enable();
if (row.display)
row.display->Enable();
if (row.remove_btn)
row.remove_btn->Enable();
- if (row.add_btn)
- row.add_btn->Enable();
}
if (m_standalone_add_btn)
m_standalone_add_btn->Enable();
@@ -2441,14 +2387,10 @@ void PluginField::enable()
void PluginField::disable()
{
for (auto& row : m_rows) {
- if (row.select_btn)
- row.select_btn->Disable();
if (row.display)
row.display->Disable();
if (row.remove_btn)
row.remove_btn->Disable();
- if (row.add_btn)
- row.add_btn->Disable();
}
if (m_standalone_add_btn)
m_standalone_add_btn->Disable();
diff --git a/src/slic3r/GUI/Field.hpp b/src/slic3r/GUI/Field.hpp
index 74011983c6..6219921202 100644
--- a/src/slic3r/GUI/Field.hpp
+++ b/src/slic3r/GUI/Field.hpp
@@ -25,6 +25,7 @@
#include "wxExtensions.hpp"
#include "Widgets/SpinInput.hpp"
#include "Widgets/TextInput.hpp"
+#include "Widgets/ComboBox.hpp"
#ifdef __WXMSW__
#define wxMSW true
@@ -532,10 +533,8 @@ public:
private:
struct PluginRow {
- ScalableButton* select_btn { nullptr };
- wxTextCtrl* display { nullptr };
+ ComboBox* display { nullptr };
ScalableButton* remove_btn { nullptr };
- ScalableButton* add_btn { nullptr };
wxBoxSizer* sizer { nullptr };
};
@@ -553,7 +552,7 @@ private:
wxBoxSizer* m_main_sizer { nullptr };
std::vector m_rows;
std::vector m_values;
- ScalableButton* m_standalone_add_btn { nullptr };
+ Button* m_standalone_add_btn { nullptr };
std::function m_selector;
};
diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp
index ed2f23b9ab..0791cd4016 100644
--- a/src/slic3r/GUI/GLCanvas3D.cpp
+++ b/src/slic3r/GUI/GLCanvas3D.cpp
@@ -5053,7 +5053,21 @@ void GLCanvas3D::do_move(const std::string& snapshot_type)
}
//BBS: notify instance updates to part plater list
- m_selection.notify_instance_update(-1, 0);
+ // Only what moved: the selected instances, or every instance of an object one of whose
+ // parts moved. Notifying a plate about an instance that stayed put invalidates its slice
+ // result, and notifying instance 0 alone left a moved copy unregistered on its new plate.
+ {
+ std::set> notified;
+ for (unsigned int i : m_selection.get_volume_idxs()) {
+ const GLVolume* v = m_volumes.volumes[i];
+ const int object_idx = v->object_idx();
+ if (object_idx < 0 || object_idx >= static_cast(m_model->objects.size()))
+ continue;
+ const std::pair key(object_idx, selection_mode == Selection::Volume ? -1 : v->instance_idx());
+ if (notified.insert(key).second)
+ m_selection.notify_instance_update(key.first, key.second);
+ }
+ }
// Fixes sinking/flying instances (snaps object to buildplate)
for (const std::pair& i : done) {
diff --git a/src/slic3r/GUI/OptionsGroup.cpp b/src/slic3r/GUI/OptionsGroup.cpp
index af8936a75a..9930e6d872 100644
--- a/src/slic3r/GUI/OptionsGroup.cpp
+++ b/src/slic3r/GUI/OptionsGroup.cpp
@@ -698,10 +698,15 @@ std::string OptionsGroup::pick_plugin(const ConfigOptionDef& opt)
Slic3r::PluginManager& manager = Slic3r::PluginManager::instance();
const Slic3r::PluginCapabilityType plugin_type = Slic3r::plugin_capability_type_from_string(opt.plugin_type);
if (plugin_type == Slic3r::PluginCapabilityType::Unknown) {
- const std::string message = opt.plugin_type.empty()
- ? "This setting does not specify a plugin capability type."
- : "This setting specifies an unrecognized plugin capability type: '" + opt.plugin_type + "'.";
- wxMessageBox(from_u8(message), _L("Plugin Selection"), wxOK | wxICON_WARNING, m_parent);
+ MessageDialog dlg(m_parent,
+ opt.plugin_type.empty() ? _L("This setting does not specify a plugin capability type.")
+ : _L("This setting specifies an unrecognized plugin capability type: ") + "'" + opt.plugin_type + "'.",
+ _L("Plugin Selection"),
+ wxOK | wxICON_WARNING
+ );
+ dlg.CenterOnParent();
+ dlg.ShowModal();
+
return {};
}
@@ -714,7 +719,13 @@ std::string OptionsGroup::pick_plugin(const ConfigOptionDef& opt)
});
if (caps.empty()) {
- wxMessageBox(_L("No plugins capabilities available for this type.\nEnable or install some to use."), _L("Plugin Selection"), wxOK | wxICON_INFORMATION, m_parent);
+ MessageDialog dlg(m_parent,
+ _L("No plugins capabilities available for this type.\nEnable or install some to use."),
+ _L("Plugin Selection"),
+ wxOK | wxICON_INFORMATION
+ );
+ dlg.CenterOnParent();
+ dlg.ShowModal();
return {};
}
diff --git a/src/slic3r/GUI/PartPlate.cpp b/src/slic3r/GUI/PartPlate.cpp
index 9826498fbd..d38ab5e0ac 100644
--- a/src/slic3r/GUI/PartPlate.cpp
+++ b/src/slic3r/GUI/PartPlate.cpp
@@ -1917,7 +1917,7 @@ std::vector PartPlate::get_extruders_without_support(bool conside_custom_gc
const DynamicPrintConfig& glb_config = wxGetApp().preset_bundle->prints.get_edited_preset().config;
for (int obj_idx = 0; obj_idx < m_model->objects.size(); obj_idx++) {
- if (!contain_instance_totally(obj_idx, 0))
+ if (!contain_any_instance_totally(obj_idx))
continue;
ModelObject* mo = m_model->objects[obj_idx];
@@ -2088,7 +2088,7 @@ bool PartPlate::check_single_extruder_mixed_filament_risk(const DynamicPrintConf
"which may significantly increase waste and the risk of nozzle / waste-chute clogging.");
for (int obj_idx = 0; obj_idx < (int)m_model->objects.size(); ++obj_idx) {
- if (!contain_instance_totally(obj_idx, 0))
+ if (!contain_any_instance_totally(obj_idx))
continue;
ModelObject *mo = m_model->objects[obj_idx];
int obj_ext = mo->config.has("extruder") ? mo->config.extruder() : 1;
@@ -2307,7 +2307,7 @@ bool PartPlate::check_compatible_of_nozzle_and_filament(const DynamicPrintConfig
return wipe_tower_size;
for (int obj_idx = 0; obj_idx < m_model->objects.size(); obj_idx++) {
- if (!use_global_objects && !contain_instance_totally(obj_idx, 0))
+ if (!use_global_objects && !contain_any_instance_totally(obj_idx))
continue;
BoundingBoxf3 bbox = m_model->objects[obj_idx]->bounding_box();
diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp
index 91ff532d33..555cd7a9ad 100644
--- a/src/slic3r/GUI/Plater.cpp
+++ b/src/slic3r/GUI/Plater.cpp
@@ -17826,6 +17826,10 @@ void Plater::increase_instances(size_t num)
model_object->add_instance(offset_vec, model_instance->get_scaling_factor(), model_instance->get_rotation(), model_instance->get_mirror());
// p->print.get_object(obj_idx)->add_copy(Slic3r::to_2d(offset_vec));
}
+ // Register the copies with the plate they land on before the scene reloads: the plate's
+ // filament list and wipe tower preview are read from that registry.
+ for (size_t i = model_object->instances.size() - num; i < model_object->instances.size(); ++i)
+ p->partplate_list.notify_instance_update(obj_idx, static_cast(i));
#ifdef SUPPORT_AUTO_CENTER
if (p->get_config("autocenter") == "true")
@@ -17856,8 +17860,10 @@ void Plater::decrease_instances(size_t num)
ModelObject* model_object = p->model.objects[obj_idx];
if (model_object->instances.size() > num) {
- for (size_t i = 0; i < num; ++ i)
+ for (size_t i = 0; i < num; ++ i) {
+ p->partplate_list.notify_instance_removed(obj_idx, static_cast(model_object->instances.size()) - 1);
model_object->delete_last_instance();
+ }
p->update();
// Delete object from Sidebar list. Do it after update, so that the GLScene selection is updated with the modified model.
sidebar().obj_list()->decrease_object_instances(obj_idx, num);
diff --git a/src/slic3r/GUI/PluginPickerDialog.cpp b/src/slic3r/GUI/PluginPickerDialog.cpp
index 194dbaaf07..5109b3b483 100644
--- a/src/slic3r/GUI/PluginPickerDialog.cpp
+++ b/src/slic3r/GUI/PluginPickerDialog.cpp
@@ -9,12 +9,16 @@
#include "GUI.hpp"
#include "I18N.hpp"
+#include "GUI_App.hpp"
+
+#include "Widgets/DialogButtons.hpp"
+
namespace Slic3r { namespace GUI {
PluginPickerDialog::PluginPickerDialog(wxWindow* parent,
const wxString& plugin_type_label,
const std::vector& plugins)
- : wxDialog(parent, wxID_ANY, wxString::Format(_L("Select %s Plugin"), plugin_type_label))
+ : DPIDialog(parent, wxID_ANY, wxString::Format(_L("Select %s Plugin"), plugin_type_label))
, m_plugins(plugins)
{
build_ui(plugin_type_label);
@@ -24,7 +28,7 @@ PluginPickerDialog::PluginPickerDialog(wxWindow* parent,
PluginPickerDialog::PluginPickerDialog(wxWindow* parent,
const wxString& plugin_type_label,
std::vector capabilities)
- : wxDialog(parent, wxID_ANY, wxString::Format(_L("Select %s Plugin"), plugin_type_label))
+ : DPIDialog(parent, wxID_ANY, wxString::Format(_L("Select %s Plugin"), plugin_type_label))
, m_capabilities(std::move(capabilities))
{
build_capability_ui(plugin_type_label);
@@ -33,12 +37,18 @@ PluginPickerDialog::PluginPickerDialog(wxWindow* parent,
void PluginPickerDialog::build_ui(const wxString& plugin_type_label)
{
+ SetBackgroundColour(*wxWHITE);
+
const bool has_plugins = !m_plugins.empty();
auto* top_sizer = new wxBoxSizer(wxVERTICAL);
auto* info_text = new wxStaticText(this, wxID_ANY,
wxString::Format(_L("Choose a %s plugin from the list below."), plugin_type_label));
- top_sizer->Add(info_text, 0, wxALL | wxEXPAND, 10);
+ info_text->SetFont(Label::Body_14);
+ info_text->SetForegroundColour(wxColour("#363636"));
+ top_sizer->Add(info_text, 0, wxALL | wxEXPAND, FromDIP(10));
+
+ top_sizer->AddSpacer(FromDIP(5));
wxArrayString choices;
choices.reserve(m_plugins.size());
@@ -49,84 +59,103 @@ void PluginPickerDialog::build_ui(const wxString& plugin_type_label)
choices.Add(label);
}
- m_choice = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, choices);
+ m_choice = new ComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
+ for (const wxString &opt : choices) { m_choice->Append(opt); }
+
if (has_plugins) {
m_choice->SetSelection(0);
- m_choice->Bind(wxEVT_CHOICE, [this](wxCommandEvent& evt) {
+ m_choice->Bind(wxEVT_COMBOBOX, [this](wxCommandEvent& evt) {
update_description(evt.GetSelection());
});
} else {
m_choice->Enable(false);
}
- top_sizer->Add(m_choice, 0, wxLEFT | wxRIGHT | wxEXPAND, 10);
+ top_sizer->Add(m_choice, 0, wxLEFT | wxRIGHT | wxEXPAND, FromDIP(10));
m_description = new wxStaticText(this, wxID_ANY, wxEmptyString);
+ m_description->SetFont(Label::Body_14);
+ m_description->SetForegroundColour(wxColour("#363636"));
m_description->Wrap(400);
- top_sizer->Add(m_description, 0, wxALL | wxEXPAND, 10);
+ top_sizer->Add(m_description, 0, wxALL | wxEXPAND, FromDIP(10));
if (has_plugins)
update_description(0);
else
m_description->SetLabel(_L("No plugins found for this type."));
- auto* button_sizer = new wxStdDialogButtonSizer();
- auto* ok_button = new wxButton(this, wxID_OK);
- ok_button->Enable(has_plugins);
- button_sizer->AddButton(ok_button);
- button_sizer->AddButton(new wxButton(this, wxID_CANCEL));
- button_sizer->Realize();
+ auto dlg_btns = new DialogButtons(this, {"OK", "Cancel"});
- top_sizer->Add(button_sizer, 0, wxALL | wxALIGN_RIGHT, 10);
+ dlg_btns->GetOK()->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) { EndModal(wxID_OK); });
+ dlg_btns->GetOK()->Enable(has_plugins);
+
+ dlg_btns->GetCANCEL()->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) { EndModal(wxID_CANCEL); });
+
+ top_sizer->Add(dlg_btns, 0, wxEXPAND);
SetSizerAndFit(top_sizer);
+
+ wxGetApp().UpdateDlgDarkUI(this);
}
void PluginPickerDialog::build_capability_ui(const wxString& plugin_type_label)
{
+ SetBackgroundColour(*wxWHITE);
+
const bool has_capabilities = !m_capabilities.empty();
auto* top_sizer = new wxBoxSizer(wxVERTICAL);
auto* info_text = new wxStaticText(this, wxID_ANY,
wxString::Format(_L("Choose a %s plugin from the list below."), plugin_type_label));
- top_sizer->Add(info_text, 0, wxALL | wxEXPAND, 10);
+ info_text->SetFont(Label::Body_14);
+ info_text->SetForegroundColour(wxColour("#363636"));
+
+ top_sizer->Add(info_text, 0, wxALL | wxEXPAND, FromDIP(10));
+
+ top_sizer->AddSpacer(FromDIP(5));
wxArrayString choices;
choices.reserve(m_capabilities.size());
for (const auto& cap : m_capabilities)
choices.Add(cap.label);
- m_choice = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, choices);
+ m_choice = new ComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
+ for (const wxString &opt : choices) { m_choice->Append(opt); }
+
if (has_capabilities) {
m_choice->SetSelection(0);
- m_choice->Bind(wxEVT_CHOICE, [this](wxCommandEvent& evt) {
+ m_choice->Bind(wxEVT_COMBOBOX, [this](wxCommandEvent& evt) {
update_capability_description(evt.GetSelection());
});
} else {
m_choice->Enable(false);
}
- top_sizer->Add(m_choice, 0, wxLEFT | wxRIGHT | wxEXPAND, 10);
+ top_sizer->Add(m_choice, 0, wxLEFT | wxRIGHT | wxEXPAND, FromDIP(10));
m_description = new wxStaticText(this, wxID_ANY, wxEmptyString);
+ m_description->SetFont(Label::Body_14);
+ m_description->SetForegroundColour(wxColour("#363636"));
m_description->Wrap(400);
- top_sizer->Add(m_description, 0, wxALL | wxEXPAND, 10);
+ top_sizer->Add(m_description, 0, wxALL | wxEXPAND, FromDIP(10));
if (has_capabilities)
update_capability_description(0);
else
m_description->SetLabel(_L("No plugins found for this type."));
- auto* button_sizer = new wxStdDialogButtonSizer();
- auto* ok_button = new wxButton(this, wxID_OK);
- ok_button->Enable(has_capabilities);
- button_sizer->AddButton(ok_button);
- button_sizer->AddButton(new wxButton(this, wxID_CANCEL));
- button_sizer->Realize();
+ auto dlg_btns = new DialogButtons(this, {"OK", "Cancel"});
- top_sizer->Add(button_sizer, 0, wxALL | wxALIGN_RIGHT, 10);
+ dlg_btns->GetOK()->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) { EndModal(wxID_OK); });
+ dlg_btns->GetOK()->Enable(has_capabilities);
+
+ dlg_btns->GetCANCEL()->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) { EndModal(wxID_CANCEL); });
+
+ top_sizer->Add(dlg_btns, 0, wxEXPAND);
SetSizerAndFit(top_sizer);
+
+ wxGetApp().UpdateDlgDarkUI(this);
}
PluginPickerDialog::CapabilityEntry PluginPickerDialog::selected_capability() const
@@ -185,4 +214,6 @@ void PluginPickerDialog::update_description(int selection)
Layout();
}
+void PluginPickerDialog::on_dpi_changed(const wxRect &suggested_rect) {}
+
}} // namespace Slic3r::GUI
diff --git a/src/slic3r/GUI/PluginPickerDialog.hpp b/src/slic3r/GUI/PluginPickerDialog.hpp
index 95f00689c3..6ae4163c5f 100644
--- a/src/slic3r/GUI/PluginPickerDialog.hpp
+++ b/src/slic3r/GUI/PluginPickerDialog.hpp
@@ -11,9 +11,12 @@
#include "slic3r/plugin/PluginManager.hpp"
+#include "GUI_Utils.hpp"
+#include "Widgets/ComboBox.hpp"
+
namespace Slic3r { namespace GUI {
-class PluginPickerDialog : public wxDialog
+class PluginPickerDialog : public DPIDialog
{
public:
// Entry for capability-level selection (plugin_type non-empty path).
@@ -40,13 +43,15 @@ public:
// Returns the {plugin_key, name} of the selected capability (capability path).
CapabilityEntry selected_capability() const;
+ void on_dpi_changed(const wxRect &suggested_rect) override;
+
private:
void build_ui(const wxString& plugin_type_label);
void build_capability_ui(const wxString& plugin_type_label);
void update_description(int selection);
void update_capability_description(int selection);
- wxChoice* m_choice { nullptr };
+ ComboBox* m_choice { nullptr };
wxStaticText* m_description { nullptr };
std::vector m_plugins;
std::vector m_capabilities;
diff --git a/src/slic3r/GUI/PluginsDialog.hpp b/src/slic3r/GUI/PluginsDialog.hpp
index 0aee7b2734..c85e57040c 100644
--- a/src/slic3r/GUI/PluginsDialog.hpp
+++ b/src/slic3r/GUI/PluginsDialog.hpp
@@ -2,6 +2,7 @@
#define slic3r_PluginsDialog_hpp_
#include "Widgets/WebViewHostDialog.hpp"
+#include "Widgets/ProgressDialog.hpp"
#include "PluginSource.hpp"
#include "PluginStatus.hpp"
#include "PluginSort.hpp"
@@ -287,7 +288,7 @@ private:
const wxString& title,
const wxString& message,
int maximum = 100,
- int style = wxPD_APP_MODAL | wxPD_AUTO_HIDE,
+ int style = wxPD_APP_MODAL | wxPD_AUTO_HIDE, // | wxPD_CAN_ABORT for cancel button
bool finish_after_dialog_destroyed = false)
{
detail::run_off_thread_with_progress(std::forward(run), std::forward(on_finish), this, title, message, maximum, style,
diff --git a/src/slic3r/GUI/Widgets/ProgressDialog.cpp b/src/slic3r/GUI/Widgets/ProgressDialog.cpp
index 53842ecaea..c16f3bcf1f 100644
--- a/src/slic3r/GUI/Widgets/ProgressDialog.cpp
+++ b/src/slic3r/GUI/Widgets/ProgressDialog.cpp
@@ -178,7 +178,7 @@ bool ProgressDialog::Create(const wxString &title, const wxString &message, int
wxBoxSizer *sizer_1line = new wxBoxSizer(wxHORIZONTAL);
m_msg = new wxStaticText(m_panel_1line, wxID_ANY, wxEmptyString, wxDefaultPosition, PROGRESSDIALOG_SIMPLEBOOK_SIZE, 0);
m_msg->Wrap(-1);
- m_msg->SetFont(::Label::Body_13);
+ m_msg->SetFont(::Label::Body_14);
m_msg->SetForegroundColour(PROGRESSDIALOG_GREY_700);
sizer_1line->Add(m_msg, 0, wxALIGN_CENTER, 0);
m_panel_1line->SetSizer(sizer_1line);
@@ -188,7 +188,7 @@ bool ProgressDialog::Create(const wxString &title, const wxString &message, int
wxBoxSizer *sizer_2line = new wxBoxSizer(wxVERTICAL);
m_msg_2line = new wxStaticText(m_panel_2line, wxID_ANY, wxEmptyString, wxDefaultPosition, PROGRESSDIALOG_SIMPLEBOOK_SIZE, 0);
m_msg_2line->Wrap(PROGRESSDIALOG_SIMPLEBOOK_SIZE.x);
- m_msg_2line->SetFont(::Label::Body_13);
+ m_msg_2line->SetFont(::Label::Body_14);
m_msg_2line->SetForegroundColour(PROGRESSDIALOG_GREY_700);
m_msg_2line->SetMaxSize(wxSize(PROGRESSDIALOG_SIMPLEBOOK_SIZE.x, -1));
sizer_2line->Add(m_msg_2line, 1, wxALL, 0);
@@ -204,7 +204,7 @@ bool ProgressDialog::Create(const wxString &title, const wxString &message, int
m_msg = new wxStaticText(m_msg_scrolledWindow, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(PROGRESSDIALOG_SIMPLEBOOK_SIZE.x, -1), 0);
m_msg->Wrap(PROGRESSDIALOG_SIMPLEBOOK_SIZE.x);
- m_msg->SetFont(::Label::Body_13);
+ m_msg->SetFont(::Label::Body_14);
m_msg->SetForegroundColour(PROGRESSDIALOG_GREY_700);
m_msg_sizer->Add(m_msg, 0, wxEXPAND | wxALL, 0);
@@ -228,6 +228,9 @@ bool ProgressDialog::Create(const wxString &title, const wxString &message, int
if (!HasPDFlag(wxPD_NO_PROGRESS)) {
m_gauge = new wxGauge(this, wxID_ANY, maximum, wxDefaultPosition, PROGRESSDIALOG_GAUGE_SIZE, gauge_style);
m_gauge->SetValue(0);
+ m_gauge->SetForegroundColour(wxColour("#009688"));
+ m_gauge->SetBackgroundColour(wxColour("#D9D9D9"));
+ wxGetApp().UpdateDarkUI(m_gauge);
m_sizer_main->Add(m_gauge, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(28));
}
diff --git a/src/slic3r/GUI/Widgets/ProgressDialog.hpp b/src/slic3r/GUI/Widgets/ProgressDialog.hpp
index bb770298a9..9ebf31b194 100644
--- a/src/slic3r/GUI/Widgets/ProgressDialog.hpp
+++ b/src/slic3r/GUI/Widgets/ProgressDialog.hpp
@@ -18,7 +18,7 @@ class WXDLLIMPEXP_FWD_CORE wxWindowDisabler;
#define PROGRESSDIALOG_GAUGE_SIZE wxSize(FromDIP(320), FromDIP(6))
#define PROGRESSDIALOG_CANCEL_BUTTON_SIZE wxSize(FromDIP(60), FromDIP(24))
#define PROGRESSDIALOG_DEF_BK wxColour(255,255,255)
-#define PROGRESSDIALOG_GREY_700 wxColour(107,107,107)
+#define PROGRESSDIALOG_GREY_700 wxColour(54,54,54) // #363636 label color
#define wxPD_NO_PROGRESS 0x0100