Code refactoring:

- PresetCombpBoxes are extracted to the separate file.
- All preset icons are moved to the PresetComboBox from Preset and PresetBundle
- First "steps" to add physical printers to the printers list on the sidebar.
This commit is contained in:
YuSanka 2020-06-16 12:57:49 +02:00
parent f23a275fbb
commit 43e6e4f18c
15 changed files with 1304 additions and 1041 deletions

View file

@ -95,37 +95,6 @@ public:
void OnListBoxSelection(wxCommandEvent& evt);
};
namespace Slic3r {
namespace GUI {
// *** PresetBitmapComboBox ***
// BitmapComboBox used to presets list on Sidebar and Tabs
class PresetBitmapComboBox: public wxBitmapComboBox
{
public:
PresetBitmapComboBox(wxWindow* parent, const wxSize& size = wxDefaultSize);
~PresetBitmapComboBox() {}
#ifdef __APPLE__
protected:
/* For PresetBitmapComboBox we use bitmaps that are created from images that are already scaled appropriately for Retina
* (Contrary to the intuition, the `scale` argument for Bitmap's constructor doesn't mean
* "please scale this to such and such" but rather
* "the wxImage is already sized for backing scale such and such". )
* Unfortunately, the constructor changes the size of wxBitmap too.
* Thus We need to use unscaled size value for bitmaps that we use
* to avoid scaled size of control items.
* For this purpose control drawing methods and
* control size calculation methods (virtual) are overridden.
**/
virtual bool OnAddBitmap(const wxBitmap& bitmap) override;
virtual void OnDrawItem(wxDC& dc, const wxRect& rect, int item, int flags) const override;
#endif
};
}
}
// *** wxDataViewTreeCtrlComboBox ***