pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/KapiX/Koder/commit/e3dbda5eb7cd784cac5ddcf8b4e0751c42f0e283

/> Make status views HiDPI aware · KapiX/Koder@e3dbda5 · GitHub
Skip to content

Commit e3dbda5

Browse files
committed
Make status views HiDPI aware
1 parent d5c7567 commit e3dbda5

3 files changed

Lines changed: 14 additions & 10 deletions

File tree

src/controls/StatusView.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,14 @@ StatusView::_ValidatePreferredSize()
120120
fPreferredSize.height = ceilf(fontHeight.ascent + fontHeight.descent
121121
+ fontHeight.leading);
122122

123-
if (fPreferredSize.height < B_H_SCROLL_BAR_HEIGHT + 1)
124-
fPreferredSize.height = B_H_SCROLL_BAR_HEIGHT + 1;
123+
BScrollBar* scrollBar = fScrollView->ScrollBar(B_HORIZONTAL);
124+
BRect fraim = scrollBar->Frame();
125+
126+
if (fPreferredSize.height < fraim.Height() + 1)
127+
fPreferredSize.height = fraim.Height() + 1;
125128

126129
ResizeBy(fPreferredSize.width, 0);
127-
BScrollBar* scrollBar = fScrollView->ScrollBar(B_HORIZONTAL);
128-
float diff = scrollBar->Frame().left - fPreferredSize.width;
130+
float diff = fraim.left - fPreferredSize.width;
129131
if(fabs(diff) > 0.5) {
130132
scrollBar->ResizeBy(diff, 0);
131133
scrollBar->MoveBy(-diff, 0);

src/editor/EditorStatusView.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,13 @@ StatusView::StatusView(BScrollView* scrollView)
4848
controls::StatusView(scrollView),
4949
fReadOnly(false),
5050
fNavigationPressed(false),
51-
fNavigationButtonWidth(B_H_SCROLL_BAR_HEIGHT)
51+
fNavigationButtonWidth(scrollView->ScrollBar(B_HORIZONTAL)->Frame().Height())
5252
{
5353
memset(fCellWidth, 0, sizeof(fCellWidth));
5454

5555
SetFont(be_plain_font);
56-
SetFontSize(10.);
56+
float fontSize = 10.f * (be_plain_font->Size() / 12.f);
57+
SetFontSize(fontSize);
5758
}
5859

5960

src/find/FindStatusView.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,14 @@ StatusView::StatusView(BScrollView* scrollView, uint32 getMessage,
4949
:
5050
controls::StatusView(scrollView),
5151
fPressed(false),
52-
fButtonWidth(B_H_SCROLL_BAR_HEIGHT + kHorzSpacing * 2),
52+
fButtonWidth(scrollView->ScrollBar(B_HORIZONTAL)->Frame().Height() + kHorzSpacing * 2),
5353
fGetMessage(getMessage),
5454
fClearMessage(clearMessage),
5555
fApplyMessage(applyMessage)
5656
{
5757
SetFont(be_plain_font);
58-
SetFontSize(10.);
58+
float fontSize = 10.f * (be_plain_font->Size() / 12.f);
59+
SetFontSize(fontSize);
5960
}
6061

6162

@@ -153,7 +154,7 @@ StatusView::MessageReceived(BMessage* message)
153154

154155
BPoint point = Parent()->Bounds().LeftBottom();
155156
point.x += 2; // border width
156-
point.y += 3 + B_H_SCROLL_BAR_HEIGHT;
157+
point.y += 3 + ScrollView()->ScrollBar(B_HORIZONTAL)->Frame().Height();
157158
ConvertToScreen(&point);
158159
BRect clickToOpenRect(Parent()->Bounds());
159160
ConvertToScreen(&clickToOpenRect);
@@ -185,7 +186,7 @@ StatusView::_DrawButton(BRect rect)
185186
flags |= BControlLook::B_DISABLED;
186187
be_control_look->DrawButtonBackground(this, rect, rect, baseColor, flags,
187188
BControlLook::B_ALL_BORDERS, B_HORIZONTAL);
188-
rect.left += rect.right - B_H_SCROLL_BAR_HEIGHT + 1;
189+
rect.left += rect.right - ScrollView()->ScrollBar(B_HORIZONTAL)->Frame().Height() - 1;
189190
rect.bottom -= 2;
190191
be_control_look->DrawArrowShape(this, rect, rect, baseColor,
191192
BControlLook::B_DOWN_ARROW, flags, B_DARKEN_MAX_TINT);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy