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:
@@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2009, Haiku.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*
|
||||||
|
* Authors:
|
||||||
|
* Ryan Leavengood, [email protected]
|
||||||
|
*/
|
||||||
|
#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
|
||||||
|
|
||||||
@@ -53,4 +53,4 @@ class ScreenSaverRunner {
|
|||||||
volatile bool fQuitting;
|
volatile bool fQuitting;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //SCREEN_SAVER_THREAD_H
|
#endif // SCREEN_SAVER_RUNNER_H
|
||||||
|
|||||||
Reference in New Issue
Block a user