mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-22 14:13:57 -06:00
DarkMode for MSW (#6632)
* MSW specific: Dark Mode: First implementation * Use menu instead of NoteBook * Implemented MessageDialog + Fixed DarkMode for all dialogs and ColorPicker * MSW DarkMode: Added missed updates for the switching between modes * MSW DarkMode: Updated all existed context menus after switching of the mode + Added markers for the menu item witch is related to the selected tab * Used wxFrame instead of wxDialog for SettingsDialog (this change allow us to use menu bar in SettingsDialog) + fix for #6548 - Prusa Slicer 2.3.1 not activating non-modal settings window if settings window is minimized * Implemented "Always use Dark mode colors" preference option * Fixes for non_MSW build * Next fixes for non-MSW builds * Preferences: Fixed selection of the Settings Layout for non-MSW platforms + Updated DarkMode for colorpickers * Windows DarkMode next fixes * MSWDarkMode: Suppress to use system color to the PrusaSlicer Select "Preferences -> Use Dark color mode (experimental)" to allow dark mode for the application * Fixed MSW build * MSWDarkMode: Upadteed color mode for ExtruderSequenceDialog and for dialogs related to the DoubleSlider * Implemented Auto recreation of the PrusaSlicer when color mode is changed. * Preferences: Added option "Set settings tabs as menu items (experimental)"
This commit is contained in:
parent
65f440c2ba
commit
fd071421cb
66 changed files with 2011 additions and 443 deletions
62
src/slic3r/GUI/BitmapComboBox.hpp
Normal file
62
src/slic3r/GUI/BitmapComboBox.hpp
Normal file
|
@ -0,0 +1,62 @@
|
|||
#ifndef slic3r_BitmapComboBox_hpp_
|
||||
#define slic3r_BitmapComboBox_hpp_
|
||||
|
||||
#include <wx/bmpcbox.h>
|
||||
#include <wx/gdicmn.h>
|
||||
|
||||
#include "GUI_Utils.hpp"
|
||||
|
||||
// ---------------------------------
|
||||
// *** BitmapComboBox ***
|
||||
// ---------------------------------
|
||||
namespace Slic3r {
|
||||
namespace GUI {
|
||||
|
||||
// BitmapComboBox used to presets list on Sidebar and Tabs
|
||||
class BitmapComboBox : public wxBitmapComboBox
|
||||
{
|
||||
public:
|
||||
BitmapComboBox(wxWindow* parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int n = 0,
|
||||
const wxString choices[] = NULL,
|
||||
long style = 0);
|
||||
~BitmapComboBox();
|
||||
|
||||
#ifdef _WIN32
|
||||
int Append(const wxString& item);
|
||||
#endif
|
||||
int Append(const wxString& item, const wxBitmap& bitmap)
|
||||
{
|
||||
return wxBitmapComboBox::Append(item, bitmap);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
#ifdef __APPLE__
|
||||
/* For PresetComboBox 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.
|
||||
**/
|
||||
bool OnAddBitmap(const wxBitmap& bitmap) override;
|
||||
void OnDrawItem(wxDC& dc, const wxRect& rect, int item, int flags) const override;
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
bool MSWOnDraw(WXDRAWITEMSTRUCT* item) override;
|
||||
void DrawBackground_(wxDC& dc, const wxRect& rect, int WXUNUSED(item), int flags) const;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
}}
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue