mirror of https://github.com/buggins/dlangui.git
themed editors
This commit is contained in:
parent
63e9d69b5c
commit
9ba372a504
|
@ -231,6 +231,8 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
|
||||||
protected uint _leftPaneBackgroundColor3 = 0xC0C0C0;
|
protected uint _leftPaneBackgroundColor3 = 0xC0C0C0;
|
||||||
protected uint _leftPaneLineNumberColor = 0x4060D0;
|
protected uint _leftPaneLineNumberColor = 0x4060D0;
|
||||||
protected uint _leftPaneLineNumberBackgroundColor = 0xF0F0F0;
|
protected uint _leftPaneLineNumberBackgroundColor = 0xF0F0F0;
|
||||||
|
protected uint _caretColor = 0x000000;
|
||||||
|
protected uint _caretColorReplace = 0x808080FF;
|
||||||
protected uint _iconsPaneWidth = 16;
|
protected uint _iconsPaneWidth = 16;
|
||||||
protected uint _foldingPaneWidth = 12;
|
protected uint _foldingPaneWidth = 12;
|
||||||
protected uint _modificationMarksPaneWidth = 4;
|
protected uint _modificationMarksPaneWidth = 4;
|
||||||
|
@ -273,11 +275,11 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void drawLeftPaneFolding(DrawBuf buf, Rect rc, int line) {
|
protected void drawLeftPaneFolding(DrawBuf buf, Rect rc, int line) {
|
||||||
buf.fillRect(rc, 0xFFFFFF);
|
buf.fillRect(rc, _leftPaneBackgroundColor2);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void drawLeftPaneIcons(DrawBuf buf, Rect rc, int line) {
|
protected void drawLeftPaneIcons(DrawBuf buf, Rect rc, int line) {
|
||||||
buf.fillRect(rc, 0xE0E0E0);
|
buf.fillRect(rc, _leftPaneBackgroundColor3);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void drawLeftPaneModificationMarks(DrawBuf buf, Rect rc, int line) {
|
protected void drawLeftPaneModificationMarks(DrawBuf buf, Rect rc, int line) {
|
||||||
|
@ -797,6 +799,20 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
|
||||||
return caretRc;
|
return caretRc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// handle theme change: e.g. reload some themed resources
|
||||||
|
override void onThemeChanged() {
|
||||||
|
_caretColor = style.customColor("edit_caret");
|
||||||
|
_caretColorReplace = style.customColor("edit_caret_replace");
|
||||||
|
_selectionColorFocused = style.customColor("editor_selection_focused");
|
||||||
|
_selectionColorNormal = style.customColor("editor_selection_normal");
|
||||||
|
_leftPaneBackgroundColor = style.customColor("editor_left_pane_background");
|
||||||
|
_leftPaneBackgroundColor2 = style.customColor("editor_left_pane_background2");
|
||||||
|
_leftPaneBackgroundColor3 = style.customColor("editor_left_pane_background3");
|
||||||
|
_leftPaneLineNumberColor = style.customColor("editor_left_pane_line_number_text");
|
||||||
|
_leftPaneLineNumberBackgroundColor = style.customColor("editor_left_pane_line_number_background");
|
||||||
|
super.onThemeChanged();
|
||||||
|
}
|
||||||
|
|
||||||
/// draws caret
|
/// draws caret
|
||||||
protected void drawCaret(DrawBuf buf) {
|
protected void drawCaret(DrawBuf buf) {
|
||||||
if (focused) {
|
if (focused) {
|
||||||
|
@ -810,8 +826,8 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
|
||||||
rc1.right = rc1.left + 1;
|
rc1.right = rc1.left + 1;
|
||||||
caretRc.left++;
|
caretRc.left++;
|
||||||
if (_replaceMode)
|
if (_replaceMode)
|
||||||
buf.fillRect(caretRc, 0x808080FF);
|
buf.fillRect(caretRc, _caretColorReplace);
|
||||||
buf.fillRect(rc1, 0x000000);
|
buf.fillRect(rc1, _caretColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,15 @@
|
||||||
<color id="window_background" value="#000000"/>
|
<color id="window_background" value="#000000"/>
|
||||||
<color id="dialog_background" value="#222222"/>
|
<color id="dialog_background" value="#222222"/>
|
||||||
<color id="edit_background" value="#070808"/>
|
<color id="edit_background" value="#070808"/>
|
||||||
|
<color id="edit_caret" value="#E0E0E0"/>
|
||||||
|
<color id="edit_caret_replace" value="#808080FF"/>
|
||||||
|
<color id="editor_selection_focused" value="#B080B0FF"/>
|
||||||
|
<color id="editor_selection_normal" value="#D080C0FF"/>
|
||||||
|
<color id="editor_left_pane_background" value="#030305"/>
|
||||||
|
<color id="editor_left_pane_background2" value="#080808"/>
|
||||||
|
<color id="editor_left_pane_background3" value="#040404"/>
|
||||||
|
<color id="editor_left_pane_line_number_text" value="#707070"/>
|
||||||
|
<color id="editor_left_pane_line_number_background" value="#060606"/>
|
||||||
|
|
||||||
<style id="BUTTON"
|
<style id="BUTTON"
|
||||||
backgroundImageId="btn_background_dark"
|
backgroundImageId="btn_background_dark"
|
||||||
|
|
|
@ -7,6 +7,15 @@
|
||||||
<color id="window_background" value="#FFFFFF"/>
|
<color id="window_background" value="#FFFFFF"/>
|
||||||
<color id="dialog_background" value="#EEEEEE"/>
|
<color id="dialog_background" value="#EEEEEE"/>
|
||||||
<color id="edit_background" value="#FFFFFF"/>
|
<color id="edit_background" value="#FFFFFF"/>
|
||||||
|
<color id="edit_caret" value="#000000"/>
|
||||||
|
<color id="edit_caret_replace" value="#808080FF"/>
|
||||||
|
<color id="editor_selection_focused" value="#B060A0FF"/>
|
||||||
|
<color id="editor_selection_normal" value="#D060A0FF"/>
|
||||||
|
<color id="editor_left_pane_background" value="#F4F4F4"/>
|
||||||
|
<color id="editor_left_pane_background2" value="#FFFFFF"/>
|
||||||
|
<color id="editor_left_pane_background3" value="#C0C0C0"/>
|
||||||
|
<color id="editor_left_pane_line_number_text" value="#4060D0"/>
|
||||||
|
<color id="editor_left_pane_line_number_background" value="#F0F0F0"/>
|
||||||
|
|
||||||
<style id="BUTTON"
|
<style id="BUTTON"
|
||||||
backgroundImageId="btn_background"
|
backgroundImageId="btn_background"
|
||||||
|
|
Loading…
Reference in New Issue