Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix edit button of printer combo box not updates its color after theme switch #5412

Merged
merged 3 commits into from
May 23, 2024

Conversation

yw4z
Copy link
Contributor

@yw4z yw4z commented May 20, 2024

Description

Other combos uses same method but this one is missing for printer combo box

Note bug only appear if you start with light theme then switch to dark theme. Button rendered with normal color if orca starts with dark theme. And bug exist for opposite

Screenshots/Recordings/Graphs

all edit buttons uses same color with with fix. Button uses #949494 color
Screenshot-20240520231238

printer combo edit button uses color from light theme without fix. Button uses #7C8282 color
Screenshot-20240520232259

it exist for other 2 types of combo boxes but not on printer combo box

void PlaterPresetComboBox::msw_rescale()
{
PresetComboBox::msw_rescale();
SetMinSize({-1, 30 * m_em_unit / 10});
if (clr_picker)
clr_picker->SetSize(20 * m_em_unit / 10, 20 * m_em_unit / 10);
// BBS
if (edit_btn != nullptr)
edit_btn->msw_rescale();
}

void GUI::CalibrateFilamentComboBox::msw_rescale()
{
if (clr_picker) {
clr_picker->SetSize(FromDIP(20), FromDIP(20));
clr_picker->SetBitmap(*get_extruder_color_icon(m_filament_color, m_tray_name, FromDIP(20), FromDIP(20)));
}
// BBS
if (edit_btn != nullptr)
edit_btn->msw_rescale();
}

Tests

windows 10

@yw4z yw4z marked this pull request as draft May 21, 2024 21:49
@yw4z yw4z marked this pull request as ready for review May 21, 2024 23:10
@SoftFever
Copy link
Owner

Thanks @yw4z
The changes do not look correct.

We shouldn't declare another edit_btn variable in the base class. Can you check its child classes to see which one didn’t call edit_btn->msw_rescale() and add it there?

@yw4z
Copy link
Contributor Author

yw4z commented May 22, 2024

@SoftFever yep solution was simpler. just a missing line

@yw4z yw4z changed the title Fix edit button of printer combo box not updates its color for dark theme Fix edit button of printer combo box not updates its color after theme switch May 22, 2024
Copy link
Owner

@SoftFever SoftFever left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SoftFever SoftFever merged commit aa33050 into SoftFever:main May 23, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants