diff options
author | YuSanka <yusanka@gmail.com> | 2020-01-27 18:30:09 +0300 |
---|---|---|
committer | YuSanka <yusanka@gmail.com> | 2020-01-27 18:30:09 +0300 |
commit | 635def1648f8435705af5826e570f35bbb9186c5 (patch) | |
tree | cc754e8f997a128e7705ea1bc8aa29df763cc8f4 /src/slic3r/GUI/wxExtensions.hpp | |
parent | cf7d7bd40f5a93c41e00474252d72bccbdf48872 (diff) |
Fixed an icon scaling in the ObjectList under OSX
Diffstat (limited to 'src/slic3r/GUI/wxExtensions.hpp')
-rw-r--r-- | src/slic3r/GUI/wxExtensions.hpp | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/slic3r/GUI/wxExtensions.hpp b/src/slic3r/GUI/wxExtensions.hpp index a6f8862ac..1ee42dc29 100644 --- a/src/slic3r/GUI/wxExtensions.hpp +++ b/src/slic3r/GUI/wxExtensions.hpp @@ -228,13 +228,18 @@ class ObjectDataViewModelNode std::string m_action_icon_name = ""; Slic3r::ModelVolumeType m_volume_type; + // pointer to control (is needed to create scaled bitmaps) + wxDataViewCtrl* m_ctrl{ nullptr }; + public: - ObjectDataViewModelNode(const wxString &name, - const wxString& extruder): + ObjectDataViewModelNode(const wxString& name, + const wxString& extruder, + wxDataViewCtrl* ctrl): m_parent(NULL), m_name(name), m_type(itObject), - m_extruder(extruder) + m_extruder(extruder), + m_ctrl(ctrl) { set_action_and_extruder_icons(); init_container(); @@ -249,7 +254,8 @@ public: m_name (sub_obj_name), m_type (itVolume), m_idx (idx), - m_extruder (extruder) + m_extruder (extruder), + m_ctrl (parent->m_ctrl) { m_bmp = bmp; set_action_and_extruder_icons(); @@ -538,7 +544,8 @@ class BitmapTextRenderer : public wxDataViewCustomRenderer #endif //ENABLE_NONCUSTOM_DATA_VIEW_RENDERING { public: - BitmapTextRenderer(wxDataViewCellMode mode = + BitmapTextRenderer( wxWindow* parent, + wxDataViewCellMode mode = #ifdef __WXOSX__ wxDATAVIEW_CELL_INERT #else @@ -549,7 +556,10 @@ public: #if ENABLE_NONCUSTOM_DATA_VIEW_RENDERING ); #else - ) : wxDataViewCustomRenderer(wxT("DataViewBitmapText"), mode, align) {} + ) : + wxDataViewCustomRenderer(wxT("DataViewBitmapText"), mode, align), + m_parent(parent) + {} #endif //ENABLE_NONCUSTOM_DATA_VIEW_RENDERING bool SetValue(const wxVariant &value); @@ -577,8 +587,9 @@ public: bool WasCanceled() const { return m_was_unusable_symbol; } private: - DataViewBitmapText m_value; - bool m_was_unusable_symbol {false}; + DataViewBitmapText m_value; + bool m_was_unusable_symbol {false}; + wxWindow* m_parent {nullptr}; }; |