PowerStatus: make tab size dependent on font size.
This commit is contained in:
parent
8ddec194c6
commit
546065592d
@ -343,15 +343,17 @@ ExtendedInfoWindow::ExtendedInfoWindow(PowerStatusDriverInterface* interface)
|
||||
{
|
||||
fDriverInterface->AcquireReference();
|
||||
|
||||
float scale = be_plain_font->Size() / 12.0f;
|
||||
float tabHeight = 70.0f * scale;
|
||||
BRect batteryRect(0, 0, 50 * scale, 50 * scale);
|
||||
fBatteryTabView = new BatteryTabView("tabview");
|
||||
fBatteryTabView->SetBorder(B_NO_BORDER);
|
||||
fBatteryTabView->SetTabHeight(70.0f);
|
||||
fBatteryTabView->SetTabHeight(tabHeight);
|
||||
fBatteryTabView->SetTabSide(BTabView::kLeftSide);
|
||||
BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
|
||||
.SetInsets(B_USE_DEFAULT_SPACING, 0, B_USE_DEFAULT_SPACING, 0)
|
||||
.Add(fBatteryTabView);
|
||||
|
||||
BRect batteryRect(0, 0, 50, 30);
|
||||
for (int i = 0; i < interface->GetBatteryCount(); i++) {
|
||||
BatteryInfoView* batteryInfoView = new BatteryInfoView();
|
||||
ExtPowerStatusView* view = new ExtPowerStatusView(interface,
|
||||
|
@ -277,7 +277,7 @@ PowerStatusView::Draw(BRect updateRect)
|
||||
void
|
||||
PowerStatusView::DrawTo(BView* view, BRect rect)
|
||||
{
|
||||
bool inside = rect.Width() >= 50.0f && rect.Height() >= 40.0f;
|
||||
bool inside = rect.Width() >= 40.0f && rect.Height() >= 40.0f;
|
||||
|
||||
font_height fontHeight;
|
||||
view->GetFontHeight(&fontHeight);
|
||||
|
Loading…
Reference in New Issue
Block a user