Commit 6216fae
More colors in theme settings
Changed files (9)
modifiedlibbirdfont/Button.valamodifiedlibbirdfont/FileTab.valamodifiedlibbirdfont/Menu.valamodifiedlibbirdfont/PenTool.valamodifiedlibbirdfont/Renderer/TextArea.valamodifiedlibbirdfont/Theme.valamodifiedlibbirdfont/Tool.valamodifiedlibbirdfont/Toolbox.valadeletedresources/win32/icon.rc
Diff
@@ -27,19 +27,19 @@ public class Button : Widget { public Button (string label) { font_size = 17 * MainWindow.units; this.label = new Text (label, font_size);- Theme.text_color (this.label, "Background 1");+ Theme.text_color (this.label, "Button Foreground"); padding = 15 * MainWindow.units; } public override void draw (Context cr) { cr.save ();- Theme.color (cr, "Background 4");+ Theme.color (cr, "Button Background 3"); draw_rounded_rectangle (cr, widget_x, widget_y, get_width (), padding, padding); cr.fill (); cr.restore (); cr.save ();- Theme.color (cr, "Foreground 1");+ Theme.color (cr, "Button Border 3"); cr.set_line_width (1); draw_rounded_rectangle (cr, widget_x, widget_y, get_width (), padding, padding); cr.stroke ();@@ -245,7 +245,7 @@ public class FileTab : FontDisplay { if (recent_fonts.size == 0 && !has_backup ()) { cr.save ();- Theme.color (cr, "Background 5");+ Theme.color (cr, "Foreground 2"); cr.set_font_size (18 * MainWindow.units); cr.move_to (50 * MainWindow.units, top - 9 * MainWindow.units); cr.show_text (t_("No fonts created yet."));@@ -256,7 +256,7 @@ public class FileTab : FontDisplay { if (scroll == 0 && recent_fonts.size > 0) { cr.save ();- Theme.color (cr, "Background 5");+ Theme.color (cr, "Foreground 2"); cr.set_font_size (18 * MainWindow.units); cr.move_to (50 * MainWindow.units, top - 9 * MainWindow.units); cr.show_text (t_("Recent files"));@@ -303,12 +303,16 @@ public class FileTab : FontDisplay { private void draw_file_row (WidgetAllocation allocation, Context cr, Font font, bool color, double y) { string fn = (!) font.font_file;+ Text file; fn = fn.substring (fn.replace ("\\", "/").last_index_of ("/") + 1); draw_background (cr, allocation, y, color); - cr.move_to (50 * MainWindow.units, y + row_height / 2 + 5 * MainWindow.units);- cr.show_text (fn);+ file = new Text (fn);+ Theme.text_color (file, "Foreground 6");+ file.widget_x = 50 * MainWindow.units;+ file.widget_y = y + 5 * MainWindow.units;+ file.draw (cr); } private void draw_backup_row (WidgetAllocation allocation, Context cr, string backup, bool color, double y) {@@ -334,15 +338,15 @@ public class FileTab : FontDisplay { void draw_background (Context cr, WidgetAllocation allocation, double y, bool color) { if (color) {- draw_background_color (cr, allocation, y, 224);+ draw_background_color (cr, allocation, y, 1); } else {- draw_background_color (cr, allocation, y, 239);+ draw_background_color (cr, allocation, y, 0.5); } } - void draw_background_color (Context cr, WidgetAllocation allocation, double y, int color) {+ void draw_background_color (Context cr, WidgetAllocation allocation, double y, double opacity) { cr.save ();- cr.set_source_rgba (color/255.0, color/255.0, color/255.0, 1);+ Theme.color_opacity (cr, "Background 10", opacity); cr.rectangle (0, y, allocation.width, row_height); cr.fill (); cr.restore ();@@ -668,7 +668,7 @@ public class Menu : GLib.Object { cr.save (); label_x = allocation.width - width + 0.7 * height * MainWindow.units; label_y = y + font_size - 1 * MainWindow.units;- Theme.text_color (item.label, "Foreground 2");+ Theme.text_color (item.label, "Menu Foreground"); item.label.draw_at_baseline (cr, label_x, label_y); key_binding.set_text (item.get_key_bindings ());@@ -676,7 +676,7 @@ public class Menu : GLib.Object { binding_extent = key_binding.get_extent (); label_x = x + width - binding_extent - 0.6 * height * MainWindow.units; key_binding.set_font_size (font_size);- Theme.text_color (key_binding, "Foreground 2");+ Theme.text_color (key_binding, "Menu Foreground"); key_binding.draw_at_baseline (cr, label_x, label_y); y += height;@@ -741,6 +741,10 @@ public class PenTool : Tool { last_point_y = Glyph.path_coordinate_y (y); } }+ + if (show_selection_box) {+ GlyphCanvas.redraw ();+ } } private void move_point_on_handles (double px, double py, out double cx, out double cy) {@@ -990,7 +990,7 @@ public class TextArea : Widget { // background cr.save (); cr.set_line_width (1);- Theme.color (cr, "Foreground 2");+ Theme.color (cr, "Background 2"); draw_rounded_rectangle (cr, x, y, this.width, this.height, padding); cr.fill (); cr.restore ();@@ -84,16 +84,16 @@ public class Theme : GLib.Object { } public static void set_default_colors () {- add_theme_files (); current_theme = "default.theme";+ color_list = new Gee.ArrayList<string> ();+ colors = new Gee.HashMap<string, Color> ();+ themes = new Gee.ArrayList<string> ();++ add_theme_files (); - if (Argument.has_argument ("--test") {+ if (BirdFont.has_argument ("--test")) { current_theme = "generated_theme.theme"; - color_list = new Gee.ArrayList<string> ();- colors = new Gee.HashMap<string, Color> ();- themes = new Gee.ArrayList<string> ();- Theme.set_default_color ("Stroke Color", 0, 0, 0, 1); Theme.set_default_color ("Handle Color", 0, 0, 0, 1); Theme.set_default_color ("Fill Color", 0.5, 0.5, 0.5, 1);@@ -107,13 +107,16 @@ public class Theme : GLib.Object { Theme.set_default_color ("Background 7", 56 / 255.0, 59 / 255.0, 65 / 255.0, 1); Theme.set_default_color ("Background 8", 55/255.0, 55/255.0, 55/255.0, 1); Theme.set_default_color ("Background 9", 72/255.0, 72/255.0, 72/255.0, 1);+ Theme.set_default_color ("Background 10", 223/255.0, 223/255.0, 223/255.0, 1); Theme.set_default_color ("Foreground 1", 0, 0, 0, 1); Theme.set_default_color ("Foreground 2", 101 / 255.0, 108 / 255.0, 116 / 255.0, 1); Theme.set_default_color ("Foreground 3", 26 / 255.0, 30 / 255.0, 32 / 255.0, 1); Theme.set_default_color ("Foreground 4", 40 / 255.0, 57 / 255.0, 65 / 255.0, 1); Theme.set_default_color ("Foreground 5", 70 / 255.0, 77 / 255.0, 83 / 255.0, 1);+ Theme.set_default_color ("Foreground 6", 45 / 255.0, 45 / 255.0, 45 / 255.0, 1); Theme.set_default_color ("Foreground Inverted", 1, 1, 1, 1);+ Theme.set_default_color ("Menu Foreground", 101 / 255.0, 108 / 255.0, 116 / 255.0, 1); Theme.set_default_color ("Highlighted 1", 234 / 255.0, 77 / 255.0, 26 / 255.0, 1); @@ -138,8 +141,11 @@ public class Theme : GLib.Object { Theme.set_default_color ("Button Border 4", 38 / 255.0, 39 / 255.0, 43 / 255.0, 1); Theme.set_default_color ("Button Background 4", 33 / 255.0, 36 / 255.0, 39 / 255.0, 1); - Theme.set_default_color ("Button Foreground", 101 / 255.0, 108 / 255.0, 116 / 255.0, 1);- Theme.set_default_color ("Selected Button Foreground", 101 / 255.0, 108 / 255.0, 116 / 255.0, 1);+ Theme.set_default_color ("Button Foreground", 1, 1, 1, 1);+ Theme.set_default_color ("Selected Button Foreground", 1, 1, 1, 1);++ Theme.set_default_color ("Tool Foreground", 101 / 255.0, 108 / 255.0, 116 / 255.0, 1);+ Theme.set_default_color ("Selected Tool Foreground", 101 / 255.0, 108 / 255.0, 116 / 255.0, 1); t_("Stroke Color"); t_("Handle Color");@@ -161,6 +167,7 @@ public class Theme : GLib.Object { t_("Foreground 4"); t_("Foreground 5"); t_("Foreground Inverted");+ t_("Menu Foreground"); t_("Highlighted 1"); t_("Highlighted Guide");@@ -292,10 +292,10 @@ public class Tool : Widget { iconx = bgx + w / 2 - icon_font.get_sidebearing_extent () / 2; icony = bgy + h / 2 - icon_font.get_height () / 2; - if (!selected || active) {- Theme.text_color (icon_font, "Button Foreground");+ if (!selected) {+ Theme.text_color (icon_font, "Tool Foreground"); } else {- Theme.text_color (icon_font, "Selected Button Foreground");+ Theme.text_color (icon_font, "Selected Tool Foreground"); } icon_font.widget_x = iconx;@@ -482,7 +482,7 @@ public class Toolbox : GLib.Object { TextArea t; if (tool_tip != null && tool_tip != "") {- t = new TextArea (15 * get_scale ());+ t = new TextArea (17 * get_scale ()); t.allocation = new WidgetAllocation.for_area (0, 0, allocation_width, allocation_height); t.set_editable (false); t.set_text ((!) tool_tip);deleted file mode 100644@@ -1 +0,0 @@-id ICON "../win32/birdfont.ico"