hrev45586 adds 1 changeset to branch 'master' old head: ec63fd32491c897b7ebf5911f2a37421d61dcd54 new head: ed08c5287ab44b9e5ea3c61ec15310646c0ab528 overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=ed08c52+%5Eec63fd3 ---------------------------------------------------------------------------- ed08c52: Update CPUFrequency layout a bit * Use font relative insets and spacing for window. * Make the input box for Integration Time more reasonably sized and right align the label. * Make the Install replicant into Deskbar button flush right. * Use the standard amount of space between the Defaults and Revert buttons. [ John Scipione <jscipione@xxxxxxxxx> ] ---------------------------------------------------------------------------- Revision: hrev45586 Commit: ed08c5287ab44b9e5ea3c61ec15310646c0ab528 URL: http://cgit.haiku-os.org/haiku/commit/?id=ed08c52 Author: John Scipione <jscipione@xxxxxxxxx> Date: Mon Apr 29 05:20:52 2013 UTC ---------------------------------------------------------------------------- 2 files changed, 11 insertions(+), 11 deletions(-) src/preferences/cpufrequency/CPUFrequencyView.cpp | 13 ++++++++----- src/preferences/cpufrequency/PreferencesWindow.h | 9 +++------ ---------------------------------------------------------------------------- diff --git a/src/preferences/cpufrequency/CPUFrequencyView.cpp b/src/preferences/cpufrequency/CPUFrequencyView.cpp index 8ec880e..b0e1adf 100644 --- a/src/preferences/cpufrequency/CPUFrequencyView.cpp +++ b/src/preferences/cpufrequency/CPUFrequencyView.cpp @@ -64,18 +64,21 @@ CPUFrequencyView::CPUFrequencyView(BRect frame, BBox *dynamicBox = new BBox(rect, "dynamicBox"); dynamicBox->SetLabel(B_TRANSLATE("Dynamic stepping")); BGroupLayout* dynamicLayout = new BGroupLayout(B_VERTICAL); - dynamicLayout->SetInsets(10, dynamicBox->TopBorderOffset() * 2 + 10, 10, - 10); - dynamicLayout->SetSpacing(10); + dynamicLayout->SetInsets(B_USE_DEFAULT_SPACING, + dynamicBox->TopBorderOffset() * 2 + 10, + B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING); + dynamicLayout->SetSpacing(B_USE_DEFAULT_SPACING); dynamicBox->SetLayout(dynamicLayout); mainLayout->AddView(dynamicBox); fColorStepView = new ColorStepView(frame); fColorStepView->SetFrequencys(fDriverInterface.GetCpuFrequencyStates()); - fIntegrationTime = new BTextControl(BRect(0,0,Bounds().Width(),10), + fIntegrationTime = new BTextControl(BRect(0, 0, Bounds().Width(), 10), "intergal", B_TRANSLATE("Integration time [ms]: "), "", new BMessage(kIntegrationTimeChanged)); + fIntegrationTime->SetDivider(Bounds().Width() * 3 / 4); + fIntegrationTime->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT); dynamicLayout->AddView(fColorStepView); dynamicLayout->AddView(fIntegrationTime); @@ -97,8 +100,8 @@ CPUFrequencyView::CPUFrequencyView(BRect frame, new BMessage(kInstallIntoDeskbar)); statusLayout->AddView(fStatusView); - statusLayout->AddView(fInstallButton); statusLayout->AddItem(BSpaceLayoutItem::CreateGlue()); + statusLayout->AddView(fInstallButton); } diff --git a/src/preferences/cpufrequency/PreferencesWindow.h b/src/preferences/cpufrequency/PreferencesWindow.h index 914beec..03e9900 100644 --- a/src/preferences/cpufrequency/PreferencesWindow.h +++ b/src/preferences/cpufrequency/PreferencesWindow.h @@ -356,13 +356,10 @@ PreferencesWindow<Preferences>::PreferencesWindow(const char* title, BGroupView* buttonView = new BGroupView(B_HORIZONTAL); fDefaultButton = new BButton(B_TRANSLATE("Defaults"), new BMessage(kDefaultMsg)); - buttonView->AddChild(fDefaultButton); - buttonView->GetLayout()->AddItem( - BSpaceLayoutItem::CreateHorizontalStrut(7)); + fRevertButton = new BButton(B_TRANSLATE("Revert"), new BMessage(kRevertMsg)); - buttonView->AddChild(fRevertButton); buttonView->GetLayout()->AddItem(BSpaceLayoutItem::CreateGlue()); @@ -370,8 +367,8 @@ PreferencesWindow<Preferences>::PreferencesWindow(const char* title, SetLayout(new BGroupLayout(B_VERTICAL)); fRootLayout = new BGroupLayout(B_VERTICAL); - fRootLayout->SetInsets(10, 10, 10, 10); - fRootLayout->SetSpacing(10); + fRootLayout->SetInsets(B_USE_DEFAULT_SPACING); + fRootLayout->SetSpacing(B_USE_DEFAULT_SPACING); BView* rootView = new BView("root view", 0, fRootLayout); AddChild(rootView); rootView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));