ENH: update dark mode supports of print option

jira: [STUDIO-12188]
Change-Id: I0d38bcab502415dd733d9b58835e1e50dd00bd22
This commit is contained in:
xin.zhang 2025-05-15 15:16:36 +08:00 committed by lane.wei
parent bab463f1f5
commit 2b8edfccc8
4 changed files with 19 additions and 6 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

View File

@ -4752,9 +4752,9 @@ void PrintOption::enable(bool en)
m_printoption_item->enable(en);
if (en) {
m_printoption_title->SetForegroundColour("#262E30");
m_printoption_title->SetForegroundColour(StateColor::darkModeColorFor("#262E30"));
} else {
m_printoption_title->SetForegroundColour(wxColour(144, 144, 144));
m_printoption_title->SetForegroundColour(StateColor::darkModeColorFor(wxColour(144, 144, 144)));
}
}
}
@ -4827,7 +4827,9 @@ PrintOptionItem::PrintOptionItem(wxWindow* parent, std::vector<POItem> ops, std:
Bind(wxEVT_LEFT_DOWN, &PrintOptionItem::on_left_down, this);
m_selected_bk = ScalableBitmap(this, "print_options_bg", 22);
m_selected_disbabled_bk = ScalableBitmap(this, "print_options_bg_disabled", 22);
m_selected_bk_dark = ScalableBitmap(this, "print_options_bg_dark", 22);
m_selected_disabled_bk = ScalableBitmap(this, "print_options_bg_disabled", 22);
m_selected_disabled_bk_dark = ScalableBitmap(this, "print_options_bg_disabled_dark", 22);
// update the options
update_options(ops);
@ -4914,9 +4916,18 @@ void PrintOptionItem::doRender(wxDC& dc)
/*selected*/
auto selected_left = selected * PRINT_OPT_WIDTH + FromDIP(4);
if (m_enable) {
if (!wxGetApp().dark_mode()) {
dc.DrawBitmap(m_selected_bk.bmp(), selected_left, (size.y - m_selected_bk.GetBmpHeight()) / 2);
} else {
dc.DrawBitmap(m_selected_disbabled_bk.bmp(), selected_left, (size.y - m_selected_disbabled_bk.GetBmpHeight()) / 2);
dc.DrawBitmap(m_selected_bk_dark.bmp(), selected_left, (size.y - m_selected_bk_dark.GetBmpHeight()) / 2);
}
} else {
if (!wxGetApp().dark_mode()) {
dc.DrawBitmap(m_selected_disabled_bk.bmp(), selected_left, (size.y - m_selected_disabled_bk.GetBmpHeight()) / 2);
} else {
dc.DrawBitmap(m_selected_bk_dark.bmp(), selected_left, (size.y - m_selected_bk_dark.GetBmpHeight()) / 2);
}
}
for (auto it = m_ops.begin(); it != m_ops.end(); ++it)

View File

@ -177,7 +177,9 @@ private:
private:
ScalableBitmap m_selected_bk;
ScalableBitmap m_selected_disbabled_bk;
ScalableBitmap m_selected_bk_dark;
ScalableBitmap m_selected_disabled_bk;
ScalableBitmap m_selected_disabled_bk_dark;
std::vector<POItem> m_ops;
std::string selected_key;
std::string m_param;