1 /*
2 * Copyright 2009-2016 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 * Ryan Leavengood, leavengood@gmail.com
7 * John Scipione, jscipione@gmail.com
8 */
9
10
11 #include <DefaultSettingsView.h>
12
13 #include <LayoutBuilder.h>
14 #include <StringView.h>
15
16
17 namespace BPrivate {
18
19 // Provides a consistent look for the settings view for screen savers
20 // that don't provide any configuration settings.
21 void
BuildDefaultSettingsView(BView * view,const char * moduleName,const char * info)22 BuildDefaultSettingsView(BView* view, const char* moduleName, const char* info)
23 {
24 view->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
25
26 BStringView* nameStringView = new BStringView("module", moduleName);
27 nameStringView->SetFont(be_bold_font);
28
29 BStringView* infoStringView = new BStringView("info", info);
30
31 BLayoutBuilder::Group<>(view, B_VERTICAL, B_USE_SMALL_SPACING)
32 .Add(nameStringView)
33 .Add(infoStringView)
34 .AddGlue()
35 .SetInsets(B_USE_DEFAULT_SPACING)
36 .End();
37 }
38
39 } // namespace BPrivate
40