From b5f4bc38eb91ea84b7662c535424faddb98c5f6a Mon Sep 17 00:00:00 2001
From: Vadim Lopatin <coolreader.org@gmail.com>
Date: Mon, 12 Sep 2016 11:20:46 +0300
Subject: [PATCH] console theme improvements

---
 examples/example1/src/example1.d    |  2 +-
 src/dlangui/widgets/controls.d      |  4 ++--
 views/res/console_theme_default.xml | 26 +++++++++++++++-----------
 3 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/examples/example1/src/example1.d b/examples/example1/src/example1.d
index 7a63d32a..8f1a2a8d 100644
--- a/examples/example1/src/example1.d
+++ b/examples/example1/src/example1.d
@@ -257,7 +257,7 @@ extern (C) int UIAppMain(string[] args) {
         // create main menu
 
         MenuItem mainMenuItems = new MenuItem();
-        MenuItem fileItem = new MenuItem(new Action(1, "MENU_FILE"));
+        MenuItem fileItem = new MenuItem(new Action(1, "MENU_FILE"c));
         fileItem.add(new Action(ACTION_FILE_OPEN, "MENU_FILE_OPEN"c, "document-open", KeyCode.KEY_O, KeyFlag.Control));
         fileItem.add(new Action(ACTION_FILE_SAVE, "MENU_FILE_SAVE"c, "document-save", KeyCode.KEY_S, KeyFlag.Control));
         MenuItem openRecentItem = new MenuItem(new Action(13, "MENU_FILE_OPEN_RECENT", "document-open-recent"));
diff --git a/src/dlangui/widgets/controls.d b/src/dlangui/widgets/controls.d
index 8e476a74..a12a7813 100644
--- a/src/dlangui/widgets/controls.d
+++ b/src/dlangui/widgets/controls.d
@@ -413,7 +413,7 @@ class UrlImageTextButton : ImageTextButton {
         //_label.styleId = STYLE_BUTTON_LABEL;
         //_label.textFlags(TextFlag.Underline);
         _label.styleId = "BUTTON_LABEL_LINK";
-        padding(Rect(3,3,3,3));
+        static if (BACKEND_GUI) padding(Rect(3,3,3,3));
     }
 }
 
@@ -423,7 +423,7 @@ class LinkButton : ImageTextButton {
         super(a);
         styleId = null;
         _label.styleId = "BUTTON_LABEL_LINK";
-        padding(Rect(3,3,3,3));
+        static if (BACKEND_GUI) padding(Rect(3,3,3,3));
     }
 }
 
diff --git a/views/res/console_theme_default.xml b/views/res/console_theme_default.xml
index e7cbb6e2..533652dc 100644
--- a/views/res/console_theme_default.xml
+++ b/views/res/console_theme_default.xml
@@ -188,21 +188,24 @@
         backgroundImageId="tab_btn_dark_down"
         />
     <style id="TAB_UP_DARK"
-        backgroundImageId="dock_window_caption_background"
         layoutWidth="FILL_PARENT"
+        margins="1,0,1,0"
+        backgroundColor="#000000"
         >
     </style>
     <style id="TAB_UP_BUTTON_DARK"
+        backgroundColor="#000000"
         padding="1,0,1,0"
-        backgroundImageId="tab_btn_dark_up"
         >
-        <length id="overlap" value="2"/>
+        <state state_selected="true" backgroundColor="#000080"/>
     </style>
-    <style id="TAB_UP_BUTTON_DARK_TEXT"
-        textColor="#000000"
+    <style id="TAB_UP_BUTTON_TEXT_DARK"
+        textColor="#808080"
         align="Center"
+        margins="1,0,1,0"
         >
-        <state state_selected="false" state_window_focused="false" state_hovered="false" textColor="#9c9c9c"/>
+        <state state_selected="true" textColor="#FFFFFF"/>
+        <state state_hovered="true" textColor="#808000"/>
     </style>
     <style id="TAB_UP"
         layoutWidth="FILL_PARENT"
@@ -225,7 +228,7 @@
     <style id="TAB_HOST"
         layoutWidth="FILL_PARENT"
         layoutHeight="FILL_PARENT"
-        backgroundColor="#000080"
+        backgroundColor="#000000"
         />
     <style id="TAB_WIDGET"
         backgroundColor="#000000"
@@ -376,7 +379,7 @@
         margins="0,0,0,0"
         />
     <style id="DOCK_WINDOW"
-        backgroundImageId="dock_window_background"
+        backgroundColor="#000000"
         layoutWidth="FILL_PARENT"
         layoutHeight="FILL_PARENT"
         padding="0,0,0,0"
@@ -409,7 +412,7 @@
         />
 
     <style id="TOOLBAR_HOST"
-        backgroundImageId="toolbar_host_background"
+        backgroundColor="#000000"
         layoutWidth="FILL_PARENT"
         layoutHeight="WRAP_CONTENT"
         padding="0,0,0,0"
@@ -427,9 +430,10 @@
         layoutWidth="WRAP_CONTENT"
         layoutHeight="WRAP_CONTENT"
         margins="1,0,1,0"
+        minHeight="3"
         />
     <style id="TOOLBAR_BUTTON"
-        backgroundImageId="toolbar_button_background"
+        backgroundImageId="btn_background"
         align="Center"
         margins="0,0,0,0"
         padding="0,0,0,0"
@@ -437,7 +441,7 @@
         <state state_enabled="false" alpha="160" backgroundImageId="@null"/>
     </style>
     <style id="TOOLBAR_CONTROL"
-        backgroundImageId="toolbar_control_background"
+        backgroundColor="#000000"
         align="Center"
         margins="0,0,0,0"
         padding="0,0,0,0"