themed editor; dark theme fixes; fix project for search feature

This commit is contained in:
Vadim Lopatin 2015-03-10 10:46:36 +03:00
parent d9d61c7c46
commit 3d90b7b992
5 changed files with 31 additions and 9 deletions

View File

@ -241,6 +241,7 @@
<File path="src\dlangide\ui\frame.d" /> <File path="src\dlangide\ui\frame.d" />
<File path="src\dlangide\ui\homescreen.d" /> <File path="src\dlangide\ui\homescreen.d" />
<File path="src\dlangide\ui\outputpanel.d" /> <File path="src\dlangide\ui\outputpanel.d" />
<File path="src\dlangide\ui\searchPanel.d" />
<File path="src\dlangide\ui\settings.d" /> <File path="src\dlangide\ui\settings.d" />
<File path="src\dlangide\ui\wspanel.d" /> <File path="src\dlangide\ui\wspanel.d" />
</Folder> </Folder>

View File

@ -25,12 +25,7 @@ class DSourceEdit : SourceEdit {
super(ID); super(ID);
styleId = null; styleId = null;
backgroundColor = style.customColor("edit_background"); backgroundColor = style.customColor("edit_background");
setTokenHightlightColor(TokenCategory.Comment, 0x008000); // green onThemeChanged();
setTokenHightlightColor(TokenCategory.Keyword, 0x0000FF); // blue
setTokenHightlightColor(TokenCategory.String, 0xA31515); // brown
setTokenHightlightColor(TokenCategory.Character, 0xA31515); // brown
setTokenHightlightColor(TokenCategory.Error, 0xFF0000); // red
setTokenHightlightColor(TokenCategory.Comment_Documentation, 0x206000);
//setTokenHightlightColor(TokenCategory.Identifier, 0x206000); // no colors //setTokenHightlightColor(TokenCategory.Identifier, 0x206000); // no colors
MenuItem editPopupItem = new MenuItem(null); MenuItem editPopupItem = new MenuItem(null);
editPopupItem.add(ACTION_EDIT_COPY, ACTION_EDIT_PASTE, ACTION_EDIT_CUT, ACTION_EDIT_UNDO, ACTION_EDIT_REDO, ACTION_EDIT_INDENT, ACTION_EDIT_UNINDENT, ACTION_EDIT_TOGGLE_LINE_COMMENT, ACTION_GET_COMPLETIONS, ACTION_GO_TO_DEFINITION); editPopupItem.add(ACTION_EDIT_COPY, ACTION_EDIT_PASTE, ACTION_EDIT_CUT, ACTION_EDIT_UNDO, ACTION_EDIT_REDO, ACTION_EDIT_INDENT, ACTION_EDIT_UNINDENT, ACTION_EDIT_TOGGLE_LINE_COMMENT, ACTION_GET_COMPLETIONS, ACTION_GO_TO_DEFINITION);
@ -46,6 +41,14 @@ class DSourceEdit : SourceEdit {
/// handle theme change: e.g. reload some themed resources /// handle theme change: e.g. reload some themed resources
override void onThemeChanged() { override void onThemeChanged() {
backgroundColor = style.customColor("edit_background"); backgroundColor = style.customColor("edit_background");
setTokenHightlightColor(TokenCategory.Comment, style.customColor("syntax_highlight_comment")); // green
setTokenHightlightColor(TokenCategory.Keyword, style.customColor("syntax_highlight_keyword")); // blue
setTokenHightlightColor(TokenCategory.String, style.customColor("syntax_highlight_string")); // brown
setTokenHightlightColor(TokenCategory.Character, style.customColor("syntax_highlight_character")); // brown
setTokenHightlightColor(TokenCategory.Error, style.customColor("syntax_highlight_error")); // red
setTokenHightlightColor(TokenCategory.Comment_Documentation, style.customColor("syntax_highlight_comment_documentation"));
super.onThemeChanged();
} }
protected IDESettings _settings; protected IDESettings _settings;

View File

@ -7,7 +7,7 @@ import dlangui.widgets.lists;
import dlangui.dialogs.settingsdialog; import dlangui.dialogs.settingsdialog;
const AVAILABLE_THEMES = ["theme_default", "theme_dark"]; const AVAILABLE_THEMES = ["ide_theme_default", "ide_theme_dark"];
const AVAILABLE_LANGUAGES = ["en", "ru"]; const AVAILABLE_LANGUAGES = ["en", "ru"];
class IDESettings : SettingsFile { class IDESettings : SettingsFile {
@ -23,7 +23,7 @@ class IDESettings : SettingsFile {
ed.setBooleanDef("smartIndents", true); ed.setBooleanDef("smartIndents", true);
ed.setBooleanDef("smartIndentsAfterPaste", true); ed.setBooleanDef("smartIndentsAfterPaste", true);
Setting ui = uiSettings(); Setting ui = uiSettings();
ui.setStringDef("theme", "theme_default"); ui.setStringDef("theme", "ide_theme_default");
ui.setStringDef("language", "en"); ui.setStringDef("language", "en");
ui.setIntegerDef("hintingMode", 1); ui.setIntegerDef("hintingMode", 1);
ui.setIntegerDef("minAntialiasedFontSize", 0); ui.setIntegerDef("minAntialiasedFontSize", 0);
@ -62,7 +62,7 @@ class IDESettings : SettingsFile {
/// theme /// theme
@property string uiTheme() { @property string uiTheme() {
return limitString(uiSettings.getString("theme", "theme_default"), AVAILABLE_THEMES); return limitString(uiSettings.getString("theme", "ide_theme_default"), AVAILABLE_THEMES);
} }
/// theme /// theme
@property IDESettings uiTheme(string v) { @property IDESettings uiTheme(string v) {

View File

@ -7,5 +7,15 @@
> >
<color id="edit_background" value="#070808"/> <color id="edit_background" value="#070808"/>
<color id="link_color" value="#2020FF"/> <color id="link_color" value="#2020FF"/>
<color id="syntax_highlight_comment" value="#10C010"/>
<color id="syntax_highlight_keyword" value="#4080FF"/>
<color id="syntax_highlight_string" value="#C37525"/>
<color id="syntax_highlight_character" value="#C37525"/>
<color id="syntax_highlight_error" value="#FF0000"/>
<color id="syntax_highlight_comment_documentation" value="#50a000"/>
<drawable id="btn_check" value="btn_check_dark"/> <drawable id="btn_check" value="btn_check_dark"/>
</theme> </theme>

View File

@ -6,6 +6,14 @@
> >
<color id="edit_background" value="#FFFFFF"/> <color id="edit_background" value="#FFFFFF"/>
<color id="link_color" value="#2020FF"/> <color id="link_color" value="#2020FF"/>
<color id="syntax_highlight_comment" value="#008000"/>
<color id="syntax_highlight_keyword" value="#0000FF"/>
<color id="syntax_highlight_string" value="#a31515"/>
<color id="syntax_highlight_character" value="#a31515"/>
<color id="syntax_highlight_error" value="#FF0000"/>
<color id="syntax_highlight_comment_documentation" value="#206000"/>
<drawable id="btn_check" value="btn_check"/> <drawable id="btn_check" value="btn_check"/>
</theme> </theme>