Compare commits

...

1 Commits

4 changed files with 35 additions and 1 deletions

View File

@ -0,0 +1,5 @@
namespace BPrivate {
void AdoptScrollBarFontSize(BView*);
} // namespace BPrivate

View File

@ -9,6 +9,7 @@
#include "StatusView.h"
#include <StatusView.h>
#include <stdio.h>
#include <stdlib.h>
@ -63,7 +64,7 @@ void
StatusView::AttachedToWindow()
{
SetFont(be_plain_font);
SetFontSize(10. * be_plain_font->Size() / 12.f);
BPrivate::AdoptScrollBarFontSize(this);
BMessage message(UPDATE_STATUS);
message.AddInt32("line", 1);

View File

@ -56,6 +56,7 @@ for architectureObject in [ MultiArchSubDirSetup ] {
SettingsHandler.cpp
SettingsMessage.cpp
ShakeTrackingFilter.cpp
StatusView.cpp
StringForRate.cpp
StringForSize.cpp
StripeView.cpp

View File

@ -0,0 +1,27 @@
#include <Application.h>
#include <ControlLook.h>
#include <View.h>
#include <stdio.h>
namespace BPrivate {
void AdoptScrollBarFontSize(BView* view) {
float maxSize = be_control_look->GetScrollBarWidth();
BFont testFont = be_plain_font;
float currentSize;
font_height fontHeight;
for (float fontSize = 9.0F; fontSize < 48.0F; fontSize++) {
testFont.SetSize(fontSize);
testFont.GetHeight(&fontHeight);
currentSize = fontHeight.ascent + fontHeight.descent;
if (currentSize > maxSize) {
view->SetFontSize(fontSize -1);
break;
}
fontSize++;
}
}
} // namespace BPrivate