mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-21 21:58:03 -06:00
DoubleSlider with MM-printer preset: When Object has "Paint-on segmentation", DoubleSlider has same behavior as with modifiers
+ MSW specific: Use BitmapComboBox instead of wxBitmapComboBox to DarkMode for extruder selectors
This commit is contained in:
parent
ef30cc8690
commit
1f131d130f
6 changed files with 25 additions and 2 deletions
|
@ -11,6 +11,7 @@
|
||||||
#include "GUI_Utils.hpp"
|
#include "GUI_Utils.hpp"
|
||||||
#include "MsgDialog.hpp"
|
#include "MsgDialog.hpp"
|
||||||
#include "Tab.hpp"
|
#include "Tab.hpp"
|
||||||
|
#include "GUI_ObjectList.hpp"
|
||||||
|
|
||||||
#include <wx/button.h>
|
#include <wx/button.h>
|
||||||
#include <wx/dialog.h>
|
#include <wx/dialog.h>
|
||||||
|
@ -1588,7 +1589,7 @@ void Control::append_change_extruder_menu_item(wxMenu* menu, bool switch_current
|
||||||
|
|
||||||
append_submenu(menu, change_extruder_menu, wxID_ANY, change_extruder_menu_name, _L("Use another extruder"),
|
append_submenu(menu, change_extruder_menu, wxID_ANY, change_extruder_menu_name, _L("Use another extruder"),
|
||||||
active_extruders[1] > 0 ? "edit_uni" : "change_extruder",
|
active_extruders[1] > 0 ? "edit_uni" : "change_extruder",
|
||||||
[this]() {return m_mode == MultiAsSingle; }, GUI::wxGetApp().plater());
|
[this]() {return m_mode == MultiAsSingle && !GUI::wxGetApp().obj_list()->has_paint_on_segmentation(); }, GUI::wxGetApp().plater());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#include "wxExtensions.hpp"
|
#include "wxExtensions.hpp"
|
||||||
#include "GUI.hpp"
|
#include "GUI.hpp"
|
||||||
#include "I18N.hpp"
|
#include "I18N.hpp"
|
||||||
|
#include "BitmapComboBox.hpp"
|
||||||
|
|
||||||
#include <wx/dc.h>
|
#include <wx/dc.h>
|
||||||
#ifdef wxHAS_GENERIC_DATAVIEWCTRL
|
#ifdef wxHAS_GENERIC_DATAVIEWCTRL
|
||||||
|
@ -296,7 +297,11 @@ wxWindow* BitmapChoiceRenderer::CreateEditorCtrl(wxWindow* parent, wxRect labelR
|
||||||
DataViewBitmapText data;
|
DataViewBitmapText data;
|
||||||
data << value;
|
data << value;
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
Slic3r::GUI::BitmapComboBox* c_editor = new Slic3r::GUI::BitmapComboBox(parent, wxID_ANY, wxEmptyString,
|
||||||
|
#else
|
||||||
auto c_editor = new wxBitmapComboBox(parent, wxID_ANY, wxEmptyString,
|
auto c_editor = new wxBitmapComboBox(parent, wxID_ANY, wxEmptyString,
|
||||||
|
#endif
|
||||||
labelRect.GetTopLeft(), wxSize(labelRect.GetWidth(), -1),
|
labelRect.GetTopLeft(), wxSize(labelRect.GetWidth(), -1),
|
||||||
0, nullptr , wxCB_READONLY);
|
0, nullptr , wxCB_READONLY);
|
||||||
|
|
||||||
|
|
|
@ -4248,5 +4248,10 @@ ModelObject* ObjectList::object(const int obj_idx) const
|
||||||
return (*m_objects)[obj_idx];
|
return (*m_objects)[obj_idx];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ObjectList::has_paint_on_segmentation()
|
||||||
|
{
|
||||||
|
return m_objects_model->HasInfoItem(InfoItemType::MmuSegmentation);
|
||||||
|
}
|
||||||
|
|
||||||
} //namespace GUI
|
} //namespace GUI
|
||||||
} //namespace Slic3r
|
} //namespace Slic3r
|
||||||
|
|
|
@ -379,6 +379,7 @@ public:
|
||||||
void set_extruder_for_selected_items(const int extruder) const ;
|
void set_extruder_for_selected_items(const int extruder) const ;
|
||||||
wxDataViewItemArray reorder_volumes_and_get_selection(int obj_idx, std::function<bool(const ModelVolume*)> add_to_selection = nullptr);
|
wxDataViewItemArray reorder_volumes_and_get_selection(int obj_idx, std::function<bool(const ModelVolume*)> add_to_selection = nullptr);
|
||||||
void apply_volumes_order();
|
void apply_volumes_order();
|
||||||
|
bool has_paint_on_segmentation();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifdef __WXOSX__
|
#ifdef __WXOSX__
|
||||||
|
|
|
@ -1494,6 +1494,16 @@ void ObjectDataViewModel::GetAllChildren(const wxDataViewItem &parent, wxDataVie
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ObjectDataViewModel::HasInfoItem(InfoItemType type) const
|
||||||
|
{
|
||||||
|
for (ObjectDataViewModelNode* obj_node : m_objects)
|
||||||
|
for (size_t j = 0; j < obj_node->GetChildCount(); j++)
|
||||||
|
if (obj_node->GetNthChild(j)->GetInfoItemType() == type)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
ItemType ObjectDataViewModel::GetItemType(const wxDataViewItem &item) const
|
ItemType ObjectDataViewModel::GetItemType(const wxDataViewItem &item) const
|
||||||
{
|
{
|
||||||
if (!item.IsOk())
|
if (!item.IsOk())
|
||||||
|
|
|
@ -345,6 +345,7 @@ public:
|
||||||
// Is the container just a header or an item with all columns
|
// Is the container just a header or an item with all columns
|
||||||
// In our case it is an item with all columns
|
// In our case it is an item with all columns
|
||||||
bool HasContainerColumns(const wxDataViewItem& WXUNUSED(item)) const override { return true; }
|
bool HasContainerColumns(const wxDataViewItem& WXUNUSED(item)) const override { return true; }
|
||||||
|
bool HasInfoItem(InfoItemType type) const;
|
||||||
|
|
||||||
ItemType GetItemType(const wxDataViewItem &item) const;
|
ItemType GetItemType(const wxDataViewItem &item) const;
|
||||||
InfoItemType GetInfoItemType(const wxDataViewItem &item) const;
|
InfoItemType GetInfoItemType(const wxDataViewItem &item) const;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue