mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-20 07:11:12 -06:00
FIX:use scalablebitmap replace wxbitmap
Change-Id: I4ca885051f309be4a7d9a6e08de097fe75847257
This commit is contained in:
parent
00ba515783
commit
9fc010512c
22 changed files with 187 additions and 186 deletions
|
@ -133,8 +133,8 @@ void AMSrefresh::create(wxWindow *parent, wxWindowID id, const wxPoint &pos, con
|
|||
Bind(wxEVT_LEAVE_WINDOW, &AMSrefresh::OnLeaveWindow, this);
|
||||
Bind(wxEVT_LEFT_DOWN, &AMSrefresh::OnClick, this);
|
||||
|
||||
m_bitmap_normal = create_scaled_bitmap("ams_refresh_normal", this, 26);
|
||||
m_bitmap_selected = create_scaled_bitmap("ams_refresh_selected", this, 26);
|
||||
m_bitmap_normal = ScalableBitmap(this, "ams_refresh_normal", 26);
|
||||
m_bitmap_selected = ScalableBitmap(this, "ams_refresh_selected", 26);
|
||||
|
||||
/* m_animationCtrl = new wxAnimationCtrl(this, wxID_ANY, wxNullAnimation, wxDefaultPosition, AMS_REFRESH_SIZE);
|
||||
auto path = (boost::format("%1%/images/refresh.gif") % resources_dir()).str();
|
||||
|
@ -213,17 +213,18 @@ void AMSrefresh::paintEvent(wxPaintEvent &evt)
|
|||
auto colour = AMS_CONTROL_GRAY700;
|
||||
if (!wxWindow::IsEnabled()) { colour = AMS_CONTROL_GRAY500; }
|
||||
|
||||
auto pot = wxPoint((size.x - m_bitmap_selected.GetSize().x) / 2, (size.y - m_bitmap_selected.GetSize().y) / 2);
|
||||
auto pot = wxPoint((size.x - m_bitmap_selected.GetBmpSize().x) / 2, (size.y - m_bitmap_selected.GetBmpSize().y) / 2);
|
||||
|
||||
if (!m_play_loading) {
|
||||
dc.DrawBitmap(m_selected ? m_bitmap_selected : m_bitmap_normal, pot);
|
||||
dc.DrawBitmap(m_selected ? m_bitmap_selected.bmp() : m_bitmap_normal.bmp(), pot);
|
||||
} else {
|
||||
m_bitmap_rotation = create_scaled_bitmap("ams_refresh_normal", this, 26);
|
||||
auto image = m_bitmap_rotation.ConvertToImage();
|
||||
m_bitmap_rotation = ScalableBitmap(this, "ams_refresh_normal", 26);
|
||||
auto image = m_bitmap_rotation.bmp().ConvertToImage();
|
||||
wxPoint offset;
|
||||
auto loading_img = image.Rotate(m_rotation_angle, wxPoint(image.GetWidth() / 2, image.GetHeight() / 2), true, &offset);
|
||||
auto loading_bitmap = wxBitmap(loading_img);
|
||||
dc.DrawBitmap( loading_bitmap, offset.x , offset.y);
|
||||
ScalableBitmap loading_bitmap;
|
||||
loading_bitmap.bmp() = wxBitmap(loading_img);
|
||||
dc.DrawBitmap(loading_bitmap.bmp(), offset.x , offset.y);
|
||||
}
|
||||
|
||||
dc.SetPen(wxPen(colour));
|
||||
|
@ -246,8 +247,8 @@ void AMSrefresh::msw_rescale() { }
|
|||
void AMSrefresh::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
{
|
||||
wxWindow::DoSetSize(x, y, width, height, sizeFlags);
|
||||
m_bitmap_normal = create_scaled_bitmap("ams_refresh_normal", this, 26);
|
||||
m_bitmap_selected = create_scaled_bitmap("ams_refresh_selected", this, 26);
|
||||
m_bitmap_normal = ScalableBitmap(this, "ams_refresh_normal", 26);
|
||||
m_bitmap_selected = ScalableBitmap(this, "ams_refresh_selected", 26);
|
||||
}
|
||||
|
||||
/*************************************************
|
||||
|
@ -269,7 +270,7 @@ void AMSextruderImage::msw_rescale()
|
|||
{
|
||||
//m_ams_extruder.SetSize(AMS_EXTRUDER_BITMAP_SIZE);
|
||||
//auto image = m_ams_extruder.ConvertToImage();
|
||||
m_ams_extruder = create_scaled_bitmap("monitor_ams_extruder", nullptr, 55);
|
||||
m_ams_extruder = ScalableBitmap(this, "monitor_ams_extruder", 55);
|
||||
Refresh();
|
||||
}
|
||||
|
||||
|
@ -306,7 +307,7 @@ void AMSextruderImage::doRender(wxDC &dc)
|
|||
dc.SetPen(*wxTRANSPARENT_PEN);
|
||||
dc.SetBrush(m_colour);
|
||||
dc.DrawRectangle(0, 0, size.x, size.y - FromDIP(5));
|
||||
dc.DrawBitmap(m_ams_extruder, wxPoint( (size.x - m_ams_extruder.GetSize().x) / 2, (size.y - m_ams_extruder.GetSize().y) / 2 ));
|
||||
dc.DrawBitmap(m_ams_extruder.bmp(), wxPoint((size.x - m_ams_extruder.GetBmpSize().x) / 2, (size.y - m_ams_extruder.GetBmpSize().y) / 2));
|
||||
}
|
||||
|
||||
|
||||
|
@ -315,7 +316,7 @@ AMSextruderImage::AMSextruderImage(wxWindow *parent, wxWindowID id, const wxPoin
|
|||
wxWindow::Create(parent, id, pos, AMS_EXTRUDER_BITMAP_SIZE);
|
||||
SetBackgroundColour(*wxWHITE);
|
||||
|
||||
m_ams_extruder = create_scaled_bitmap("monitor_ams_extruder", nullptr,55);
|
||||
m_ams_extruder = ScalableBitmap(this, "monitor_ams_extruder",55);
|
||||
|
||||
SetSize(AMS_EXTRUDER_BITMAP_SIZE);
|
||||
SetMinSize(AMS_EXTRUDER_BITMAP_SIZE);
|
||||
|
@ -404,8 +405,8 @@ void AMSLib::create(wxWindow *parent, wxWindowID id, const wxPoint &pos, const w
|
|||
|
||||
wxBoxSizer *m_sizer_edit = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
m_bitmap_editable = create_scaled_bitmap("ams_editable", this, 14);
|
||||
m_bitmap_editable_lifht = create_scaled_bitmap("ams_editable_light", this, 14);
|
||||
m_bitmap_editable = ScalableBitmap(this, "ams_editable", 14);
|
||||
m_bitmap_editable_lifht = ScalableBitmap(this, "ams_editable_light", 14);
|
||||
|
||||
m_sizer_body->Add(0, 0, 1, wxEXPAND, 0);
|
||||
m_sizer_body->Add(m_sizer_edit, 0, wxALIGN_CENTER, 0);
|
||||
|
@ -434,7 +435,7 @@ void AMSLib::on_left_down(wxMouseEvent &evt)
|
|||
auto size = GetSize();
|
||||
auto pos = evt.GetPosition();
|
||||
auto left = FromDIP(20);
|
||||
auto top = (size.y - FromDIP(10) - m_bitmap_editable_lifht.GetSize().y);
|
||||
auto top = (size.y - FromDIP(10) - m_bitmap_editable_lifht.GetBmpSize().y);
|
||||
auto right = size.x - FromDIP(20);
|
||||
auto bottom = size.y - FromDIP(10);
|
||||
|
||||
|
@ -590,7 +591,7 @@ void AMSLib::doRender(wxDC &dc)
|
|||
// edit icon
|
||||
if (m_info.material_state != AMSCanType::AMS_CAN_TYPE_EMPTY && m_info.material_state != AMSCanType::AMS_CAN_TYPE_NONE
|
||||
&& m_info.material_state == AMSCanType::AMS_CAN_TYPE_THIRDBRAND ) {
|
||||
dc.DrawBitmap(temp_bitmap, (size.x - m_bitmap_editable.GetSize().x) / 2, ( size.y - FromDIP(10) - temp_bitmap.GetSize().y) );
|
||||
dc.DrawBitmap(temp_bitmap.bmp(), (size.x - m_bitmap_editable.GetBmpSize().x) / 2, (size.y - FromDIP(10) - temp_bitmap.GetBmpSize().y));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -160,9 +160,9 @@ protected:
|
|||
|
||||
bool m_play_loading = {false};
|
||||
bool m_selected = {false};
|
||||
wxBitmap m_bitmap_rotation;
|
||||
wxBitmap m_bitmap_normal;
|
||||
wxBitmap m_bitmap_selected;
|
||||
ScalableBitmap m_bitmap_rotation;
|
||||
ScalableBitmap m_bitmap_normal;
|
||||
ScalableBitmap m_bitmap_selected;
|
||||
wxString m_text;
|
||||
wxBoxSizer * m_size_body;
|
||||
virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||
|
@ -182,7 +182,7 @@ public:
|
|||
void render(wxDC &dc);
|
||||
bool m_turn_on = {false};
|
||||
wxColour m_colour;
|
||||
wxBitmap m_ams_extruder;
|
||||
ScalableBitmap m_ams_extruder;
|
||||
void doRender(wxDC &dc);
|
||||
AMSextruderImage(wxWindow *parent, wxWindowID id, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize);
|
||||
~AMSextruderImage();
|
||||
|
@ -200,7 +200,7 @@ public:
|
|||
wxBoxSizer * m_bitmap_sizer{nullptr};
|
||||
wxPanel * m_bitmap_panel{nullptr};
|
||||
AMSextruderImage *m_amsSextruder{nullptr};
|
||||
wxBitmap monitor_ams_extruder;
|
||||
ScalableBitmap monitor_ams_extruder;
|
||||
AMSextruder(wxWindow *parent, wxWindowID id, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize);
|
||||
~AMSextruder();
|
||||
};
|
||||
|
@ -228,8 +228,8 @@ public:
|
|||
protected:
|
||||
wxStaticBitmap *m_edit_bitmp = {nullptr};
|
||||
wxStaticBitmap *m_edit_bitmp_light = {nullptr};
|
||||
wxBitmap m_bitmap_editable;
|
||||
wxBitmap m_bitmap_editable_lifht;
|
||||
ScalableBitmap m_bitmap_editable;
|
||||
ScalableBitmap m_bitmap_editable_lifht;
|
||||
bool m_unable_selected = {false};
|
||||
bool m_enable = {false};
|
||||
bool m_selected = {false};
|
||||
|
|
|
@ -24,7 +24,7 @@ END_EVENT_TABLE()
|
|||
#define BLANK_SIZE FromDIP(23)
|
||||
#define GAP_SIZE FromDIP(4)
|
||||
|
||||
AxisCtrlButton::AxisCtrlButton(wxWindow *parent, wxBitmap &icon, long stlye)
|
||||
AxisCtrlButton::AxisCtrlButton(wxWindow *parent, ScalableBitmap &icon, long stlye)
|
||||
: wxWindow(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, stlye)
|
||||
, r_outer(OUTER_SIZE)
|
||||
, r_inner(INNER_SIZE)
|
||||
|
@ -36,7 +36,7 @@ AxisCtrlButton::AxisCtrlButton(wxWindow *parent, wxBitmap &icon, long stlye)
|
|||
, text_color(std::make_pair(0x6B6B6B, (int) StateColor::Disabled), std::make_pair(*wxBLACK, (int) StateColor::Normal))
|
||||
, state_handler(this)
|
||||
{
|
||||
m_icon = icon.GetSubBitmap(wxRect(0, 0, icon.GetWidth(), icon.GetHeight()));
|
||||
m_icon = icon;
|
||||
wxWindow::SetBackgroundColour(parent->GetBackgroundColour());
|
||||
|
||||
border_color.append(bd, StateColor::Hovered);
|
||||
|
@ -119,9 +119,9 @@ void AxisCtrlButton::SetInnerBackgroundColor(StateColor const& color)
|
|||
Refresh();
|
||||
}
|
||||
|
||||
void AxisCtrlButton::SetBitmap(wxBitmap &bmp)
|
||||
void AxisCtrlButton::SetBitmap(ScalableBitmap &bmp)
|
||||
{
|
||||
m_icon = bmp.GetSubBitmap(wxRect(0, 0, bmp.GetWidth(), bmp.GetHeight()));
|
||||
m_icon = bmp;
|
||||
}
|
||||
|
||||
void AxisCtrlButton::Rescale() {
|
||||
|
@ -210,8 +210,8 @@ void AxisCtrlButton::render(wxDC& dc)
|
|||
}
|
||||
gc->DrawPath(home_path);
|
||||
|
||||
if (m_icon.IsOk()) {
|
||||
gc->DrawBitmap(m_icon, -1 * m_icon.GetWidth() / 2, -1 * m_icon.GetHeight() / 2, m_icon.GetWidth(), m_icon.GetHeight());
|
||||
if (m_icon.bmp().IsOk()) {
|
||||
gc->DrawBitmap(m_icon.bmp(), -1 * m_icon.GetBmpWidth() / 2, -1 * m_icon.GetBmpHeight() / 2, m_icon.GetBmpWidth(), m_icon.GetBmpHeight());
|
||||
}
|
||||
gc->PopState();
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ class AxisCtrlButton : public wxWindow
|
|||
StateColor background_color;
|
||||
StateColor inner_background_color;
|
||||
|
||||
wxBitmap m_icon;
|
||||
ScalableBitmap m_icon;
|
||||
|
||||
bool pressedDown = false;
|
||||
|
||||
|
@ -45,7 +45,7 @@ class AxisCtrlButton : public wxWindow
|
|||
};
|
||||
|
||||
public:
|
||||
AxisCtrlButton(wxWindow *parent, wxBitmap &icon, long style = 0);
|
||||
AxisCtrlButton(wxWindow *parent, ScalableBitmap &icon, long style = 0);
|
||||
|
||||
void SetMinSize(const wxSize& size) override;
|
||||
|
||||
|
@ -57,7 +57,7 @@ public:
|
|||
|
||||
void SetInnerBackgroundColor(StateColor const& color);
|
||||
|
||||
void SetBitmap(wxBitmap &bmp);
|
||||
void SetBitmap(ScalableBitmap &bmp);
|
||||
|
||||
void Rescale();
|
||||
|
||||
|
|
|
@ -18,13 +18,13 @@ END_EVENT_TABLE()
|
|||
static const wxColour DEFAULT_HOVER_COL = wxColour(0, 174, 66);
|
||||
static const wxColour DEFAULT_PRESS_COL = wxColour(238, 238, 238);
|
||||
|
||||
ImageSwitchButton::ImageSwitchButton(wxWindow *parent, wxBitmap &img_on, wxBitmap &img_off, long style)
|
||||
ImageSwitchButton::ImageSwitchButton(wxWindow *parent, ScalableBitmap &img_on, ScalableBitmap &img_off, long style)
|
||||
: text_color(std::make_pair(0x6B6B6B, (int) StateColor::Disabled), std::make_pair(*wxBLACK, (int) StateColor::Normal))
|
||||
, state_handler(this)
|
||||
{
|
||||
m_padding = 0;
|
||||
m_on = img_on.GetSubBitmap(wxRect(0, 0, img_on.GetWidth(), img_on.GetHeight()));
|
||||
m_off = img_off.GetSubBitmap(wxRect(0, 0, img_off.GetWidth(), img_off.GetHeight()));
|
||||
m_on = img_on;
|
||||
m_off = img_off;
|
||||
bg_color = StateColor(std::make_pair(DEFAULT_PRESS_COL, (int) StateColor::Pressed),
|
||||
std::make_pair(*wxWHITE, (int) StateColor::Normal));
|
||||
border_color = StateColor(std::make_pair(DEFAULT_HOVER_COL, (int) StateColor::Hovered));
|
||||
|
@ -46,7 +46,7 @@ void ImageSwitchButton::SetLabels(wxString const &lbl_on, wxString const &lbl_of
|
|||
Refresh();
|
||||
}
|
||||
|
||||
void ImageSwitchButton::SetImages(wxBitmap &img_on, wxBitmap &img_off)
|
||||
void ImageSwitchButton::SetImages(ScalableBitmap &img_on, ScalableBitmap &img_off)
|
||||
{
|
||||
m_on = img_on;
|
||||
m_off = img_off;
|
||||
|
@ -120,14 +120,14 @@ void ImageSwitchButton::render(wxDC& dc)
|
|||
|
||||
wxSize szIcon;
|
||||
wxSize szContent = textSize;
|
||||
wxBitmap &icon = GetValue() ? m_on: m_off;
|
||||
ScalableBitmap &icon = GetValue() ? m_on : m_off;
|
||||
|
||||
int content_height = icon.GetHeight() + textSize.y + m_padding;
|
||||
int content_height = icon.GetBmpHeight() + textSize.y + m_padding;
|
||||
|
||||
wxPoint pt = wxPoint((size.x - icon.GetWidth()) / 2, (size.y - content_height) / 2);
|
||||
if (icon.IsOk()) {
|
||||
dc.DrawBitmap(icon, pt);
|
||||
pt.y += m_padding + icon.GetHeight();
|
||||
wxPoint pt = wxPoint((size.x - icon.GetBmpWidth()) / 2, (size.y - content_height) / 2);
|
||||
if (icon.bmp().IsOk()) {
|
||||
dc.DrawBitmap(icon.bmp(), pt);
|
||||
pt.y += m_padding + icon.GetBmpHeight();
|
||||
}
|
||||
pt.x = (size.x - textSize.x) / 2;
|
||||
dc.SetFont(GetFont());
|
||||
|
|
|
@ -12,10 +12,10 @@
|
|||
class ImageSwitchButton : public StaticBox
|
||||
{
|
||||
public:
|
||||
ImageSwitchButton(wxWindow *parent, wxBitmap &img_on, wxBitmap &img_off, long style = 0);
|
||||
ImageSwitchButton(wxWindow *parent, ScalableBitmap &img_on, ScalableBitmap &img_off, long style = 0);
|
||||
|
||||
void SetLabels(wxString const & lbl_on, wxString const & lbl_off);
|
||||
void SetImages(wxBitmap &img_on, wxBitmap &img_off);
|
||||
void SetImages(ScalableBitmap &img_on, ScalableBitmap &img_off);
|
||||
void SetTextColor(StateColor const &color);
|
||||
void SetBorderColor(StateColor const &color);
|
||||
void SetBgColor(StateColor const &color);
|
||||
|
@ -38,8 +38,8 @@ private:
|
|||
DECLARE_EVENT_TABLE()
|
||||
|
||||
private:
|
||||
wxBitmap m_on;
|
||||
wxBitmap m_off;
|
||||
ScalableBitmap m_on;
|
||||
ScalableBitmap m_off;
|
||||
bool m_on_off;
|
||||
int m_padding; // size between icon and text
|
||||
bool pressedDown = false;
|
||||
|
|
|
@ -14,17 +14,17 @@ namespace Slic3r { namespace GUI {
|
|||
|
||||
SetBackgroundColour(*wxWHITE);
|
||||
|
||||
m_printing_img = create_scaled_bitmap("printer", nullptr, 16);
|
||||
m_arrow_img = create_scaled_bitmap("monitor_arrow", nullptr, 14);
|
||||
m_printing_img = ScalableBitmap(this, "printer", 16);
|
||||
m_arrow_img = ScalableBitmap(this, "monitor_arrow", 14);
|
||||
|
||||
m_none_printing_img = create_scaled_bitmap("tab_monitor_active", nullptr, 24);
|
||||
m_none_arrow_img = create_scaled_bitmap("monitor_none_arrow", nullptr, 14);
|
||||
m_none_add_img = create_scaled_bitmap("monitor_none_add", nullptr, 14);
|
||||
m_none_printing_img = ScalableBitmap(this, "tab_monitor_active", 24);
|
||||
m_none_arrow_img = ScalableBitmap(this, "monitor_none_arrow", 14);
|
||||
m_none_add_img = ScalableBitmap(this, "monitor_none_add", 14);
|
||||
|
||||
m_wifi_none_img = create_scaled_bitmap("monitor_signal_no", nullptr, 18);
|
||||
m_wifi_weak_img = create_scaled_bitmap("monitor_signal_weak", nullptr, 18);
|
||||
m_wifi_middle_img = create_scaled_bitmap("monitor_signal_middle", nullptr, 18);
|
||||
m_wifi_strong_img = create_scaled_bitmap("monitor_signal_strong", nullptr, 18);
|
||||
m_wifi_none_img = ScalableBitmap(this, "monitor_signal_no", 18);
|
||||
m_wifi_weak_img = ScalableBitmap(this, "monitor_signal_weak", 18);
|
||||
m_wifi_middle_img = ScalableBitmap(this, "monitor_signal_middle", 18);
|
||||
m_wifi_strong_img = ScalableBitmap(this, "monitor_signal_strong", 18);
|
||||
|
||||
m_intetval_timer = new wxTimer();
|
||||
m_intetval_timer->SetOwner(this);
|
||||
|
@ -131,12 +131,12 @@ void SideTools::doRender(wxDC &dc)
|
|||
dc.SetBrush(SIDE_TOOLS_BRAND);
|
||||
dc.DrawRectangle(0, 0, size.x, size.y);
|
||||
|
||||
dc.DrawBitmap(m_none_printing_img, left, (size.y - m_none_printing_img.GetSize().y) / 2);
|
||||
dc.DrawBitmap(m_none_printing_img.bmp(), left, (size.y - m_none_printing_img.GetBmpSize().y) / 2);
|
||||
|
||||
left += (m_none_printing_img.GetSize().x + FromDIP(15));
|
||||
dc.DrawBitmap(m_none_arrow_img, left, (size.y - m_none_arrow_img.GetSize().y) / 2);
|
||||
left += (m_none_printing_img.GetBmpSize().x + FromDIP(15));
|
||||
dc.DrawBitmap(m_none_arrow_img.bmp(), left, (size.y - m_none_arrow_img.GetBmpSize().y) / 2);
|
||||
|
||||
left += (m_none_arrow_img.GetSize().x + FromDIP(6));
|
||||
left += (m_none_arrow_img.GetBmpSize().x + FromDIP(6));
|
||||
dc.SetFont(::Label::Body_14);
|
||||
dc.SetBackgroundMode(wxTRANSPARENT);
|
||||
dc.SetTextForeground(*wxWHITE);
|
||||
|
@ -144,21 +144,21 @@ void SideTools::doRender(wxDC &dc)
|
|||
auto sizet = dc.GetTextExtent(_L("No printer"));
|
||||
dc.DrawText(_L("No printer"), wxPoint(left, (size.y - sizet.y) / 2));
|
||||
|
||||
left = size.x - FromDIP(30) - m_wifi_none_img.GetSize().x;
|
||||
dc.DrawBitmap(m_none_add_img, left, (size.y - m_none_add_img.GetSize().y) / 2);
|
||||
left = size.x - FromDIP(30) - m_wifi_none_img.GetBmpSize().x;
|
||||
dc.DrawBitmap(m_none_add_img.bmp(), left, (size.y - m_none_add_img.GetBmpSize().y) / 2);
|
||||
} else {
|
||||
dc.DrawBitmap(m_printing_img, left, (size.y - m_printing_img.GetSize().y) / 2);
|
||||
dc.DrawBitmap(m_printing_img.bmp(), left, (size.y - m_printing_img.GetBmpSize().y) / 2);
|
||||
|
||||
left += (m_printing_img.GetSize().x + FromDIP(5));
|
||||
dc.DrawBitmap(m_arrow_img, left, (size.y - m_arrow_img.GetSize().y) / 2);
|
||||
left += (m_printing_img.GetBmpSize().x + FromDIP(5));
|
||||
dc.DrawBitmap(m_arrow_img.bmp(), left, (size.y - m_arrow_img.GetBmpSize().y) / 2);
|
||||
|
||||
left += (m_arrow_img.GetSize().x + FromDIP(6));
|
||||
left += (m_arrow_img.GetBmpSize().x + FromDIP(6));
|
||||
dc.SetFont(::Label::Body_14);
|
||||
dc.SetBackgroundMode(wxTRANSPARENT);
|
||||
dc.SetTextForeground(SIDE_TOOLS_GREY900);
|
||||
|
||||
auto sizet = dc.GetTextExtent(m_dev_name);
|
||||
auto text_end = size.x - m_wifi_none_img.GetSize().x - 20;
|
||||
auto text_end = size.x - m_wifi_none_img.GetBmpSize().x - 20;
|
||||
|
||||
std::string finally_name = m_dev_name.ToStdString();
|
||||
if (sizet.x > (text_end - left)) {
|
||||
|
@ -175,11 +175,11 @@ void SideTools::doRender(wxDC &dc)
|
|||
|
||||
dc.DrawText(finally_name, wxPoint(left, (size.y - sizet.y) / 2));
|
||||
|
||||
left = size.x - FromDIP(18) - m_wifi_none_img.GetSize().x;
|
||||
if (m_wifi_type == WifiSignal::NONE) dc.DrawBitmap(m_wifi_none_img, left, (size.y - m_wifi_none_img.GetSize().y) / 2);
|
||||
if (m_wifi_type == WifiSignal::WEAK) dc.DrawBitmap(m_wifi_weak_img, left, (size.y - m_wifi_weak_img.GetSize().y) / 2);
|
||||
if (m_wifi_type == WifiSignal::MIDDLE) dc.DrawBitmap(m_wifi_middle_img, left, (size.y - m_wifi_middle_img.GetSize().y) / 2);
|
||||
if (m_wifi_type == WifiSignal::STRONG) dc.DrawBitmap(m_wifi_strong_img, left, (size.y - m_wifi_strong_img.GetSize().y) / 2);
|
||||
left = size.x - FromDIP(18) - m_wifi_none_img.GetBmpSize().x;
|
||||
if (m_wifi_type == WifiSignal::NONE) dc.DrawBitmap(m_wifi_none_img.bmp(), left, (size.y - m_wifi_none_img.GetBmpSize().y) / 2);
|
||||
if (m_wifi_type == WifiSignal::WEAK) dc.DrawBitmap(m_wifi_weak_img.bmp(), left, (size.y - m_wifi_weak_img.GetBmpSize().y) / 2);
|
||||
if (m_wifi_type == WifiSignal::MIDDLE) dc.DrawBitmap(m_wifi_middle_img.bmp(), left, (size.y - m_wifi_middle_img.GetBmpSize().y) / 2);
|
||||
if (m_wifi_type == WifiSignal::STRONG) dc.DrawBitmap(m_wifi_strong_img.bmp(), left, (size.y - m_wifi_strong_img.GetBmpSize().y) / 2);
|
||||
}
|
||||
|
||||
if (m_hover) {
|
||||
|
|
|
@ -33,20 +33,19 @@ private:
|
|||
bool m_none_printer{true};
|
||||
int last_printer_signal = 0;
|
||||
|
||||
wxBitmap m_printing_img;
|
||||
wxBitmap m_arrow_img;
|
||||
ScalableBitmap m_printing_img;
|
||||
ScalableBitmap m_arrow_img;
|
||||
|
||||
wxBitmap m_none_printing_img;
|
||||
wxBitmap m_none_arrow_img;
|
||||
wxBitmap m_none_add_img;
|
||||
ScalableBitmap m_none_printing_img;
|
||||
ScalableBitmap m_none_arrow_img;
|
||||
ScalableBitmap m_none_add_img;
|
||||
|
||||
wxBitmap m_wifi_none_img;
|
||||
wxBitmap m_wifi_weak_img;
|
||||
wxBitmap m_wifi_middle_img;
|
||||
wxBitmap m_wifi_strong_img;
|
||||
ScalableBitmap m_wifi_none_img;
|
||||
ScalableBitmap m_wifi_weak_img;
|
||||
ScalableBitmap m_wifi_middle_img;
|
||||
ScalableBitmap m_wifi_strong_img;
|
||||
|
||||
protected:
|
||||
wxBitmap m_bitmap_type;
|
||||
wxStaticBitmap *m_bitmap_info;
|
||||
wxStaticBitmap *m_bitmap_bind;
|
||||
wxTimer * m_intetval_timer{nullptr};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue