update my todos to OcraftyoneTODO

This commit is contained in:
Ocraftyone 2023-11-07 06:03:55 -05:00
parent d4676ee9cb
commit dc062f1a1a
No known key found for this signature in database
GPG key ID: 85836ED21AD4D125
3 changed files with 25 additions and 25 deletions

View file

@ -781,7 +781,7 @@ wxBitmapBundle* BitmapCache::mksolid_bndl(size_t width, size_t height, const std
if (color.empty()) if (color.empty())
bndl = new wxBitmapBundle(mksolid(width, height, 0, 0, 0, wxALPHA_TRANSPARENT, size_t(0))); bndl = new wxBitmapBundle(mksolid(width, height, 0, 0, 0, wxALPHA_TRANSPARENT, size_t(0)));
else { else {
//TODO: replace with ColorRGB class //OcraftyoneTODO: replace with ColorRGB class
// ColorRGB rgb;// [3] // ColorRGB rgb;// [3]
// decode_color(color, rgb); // decode_color(color, rgb);
unsigned char rgb[3]; unsigned char rgb[3];

View file

@ -22,7 +22,7 @@
#ifndef __linux__ #ifndef __linux__
// msw_menuitem_bitmaps is used for MSW and OSX // msw_menuitem_bitmaps is used for MSW and OSX
static std::map<int, std::string> msw_menuitem_bitmaps; static std::map<int, std::string> msw_menuitem_bitmaps;
void msw_rescale_menu(wxMenu* menu) //TODO: PS RENAME (sys_color_changed_menu) void msw_rescale_menu(wxMenu* menu) //OcraftyoneTODO: PS RENAME (sys_color_changed_menu)
{ {
struct update_icons { struct update_icons {
static void run(wxMenuItem* item) { static void run(wxMenuItem* item) {
@ -829,7 +829,7 @@ void ModeSizer::set_items_border(int border)
void ModeSizer::msw_rescale() void ModeSizer::msw_rescale()
{ {
// this->SetHGap(std::lround(m_hgap_unscaled * em_unit(m_parent))); //TODO: LEGACY (PS removed) // this->SetHGap(std::lround(m_hgap_unscaled * em_unit(m_parent))); //OcraftyoneTODO: LEGACY (PS removed)
for (size_t m = 0; m < m_mode_btns.size(); m++) for (size_t m = 0; m < m_mode_btns.size(); m++)
m_mode_btns[m]->msw_rescale(); m_mode_btns[m]->msw_rescale();
} }
@ -879,13 +879,13 @@ ScalableBitmap::ScalableBitmap( wxWindow *parent,
if (height != GetBmpHeight()) if (height != GetBmpHeight())
msw_rescale(); msw_rescale();
} }
//TODO: PS replaces this function body with the following code //OcraftyoneTODO: PS replaces this function body with the following code
// m_bmp = *get_bmp_bundle(icon_name, px_cnt); // m_bmp = *get_bmp_bundle(icon_name, px_cnt);
// m_bitmap = m_bmp.GetBitmapFor(parent); // m_bitmap = m_bmp.GetBitmapFor(parent);
} }
//TODO: Remove the following 3 functions when refactor complete //OcraftyoneTODO: Remove the following 3 functions when refactor complete
wxSize ScalableBitmap::GetBmpSize() const wxSize ScalableBitmap::GetBmpSize() const
{ return GetSize(); } { return GetSize(); }
@ -900,7 +900,7 @@ void ScalableBitmap::msw_rescale()
{ {
// BBS: support resize by fill border // BBS: support resize by fill border
m_bmp = create_scaled_bitmap(m_icon_name, m_parent, m_px_cnt, m_grayscale, std::string(), false, m_resize); m_bmp = create_scaled_bitmap(m_icon_name, m_parent, m_px_cnt, m_grayscale, std::string(), false, m_resize);
// m_bmp = *get_bmp_bundle(m_icon_name, m_px_cnt); // TODO: can this impl be used // m_bmp = *get_bmp_bundle(m_icon_name, m_px_cnt); // OcraftyoneTODO: can this impl be used
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@ -914,11 +914,11 @@ ScalableButton::ScalableButton( wxWindow * parent,
const wxSize& size /* = wxDefaultSize*/, const wxSize& size /* = wxDefaultSize*/,
const wxPoint& pos /* = wxDefaultPosition*/, const wxPoint& pos /* = wxDefaultPosition*/,
long style /*= wxBU_EXACTFIT | wxNO_BORDER*/, long style /*= wxBU_EXACTFIT | wxNO_BORDER*/,
bool use_default_disabled_bitmap/* = false*/, //TODO: removed by ps bool use_default_disabled_bitmap/* = false*/, //OcraftyoneTODO: removed by ps
int bmp_px_cnt/* = 16*/) : int bmp_px_cnt/* = 16*/) :
m_parent(parent), m_parent(parent),
m_current_icon_name(icon_name), m_current_icon_name(icon_name),
m_use_default_disabled_bitmap (use_default_disabled_bitmap), //TODO: removed by ps m_use_default_disabled_bitmap (use_default_disabled_bitmap), //OcraftyoneTODO: removed by ps
m_px_cnt(bmp_px_cnt), m_px_cnt(bmp_px_cnt),
m_has_border(!(style & wxNO_BORDER)) m_has_border(!(style & wxNO_BORDER))
{ {
@ -930,7 +930,7 @@ ScalableButton::ScalableButton( wxWindow * parent,
SetBitmap(create_scaled_bitmap(icon_name, parent, m_px_cnt)); SetBitmap(create_scaled_bitmap(icon_name, parent, m_px_cnt));
if (m_use_default_disabled_bitmap) if (m_use_default_disabled_bitmap)
SetBitmapDisabled(create_scaled_bitmap(m_current_icon_name, m_parent, m_px_cnt, true)); SetBitmapDisabled(create_scaled_bitmap(m_current_icon_name, m_parent, m_px_cnt, true));
//TODO: replace above 3 lines with following //OcraftyoneTODO: replace above 3 lines with following
// SetBitmap(*get_bmp_bundle(icon_name, m_px_cnt)); // SetBitmap(*get_bmp_bundle(icon_name, m_px_cnt));
if (!label.empty()) if (!label.empty())
SetBitmapMargins(int(0.5* em_unit(parent)), 0); SetBitmapMargins(int(0.5* em_unit(parent)), 0);
@ -980,7 +980,7 @@ bool ScalableButton::SetBitmap_(const std::string& bmp_name)
SetBitmapFocus(bmp); SetBitmapFocus(bmp);
if (m_use_default_disabled_bitmap) if (m_use_default_disabled_bitmap)
SetBitmapDisabled(create_scaled_bitmap(m_current_icon_name, m_parent, m_px_cnt, true)); SetBitmapDisabled(create_scaled_bitmap(m_current_icon_name, m_parent, m_px_cnt, true));
//TODO: above 2 lines replaced with //OcraftyoneTODO: above 2 lines replaced with
// SetBitmapDisabled(bmp); // SetBitmapDisabled(bmp);
return true; return true;
} }
@ -1000,13 +1000,13 @@ int ScalableButton::GetBitmapHeight()
#endif #endif
} }
void ScalableButton::UseDefaultBitmapDisabled() //TODO: removed by ps void ScalableButton::UseDefaultBitmapDisabled() //OcraftyoneTODO: removed by ps
{ {
m_use_default_disabled_bitmap = true; m_use_default_disabled_bitmap = true;
SetBitmapDisabled(create_scaled_bitmap(m_current_icon_name, m_parent, m_px_cnt, true)); SetBitmapDisabled(create_scaled_bitmap(m_current_icon_name, m_parent, m_px_cnt, true));
} }
void ScalableButton::msw_rescale() //TODO: renamed to sys_color_changed void ScalableButton::msw_rescale() //OcraftyoneTODO: renamed to sys_color_changed
{ {
Slic3r::GUI::wxGetApp().UpdateDarkUI(this, m_has_border); Slic3r::GUI::wxGetApp().UpdateDarkUI(this, m_has_border);
@ -1032,7 +1032,7 @@ BlinkingBitmap::BlinkingBitmap(wxWindow* parent, const std::string& icon_name) :
bmp = ScalableBitmap(parent, icon_name); bmp = ScalableBitmap(parent, icon_name);
} }
void BlinkingBitmap::msw_rescale() //TODO: removed by ps void BlinkingBitmap::msw_rescale() //OcraftyoneTODO: removed by ps
{ {
bmp.msw_rescale(); bmp.msw_rescale();
this->SetSize(bmp.GetBmpSize()); this->SetSize(bmp.GetBmpSize());

View file

@ -19,9 +19,9 @@
#include "Widgets/PopupWindow.hpp" #include "Widgets/PopupWindow.hpp"
#ifndef __linux__ #ifndef __linux__
void msw_rescale_menu(wxMenu* menu); //TODO: PS RENAME (sys_color_changed_menu) void msw_rescale_menu(wxMenu* menu); //OcraftyoneTODO: PS RENAME (sys_color_changed_menu)
#else #else
inline void msw_rescale_menu(wxMenu* /* menu */) {} //TODO: PS RENAME (sys_color_changed_menu) inline void msw_rescale_menu(wxMenu* /* menu */) {} //OcraftyoneTODO: PS RENAME (sys_color_changed_menu)
#endif // no __linux__ #endif // no __linux__
wxMenuItem* append_menu_item(wxMenu* menu, int id, const wxString& string, const wxString& description, wxMenuItem* append_menu_item(wxMenu* menu, int id, const wxString& string, const wxString& description,
@ -52,7 +52,7 @@ void msw_buttons_rescale(wxDialog* dlg, const int em_unit, const std::vector<
int em_unit(wxWindow* win); int em_unit(wxWindow* win);
int mode_icon_px_size(); int mode_icon_px_size();
wxBitmap create_menu_bitmap(const std::string& bmp_name); //TODO: LEGACY (PS deleted) wxBitmap create_menu_bitmap(const std::string& bmp_name); //OcraftyoneTODO: LEGACY (PS deleted)
wxBitmapBundle* get_bmp_bundle(const std::string& bmp_name, int px_cnt = 16); wxBitmapBundle* get_bmp_bundle(const std::string& bmp_name, int px_cnt = 16);
wxBitmapBundle* get_empty_bmp_bundle(int width, int height); wxBitmapBundle* get_empty_bmp_bundle(int width, int height);
wxBitmapBundle* get_solid_bmp_bundle(int width, int height, const std::string& color); wxBitmapBundle* get_solid_bmp_bundle(int width, int height, const std::string& color);
@ -171,11 +171,11 @@ public:
~ScalableBitmap() {} ~ScalableBitmap() {}
wxSize GetBmpSize() const; // TODO: REPLACE wxSize GetBmpSize() const; // OcraftyoneTODO: REPLACE
int GetBmpWidth() const; int GetBmpWidth() const;
int GetBmpHeight() const; int GetBmpHeight() const;
void msw_rescale(); //TODO: PS RENAME (sys_color_changed) void msw_rescale(); //OcraftyoneTODO: PS RENAME (sys_color_changed)
const wxBitmapBundle& bmp() const { return m_bmp; } const wxBitmapBundle& bmp() const { return m_bmp; }
wxBitmapBundle& bmp() { return m_bmp; } wxBitmapBundle& bmp() { return m_bmp; }
@ -184,7 +184,7 @@ public:
const std::string& name() const{ return m_icon_name; } const std::string& name() const{ return m_icon_name; }
int px_cnt() const { return m_px_cnt; } int px_cnt() const { return m_px_cnt; }
wxSize GetSize() const { // TODO: REPLACEMENTS wxSize GetSize() const { // OcraftyoneTODO: REPLACEMENTS
#ifdef __APPLE__ #ifdef __APPLE__
return m_bmp.GetDefaultSize(); return m_bmp.GetDefaultSize();
#else #else
@ -228,7 +228,7 @@ public:
void enable() { m_disabled = false; } void enable() { m_disabled = false; }
void disable() { m_disabled = true; } void disable() { m_disabled = true; }
void msw_rescale(); //TODO: PS RENAME (sys_color_changed) void msw_rescale(); //OcraftyoneTODO: PS RENAME (sys_color_changed)
protected: protected:
void update_button_bitmaps(); void update_button_bitmaps();
@ -260,7 +260,7 @@ public:
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
long style = wxBU_EXACTFIT | wxNO_BORDER, long style = wxBU_EXACTFIT | wxNO_BORDER,
bool use_default_disabled_bitmap = false, //TODO: LEGACY (PS deleted) bool use_default_disabled_bitmap = false, //OcraftyoneTODO: LEGACY (PS deleted)
int bmp_px_cnt = 16); int bmp_px_cnt = 16);
ScalableButton( ScalableButton(
@ -276,7 +276,7 @@ public:
bool SetBitmap_(const std::string& bmp_name); bool SetBitmap_(const std::string& bmp_name);
void SetBitmapDisabled_(const ScalableBitmap &bmp); void SetBitmapDisabled_(const ScalableBitmap &bmp);
int GetBitmapHeight(); int GetBitmapHeight();
void UseDefaultBitmapDisabled(); //TODO: LEGACY (PS deleted) void UseDefaultBitmapDisabled(); //OcraftyoneTODO: LEGACY (PS deleted)
void msw_rescale(); void msw_rescale();
@ -287,7 +287,7 @@ private:
int m_width {-1}; // should be multiplied to em_unit int m_width {-1}; // should be multiplied to em_unit
int m_height{-1}; // should be multiplied to em_unit int m_height{-1}; // should be multiplied to em_unit
bool m_use_default_disabled_bitmap {false}; //TODO: LEGACY (PS deleted) bool m_use_default_disabled_bitmap {false}; //OcraftyoneTODO: LEGACY (PS deleted)
// bitmap dimensions // bitmap dimensions
int m_px_cnt{ 16 }; int m_px_cnt{ 16 };
@ -354,7 +354,7 @@ public:
void set_items_flag(int flag); void set_items_flag(int flag);
void set_items_border(int border); void set_items_border(int border);
void msw_rescale(); //TODO: PS RENAME (sys_color_changed) void msw_rescale(); //OcraftyoneTODO: PS RENAME (sys_color_changed)
const std::vector<ModeButton*>& get_btns() { return m_mode_btns; } const std::vector<ModeButton*>& get_btns() { return m_mode_btns; }
private: private:
@ -402,7 +402,7 @@ public:
~BlinkingBitmap() {} ~BlinkingBitmap() {}
void msw_rescale(); //TODO: LEGACY (PS deleted) void msw_rescale(); //OcraftyoneTODO: LEGACY (PS deleted)
void invalidate(); void invalidate();
void activate(); void activate();
void blink(); void blink();