mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 18:12:10 +00:00
ENH: add global map mode tag for pop up
1. Add tag to mark the global map mode 2. Fix some wrong usage of bmp in code 3. Fix display error in dark mode jira:STUDIO-9729 Signed-off-by: xun.zhang <xun.zhang@bambulab.com> Change-Id: Idb36a5022c403e02c26d7fe23a95dd6877deca90 (cherry picked from commit 5a2abf7e211327cde57717b5ab7b79b63c967bbd)
This commit is contained in:
@@ -24,10 +24,10 @@ CapsuleButton::CapsuleButton(wxWindow *parent, wxWindowID id, const wxString &la
|
||||
|
||||
auto sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
std::string icon_name = selected ? "capsule_tag_on" : "capsule_tag_off";
|
||||
auto bmp = create_scaled_bitmap(icon_name, nullptr, FromDIP(16));
|
||||
tag_on_bmp = create_scaled_bitmap("capsule_tag_on", nullptr, FromDIP(16));
|
||||
tag_off_bmp = create_scaled_bitmap("capsule_tag_off", nullptr, FromDIP(16));
|
||||
|
||||
m_btn = new wxBitmapButton(this, wxID_ANY, bmp, wxDefaultPosition, wxDefaultSize, wxNO_BORDER);
|
||||
m_btn = new wxBitmapButton(this, wxID_ANY, selected?tag_on_bmp:tag_off_bmp, wxDefaultPosition, wxDefaultSize, wxNO_BORDER);
|
||||
m_btn->SetBackgroundColour(*wxWHITE);
|
||||
|
||||
m_label = new Label(this, label);
|
||||
@@ -109,15 +109,13 @@ void CapsuleButton::OnLeaveWindow(wxMouseEvent &event)
|
||||
|
||||
void CapsuleButton::UpdateStatus()
|
||||
{
|
||||
std::string icon_name = m_selected ? "capsule_tag_on" : "capsule_tag_off";
|
||||
auto bmp = create_scaled_bitmap(icon_name, nullptr, FromDIP(16));
|
||||
m_btn->SetBitmap(bmp);
|
||||
|
||||
if (m_selected) {
|
||||
m_btn->SetBitmap(tag_on_bmp);
|
||||
m_label->SetForegroundColour(TextSelectColor);
|
||||
m_label->SetBackgroundColour(BgSelectColor);
|
||||
m_btn->SetBackgroundColour(BgSelectColor);
|
||||
} else {
|
||||
m_btn->SetBitmap(tag_off_bmp);
|
||||
m_label->SetForegroundColour(TextNormalColor);
|
||||
m_label->SetBackgroundColour(BgNormalColor);
|
||||
m_btn->SetBackgroundColour(BgNormalColor);
|
||||
|
||||
Reference in New Issue
Block a user