Adding a private header with a method that can be used to provide a consistent

default look for the settings of screen savers without complicated settings
views. This is based on the code originally in the ScreenSaver preferences
window.

Also fixed a type in the ScreenSaverRunner header.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33400 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ryan Leavengood 2009-10-01 19:53:23 +00:00
parent fdd05057a9
commit 7d183c0492
2 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,35 @@
/*
* Copyright 2009, Haiku.
* Distributed under the terms of the MIT License.
*
* Authors:
* Ryan Leavengood, leavengood@gmail.com
*/
#ifndef BUILD_SCREEN_SAVER_DEFAULT_SETTINGS_VIEW
#define BUILD_SCREEN_SAVER_DEFAULT_SETTINGS_VIEW
#include <StringView.h>
#include <View.h>
// This is used to provide a consistent look for the settings view for screen
// savers without any configuration.
void
BuildScreenSaverDefaultSettingsView(BView* view, const char* moduleName, const char* info)
{
BRect rect(15, 15, 20, 20);
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);
}
#endif // BUILD_SCREEN_SAVER_DEFAULT_SETTINGS_VIEW

View File

@ -53,4 +53,4 @@ class ScreenSaverRunner {
volatile bool fQuitting;
};
#endif //SCREEN_SAVER_THREAD_H
#endif // SCREEN_SAVER_RUNNER_H