Skip to content

Commit

Permalink
More linux scaling issue fixes
Browse files Browse the repository at this point in the history
- Fix blurry down arrow on dropdown toolbar buttons
- Fix tab width calculation
  • Loading branch information
sirjuddington committed Jun 1, 2024
1 parent 1f32dfd commit fabf6fc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/UI/SAuiTabArt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,14 +448,14 @@ wxSize SAuiTabArt::GetTabSize(

// if close buttons are enabled, add space for one
if (close_buttons_)
tab_width += m_activeCloseBmp.GetPreferredBitmapSizeFor(wnd).x + padding_;
tab_width += wnd->FromPhys(m_activeCloseBmp.GetPreferredBitmapSizeFor(wnd).x) + padding_;

// if there's a bitmap, add space for it
if (bitmap.IsOk())
{
tab_width += bitmap.GetPreferredBitmapSizeFor(wnd).x;
tab_width += wnd->FromPhys(bitmap.GetPreferredBitmapSizeFor(wnd).x);
tab_width += padding_; // right side bitmap padding
tab_height = wxMax(tab_height, bitmap.GetPreferredBitmapSizeFor(wnd).y);
tab_height = wxMax(tab_height, wnd->FromPhys(bitmap.GetPreferredBitmapSizeFor(wnd).y));
}
else if (tabs_condensed)
tab_width += padding_ * 2; // a bit extra padding if there isn't an icon in condensed mode
Expand Down
13 changes: 8 additions & 5 deletions src/UI/SToolBar/SToolBarButton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,14 +443,17 @@ void SToolBarButton::onPaint(wxPaintEvent& e)
if (menu_dropdown_)
{
static auto arrow_down = icons::getInterfaceIcon("arrow-down", FromDIP(icon_size_ * 0.75))
.GetBitmap(wxDefaultSize);
.GetBitmapFor(this);

auto a_width = FromPhys(arrow_down.GetWidth());
auto a_height = FromPhys(arrow_down.GetHeight());

gc->DrawBitmap(
arrow_down,
width - arrow_down.GetWidth() - pad_outer_,
height / 2. - arrow_down.GetHeight() / 2.,
arrow_down.GetWidth(),
arrow_down.GetHeight());
width - a_width - pad_outer_,
height / 2. - a_height / 2.,
a_width,
a_height);
}

delete gc;
Expand Down

0 comments on commit fabf6fc

Please sign in to comment.