mirror of https://github.com/buggins/dlangide.git
dark theme support
This commit is contained in:
parent
90337397b4
commit
6995a7dc46
|
@ -17,6 +17,8 @@ extern (C) int UIAppMain(string[] args) {
|
||||||
// embed non-standard resources listed in views/resources.list into executable
|
// embed non-standard resources listed in views/resources.list into executable
|
||||||
embeddedResourceList.addResources(embedResourcesFromList!("resources.list")());
|
embeddedResourceList.addResources(embedResourcesFromList!("resources.list")());
|
||||||
|
|
||||||
|
Platform.instance.uiTheme = "ide_theme_default";
|
||||||
|
|
||||||
// you can override default hinting mode here
|
// you can override default hinting mode here
|
||||||
//FontManager.hintingMode = HintingMode.Light;
|
//FontManager.hintingMode = HintingMode.Light;
|
||||||
//FontManager.hintingMode = HintingMode.AutoHint;
|
//FontManager.hintingMode = HintingMode.AutoHint;
|
||||||
|
|
|
@ -24,7 +24,7 @@ class DSourceEdit : SourceEdit {
|
||||||
this(string ID) {
|
this(string ID) {
|
||||||
super(ID);
|
super(ID);
|
||||||
styleId = null;
|
styleId = null;
|
||||||
backgroundColor = 0xFFFFFF;
|
backgroundColor = style.customColor("edit_background");
|
||||||
setTokenHightlightColor(TokenCategory.Comment, 0x008000); // green
|
setTokenHightlightColor(TokenCategory.Comment, 0x008000); // green
|
||||||
setTokenHightlightColor(TokenCategory.Keyword, 0x0000FF); // blue
|
setTokenHightlightColor(TokenCategory.Keyword, 0x0000FF); // blue
|
||||||
setTokenHightlightColor(TokenCategory.String, 0xA31515); // brown
|
setTokenHightlightColor(TokenCategory.String, 0xA31515); // brown
|
||||||
|
@ -42,6 +42,12 @@ class DSourceEdit : SourceEdit {
|
||||||
this() {
|
this() {
|
||||||
this("SRCEDIT");
|
this("SRCEDIT");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// handle theme change: e.g. reload some themed resources
|
||||||
|
override void onThemeChanged() {
|
||||||
|
backgroundColor = style.customColor("edit_background");
|
||||||
|
}
|
||||||
|
|
||||||
protected IDESettings _settings;
|
protected IDESettings _settings;
|
||||||
@property DSourceEdit settings(IDESettings s) {
|
@property DSourceEdit settings(IDESettings s) {
|
||||||
_settings = s;
|
_settings = s;
|
||||||
|
|
|
@ -424,7 +424,7 @@ class IDEFrame : AppFrame {
|
||||||
mainMenuItems.add(helpItem);
|
mainMenuItems.add(helpItem);
|
||||||
|
|
||||||
MainMenu mainMenu = new MainMenu(mainMenuItems);
|
MainMenu mainMenu = new MainMenu(mainMenuItems);
|
||||||
mainMenu.backgroundColor = 0xd6dbe9;
|
//mainMenu.backgroundColor = 0xd6dbe9;
|
||||||
return mainMenu;
|
return mainMenu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,9 @@ class HomeScreen : ScrollWidget {
|
||||||
protected VerticalLayout _recentItems;
|
protected VerticalLayout _recentItems;
|
||||||
this(string ID, IDEFrame frame) {
|
this(string ID, IDEFrame frame) {
|
||||||
super(ID);
|
super(ID);
|
||||||
backgroundColor = 0xFFFFFF;
|
styleId = STYLE_EDIT_BOX;
|
||||||
_frame = frame;
|
_frame = frame;
|
||||||
|
uint linkColor = currentTheme.customColor("link_color", 0x2020FF);
|
||||||
_content = new HorizontalLayout("HOME_SCREEN_BODY");
|
_content = new HorizontalLayout("HOME_SCREEN_BODY");
|
||||||
_content.layoutWidth(FILL_PARENT).layoutHeight(FILL_PARENT);
|
_content.layoutWidth(FILL_PARENT).layoutHeight(FILL_PARENT);
|
||||||
VerticalLayout _column1 = new VerticalLayout();
|
VerticalLayout _column1 = new VerticalLayout();
|
||||||
|
@ -24,11 +25,11 @@ class HomeScreen : ScrollWidget {
|
||||||
_column2.layoutWidth(FILL_PARENT).layoutHeight(FILL_PARENT).padding(Rect(20, 20, 20, 20));
|
_column2.layoutWidth(FILL_PARENT).layoutHeight(FILL_PARENT).padding(Rect(20, 20, 20, 20));
|
||||||
_content.addChild(_column1);
|
_content.addChild(_column1);
|
||||||
_content.addChild(_column2);
|
_content.addChild(_column2);
|
||||||
_column1.addChild((new TextWidget(null, "Dlang IDE"d)).fontSize(32).textColor(0x000080));
|
_column1.addChild((new TextWidget(null, "Dlang IDE"d)).fontSize(32).textColor(linkColor));
|
||||||
_column1.addChild((new TextWidget(null, "D language IDE written in D"d)).fontSize(20));
|
_column1.addChild((new TextWidget(null, "D language IDE written in D"d)).fontSize(20));
|
||||||
_column1.addChild((new TextWidget(null, "(c) Vadim Lopatin 2015"d)).fontSize(22).textColor(0x000080));
|
_column1.addChild((new TextWidget(null, "(c) Vadim Lopatin 2015"d)).fontSize(22).textColor(linkColor));
|
||||||
_column1.addChild(new VSpacer());
|
_column1.addChild(new VSpacer());
|
||||||
_column1.addChild((new TextWidget(null, "Start with:"d)).fontSize(20).textColor(0x000040));
|
_column1.addChild((new TextWidget(null, "Start with:"d)).fontSize(20).textColor(linkColor));
|
||||||
_startItems = new VerticalLayout();
|
_startItems = new VerticalLayout();
|
||||||
_recentItems = new VerticalLayout();
|
_recentItems = new VerticalLayout();
|
||||||
_startItems.addChild(new ImageTextButton(ACTION_FILE_OPEN_WORKSPACE));
|
_startItems.addChild(new ImageTextButton(ACTION_FILE_OPEN_WORKSPACE));
|
||||||
|
@ -36,11 +37,11 @@ class HomeScreen : ScrollWidget {
|
||||||
_startItems.addChild(new ImageTextButton(ACTION_FILE_NEW_PROJECT));
|
_startItems.addChild(new ImageTextButton(ACTION_FILE_NEW_PROJECT));
|
||||||
_column1.addChild(_startItems);
|
_column1.addChild(_startItems);
|
||||||
_column1.addChild(new VSpacer());
|
_column1.addChild(new VSpacer());
|
||||||
_column1.addChild((new TextWidget(null, "Recent:"d)).fontSize(20).textColor(0x000040));
|
_column1.addChild((new TextWidget(null, "Recent:"d)).fontSize(20).textColor(linkColor));
|
||||||
_recentItems.addChild((new TextWidget(null, "No recent items"d)));
|
_recentItems.addChild((new TextWidget(null, "No recent items"d)));
|
||||||
_column1.addChild(_recentItems);
|
_column1.addChild(_recentItems);
|
||||||
_column1.addChild(new VSpacer());
|
_column1.addChild(new VSpacer());
|
||||||
_column2.addChild((new TextWidget(null, "Useful Links:"d)).fontSize(20).textColor(0x000040));
|
_column2.addChild((new TextWidget(null, "Useful Links:"d)).fontSize(20).textColor(linkColor));
|
||||||
_column2.addChild(new UrlImageTextButton(null, "D Programming Language"d, "http://dlang.org/"));
|
_column2.addChild(new UrlImageTextButton(null, "D Programming Language"d, "http://dlang.org/"));
|
||||||
_column2.addChild(new UrlImageTextButton(null, "DUB repository"d, "http://code.dlang.org/"));
|
_column2.addChild(new UrlImageTextButton(null, "DUB repository"d, "http://code.dlang.org/"));
|
||||||
_column2.addChild(new UrlImageTextButton(null, "DLangUI on GitHub"d, "https://github.com/buggins/dlangui"));
|
_column2.addChild(new UrlImageTextButton(null, "DLangUI on GitHub"d, "https://github.com/buggins/dlangui"));
|
||||||
|
|
|
@ -143,7 +143,9 @@ SettingsPage createSettingsPages() {
|
||||||
texted.addCheckbox("editors/textEditor/smartIndents", UIString("Smart indents"d));
|
texted.addCheckbox("editors/textEditor/smartIndents", UIString("Smart indents"d));
|
||||||
texted.addCheckbox("editors/textEditor/smartIndentsAfterPaste", UIString("Smart indent after paste"d));
|
texted.addCheckbox("editors/textEditor/smartIndentsAfterPaste", UIString("Smart indent after paste"d));
|
||||||
SettingsPage ui = res.addChild("interface", UIString("Interface"d));
|
SettingsPage ui = res.addChild("interface", UIString("Interface"d));
|
||||||
ui.addStringComboBox("interface/theme", UIString("Theme"d), [StringListValue("theme_default", "Default"d), StringListValue("theme_dark", "Dark"d)]);
|
ui.addStringComboBox("interface/theme", UIString("Theme"d), [
|
||||||
|
StringListValue("ide_theme_default", "Default"d),
|
||||||
|
StringListValue("ide_theme_dark", "Dark"d)]);
|
||||||
ui.addStringComboBox("interface/language", UIString("Language"d), [StringListValue("en", "English"d), StringListValue("ru", "Russian"d)]);
|
ui.addStringComboBox("interface/language", UIString("Language"d), [StringListValue("en", "English"d), StringListValue("ru", "Russian"d)]);
|
||||||
ui.addIntComboBox("interface/hintingMode", UIString("Font hinting mode"d), [StringListValue(0, "Normal"d), StringListValue(1, "Force Auto Hint"d),
|
ui.addIntComboBox("interface/hintingMode", UIString("Font hinting mode"d), [StringListValue(0, "Normal"d), StringListValue(1, "Force Auto Hint"d),
|
||||||
StringListValue(2, "Disabled"d), StringListValue(3, "Light"d)]);
|
StringListValue(2, "Disabled"d), StringListValue(3, "Light"d)]);
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<theme id="ide_theme_dark" parent="theme_dark"
|
||||||
|
fontSize="12"
|
||||||
|
fontFace="Verdana,Arial,DejaVu Sans"
|
||||||
|
fontFamily="SansSerif"
|
||||||
|
textColor="#E0E0E0"
|
||||||
|
>
|
||||||
|
<color id="edit_background" value="#070808"/>
|
||||||
|
<color id="link_color" value="#2020FF"/>
|
||||||
|
<drawable id="btn_check" value="btn_check_dark"/>
|
||||||
|
</theme>
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<theme id="ide_theme_default" parent="theme_default"
|
||||||
|
fontSize="12"
|
||||||
|
fontFace="Verdana,Arial,DejaVu Sans"
|
||||||
|
fontFamily="SansSerif"
|
||||||
|
>
|
||||||
|
<color id="edit_background" value="#FFFFFF"/>
|
||||||
|
<color id="link_color" value="#2020FF"/>
|
||||||
|
<drawable id="btn_check" value="btn_check"/>
|
||||||
|
</theme>
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
res/ide_theme_default.xml
|
||||||
|
res/ide_theme_dark.xml
|
||||||
res/i18n/en.ini
|
res/i18n/en.ini
|
||||||
res/i18n/ru.ini
|
res/i18n/ru.ini
|
||||||
res/mdpi/cr3_logo.png
|
res/mdpi/cr3_logo.png
|
||||||
|
|
Loading…
Reference in New Issue