Revert to WxWidgets 3.1.5 (#3249)

* revert to WxWidgets 3.1.5

* update nanosvg unicode path
This commit is contained in:
SoftFever 2023-12-23 17:44:09 +08:00 committed by GitHub
parent cc23ec6626
commit 374f78c768
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
95 changed files with 6841 additions and 1618 deletions

View file

@ -18,17 +18,14 @@
#include "Widgets/PopupWindow.hpp"
#ifndef __linux__
void sys_color_changed_menu(wxMenu* menu);
#else
inline void sys_color_changed_menu(wxMenu* /* menu */) {}
#endif // no __linux__
[[deprecated("Function renamed to sys_color_changed_menu. This function now redirects to sys_color_changed_menu")]]
inline void msw_rescale_menu(wxMenu* menu) { sys_color_changed_menu(menu); }
#ifdef __WXMSW__
void msw_rescale_menu(wxMenu* menu);
#else /* __WXMSW__ */
inline void msw_rescale_menu(wxMenu* /* menu */) {}
#endif /* __WXMSW__ */
wxMenuItem* append_menu_item(wxMenu* menu, int id, const wxString& string, const wxString& description,
std::function<void(wxCommandEvent& event)> cb, wxBitmapBundle* icon, wxEvtHandler* event_handler = nullptr,
std::function<void(wxCommandEvent& event)> cb, const wxBitmap& icon, wxEvtHandler* event_handler = nullptr,
std::function<bool()> const cb_condition = []() { return true;}, wxWindow* parent = nullptr, int insert_pos = wxNOT_FOUND);
wxMenuItem* append_menu_item(wxMenu* menu, int id, const wxString& string, const wxString& description,
std::function<void(wxCommandEvent& event)> cb, const std::string& icon = "", wxEvtHandler* event_handler = nullptr,
@ -55,9 +52,7 @@ void msw_buttons_rescale(wxDialog* dlg, const int em_unit, const std::vector<
int em_unit(wxWindow* win);
int mode_icon_px_size();
wxBitmapBundle* get_bmp_bundle(const std::string& bmp_name, int width = 16, int height = -1);
wxBitmapBundle* get_empty_bmp_bundle(int width, int height);
wxBitmapBundle* get_solid_bmp_bundle(int width, int height, const std::string& color);
wxBitmap create_menu_bitmap(const std::string& bmp_name);
// BBS: support resize by fill border
#if 1
@ -71,8 +66,8 @@ wxBitmap create_scaled_bitmap(const std::string& bmp_name, wxWindow *win = nullp
#endif
wxBitmap* get_default_extruder_color_icon(bool thin_icon = false);
std::vector<wxBitmapBundle *> get_extruder_color_icons(bool thin_icon = false);
wxBitmapBundle * get_extruder_color_icon(std::string color, std::string label, int icon_width, int icon_height);
std::vector<wxBitmap *> get_extruder_color_icons(bool thin_icon = false);
wxBitmap * get_extruder_color_icon(std::string color, std::string label, int icon_width, int icon_height);
namespace Slic3r {
namespace GUI {
@ -145,17 +140,6 @@ public:
void SetItemsCnt(int cnt) { m_cnt_open_items = cnt; }
};
inline wxSize get_preferred_size(const wxBitmapBundle& bmp, wxWindow* parent)
{
if (!bmp.IsOk())
return wxSize(0, 0);
#ifdef __WIN32__
return bmp.GetPreferredBitmapSizeFor(parent);
#else
return bmp.GetDefaultSize();
#endif
}
// ----------------------------------------------------------------------------
// ScalableBitmap
@ -167,47 +151,31 @@ public:
ScalableBitmap() {};
ScalableBitmap( wxWindow *parent,
const std::string& icon_name = "",
const int px_cnt = 16,
const int px_cnt = 16,
const bool grayscale = false,
const bool resize = false,
const bool use_legacy_bmp = true);
ScalableBitmap( wxWindow *parent,
const std::string& icon_name,
const wxSize size,
const bool grayscale = false,
const bool resize = false);
const bool resize = false); // BBS: support resize by fill border
~ScalableBitmap() {}
[[deprecated("Function renamed to sys_color_changed. This function now redirects to sys_color_changed")]]
inline void msw_rescale() { sys_color_changed(); }
void sys_color_changed();
wxSize GetBmpSize() const;
int GetBmpWidth() const;
int GetBmpHeight() const;
const wxBitmapBundle& bmp() const { return m_bmp; }
wxBitmapBundle& bmp() { return m_bmp; }
wxBitmap get_bitmap() const { return m_bmp.GetBitmapFor(m_parent); }
wxWindow* parent() const { return m_parent;}
const std::string& name() const{ return m_icon_name; }
int px_cnt() const { return m_size.x; }
void msw_rescale();
wxSize GetSize() const {
#ifdef __WIN32__
return m_bmp.GetPreferredBitmapSizeFor(m_parent);
#else
return m_bmp.GetDefaultSize();
#endif
}
int GetWidth() const { return GetSize().GetWidth(); }
int GetHeight() const { return GetSize().GetHeight(); }
const wxBitmap& bmp() const { return m_bmp; }
wxBitmap& bmp() { return m_bmp; }
const std::string& name() const{ return m_icon_name; }
int px_cnt()const {return m_px_cnt;}
private:
wxWindow* m_parent{ nullptr };
wxBitmapBundle m_bmp = wxBitmapBundle();
wxBitmap m_bmp = wxBitmap();
std::string m_icon_name = "";
wxSize m_size {16, 16};
int m_px_cnt {16};
bool m_grayscale{ false };
bool m_resize{ false };
bool m_legacy_bmp{ false };
};
@ -234,9 +202,7 @@ public:
void enable() { m_disabled = false; }
void disable() { m_disabled = true; }
[[deprecated("Function renamed to sys_color_changed. This function now redirects to sys_color_changed")]]
inline void msw_rescale() { sys_color_changed(); }
void sys_color_changed();
void msw_rescale();
protected:
void update_button_bitmaps();
@ -268,6 +234,7 @@ public:
const wxSize& size = wxDefaultSize,
const wxPoint& pos = wxDefaultPosition,
long style = wxBU_EXACTFIT | wxNO_BORDER,
bool use_default_disabled_bitmap = false,
int bmp_px_cnt = 16);
ScalableButton(
@ -283,10 +250,9 @@ public:
bool SetBitmap_(const std::string& bmp_name);
void SetBitmapDisabled_(const ScalableBitmap &bmp);
int GetBitmapHeight();
void UseDefaultBitmapDisabled();
[[deprecated("Function renamed to sys_color_changed. This function now redirects to sys_color_changed")]]
inline void msw_rescale() { sys_color_changed(); }
void sys_color_changed();
void msw_rescale();
private:
wxWindow* m_parent { nullptr };
@ -295,6 +261,8 @@ private:
int m_width {-1}; // should be multiplied to em_unit
int m_height{-1}; // should be multiplied to em_unit
bool m_use_default_disabled_bitmap {false};
// bitmap dimensions
int m_px_cnt{ 16 };
bool m_has_border {false};
@ -360,9 +328,7 @@ public:
void set_items_flag(int flag);
void set_items_border(int border);
[[deprecated("Function renamed to sys_color_changed. This function now redirects to sys_color_changed")]]
inline void msw_rescale() { sys_color_changed(); }
void sys_color_changed();
void msw_rescale();
const std::vector<ModeButton*>& get_btns() { return m_mode_btns; }
private:
@ -410,11 +376,12 @@ public:
~BlinkingBitmap() {}
void msw_rescale();
void invalidate();
void activate();
void blink();
const wxBitmapBundle& get_bmp() const { return bmp.bmp(); }
const wxBitmap& get_bmp() const { return bmp.bmp(); }
private:
ScalableBitmap bmp;