-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.d
25 lines (22 loc) · 832 Bytes
/
settings.d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import dlangui.core.settings;
import dlangui.core.i18n;
import dlangui.widgets.lists;
import dlangui.dialogs.settingsdialog;
StringListValue[] createIntValueList(int[] values, dstring suffix = ""d) {
import std.conv : to;
StringListValue[] res;
res.assumeSafeAppend();
foreach(n; values) {
res ~= StringListValue(n, to!dstring(n) ~ suffix);
}
return res;
}
SettingsPage createSettingsPages() {
import std.conv : to;
SettingsPage res = new SettingsPage("", UIString.fromRaw(""d));
SettingsPage ui = res.addChild("interface", UIString.fromId("OPTION_INTERFACE"c));
ui.addStringComboBox("interface/language", UIString.fromId("OPTION_LANGUAGE"c), [
StringListValue("en", "MENU_VIEW_LANGUAGE_EN"c),
StringListValue("cn", "MENU_VIEW_LANGUAGE_CN"c)]);
return res;
}