Screensaver: Update Default Settings View to use Layout
and standard insets so that they match other screen savers
This commit is contained in:
parent
63d59e1081
commit
3801c37b90
@ -1,22 +1,24 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2009, Haiku.
|
* Copyright 2009 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
* Ryan Leavengood, leavengood@gmail.com
|
* Ryan Leavengood, leavengood@gmail.com
|
||||||
*/
|
*/
|
||||||
#ifndef BUILD_SCREEN_SAVER_DEFAULT_SETTINGS_VIEW
|
#ifndef _BUILD_SCREEN_SAVER_DEFAULT_SETTINGS_VIEW_H
|
||||||
#define BUILD_SCREEN_SAVER_DEFAULT_SETTINGS_VIEW
|
#define _BUILD_SCREEN_SAVER_DEFAULT_SETTINGS_VIEW_H
|
||||||
|
|
||||||
|
|
||||||
class BView;
|
class BView;
|
||||||
|
|
||||||
namespace BPrivate {
|
namespace BPrivate {
|
||||||
|
|
||||||
void BuildScreenSaverDefaultSettingsView(BView* view, const char* moduleName, const char* info);
|
void
|
||||||
|
BuildScreenSaverDefaultSettingsView(BView* view, const char* moduleName,
|
||||||
|
const char* info);
|
||||||
|
|
||||||
}
|
} // namespace BPrivate
|
||||||
|
|
||||||
|
|
||||||
#endif // BUILD_SCREEN_SAVER_DEFAULT_SETTINGS_VIEW
|
#endif // _BUILD_SCREEN_SAVER_DEFAULT_SETTINGS_VIEW_H
|
||||||
|
|
||||||
|
@ -1,36 +1,40 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2009, Haiku.
|
* Copyright 2009-2016 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
* Ryan Leavengood, leavengood@gmail.com
|
* Ryan Leavengood, leavengood@gmail.com
|
||||||
|
* John Scipione, jscipione@gmail.com
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <BuildScreenSaverDefaultSettingsView.h>
|
#include <BuildScreenSaverDefaultSettingsView.h>
|
||||||
|
|
||||||
|
#include <LayoutBuilder.h>
|
||||||
#include <StringView.h>
|
#include <StringView.h>
|
||||||
#include <View.h>
|
|
||||||
|
|
||||||
|
|
||||||
namespace BPrivate {
|
namespace BPrivate {
|
||||||
|
|
||||||
// This is used to provide a consistent look for the settings view for screen
|
// Provides a consistent look for the settings view for screen savers
|
||||||
// savers without any configuration.
|
// that don't provide any configuration settings.
|
||||||
void
|
void
|
||||||
BuildScreenSaverDefaultSettingsView(BView* view, const char* moduleName, const char* info)
|
BuildScreenSaverDefaultSettingsView(BView* view, const char* moduleName,
|
||||||
|
const char* info)
|
||||||
{
|
{
|
||||||
BRect rect(15, 15, 20, 20);
|
view->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
|
||||||
BStringView* stringView = new BStringView(rect, "module", moduleName);
|
|
||||||
stringView->SetFont(be_bold_font);
|
|
||||||
stringView->ResizeToPreferred();
|
|
||||||
view->AddChild(stringView);
|
|
||||||
|
|
||||||
rect.OffsetBy(0, stringView->Bounds().Height() + 4);
|
|
||||||
stringView = new BStringView(rect, "info", info);
|
|
||||||
stringView->ResizeToPreferred();
|
|
||||||
view->AddChild(stringView);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
BStringView* nameStringView = new BStringView("module", moduleName);
|
||||||
|
nameStringView->SetFont(be_bold_font);
|
||||||
|
|
||||||
|
BStringView* infoStringView = new BStringView("info", info);
|
||||||
|
|
||||||
|
BLayoutBuilder::Group<>(view, B_VERTICAL, B_USE_SMALL_SPACING)
|
||||||
|
.Add(nameStringView)
|
||||||
|
.Add(infoStringView)
|
||||||
|
.AddGlue()
|
||||||
|
.SetInsets(B_USE_DEFAULT_SPACING)
|
||||||
|
.End();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace BPrivate
|
||||||
|
Loading…
Reference in New Issue
Block a user