The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

A high contrast theme

These changes was commited to the Birdfont repository Mon, 16 Mar 2015 21:01:05 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
[Mon, 16 Mar 2015 21:01:05 +0000]

Updated Files

libbirdfont/Button.vala
libbirdfont/PenTool.vala
libbirdfont/Renderer/TextArea.vala
libbirdfont/SettingsDisplay.vala
libbirdfont/Theme.vala
resources/default.theme
resources/high_contrast.theme
--- a/libbirdfont/Button.vala +++ b/libbirdfont/Button.vala @@ -27,7 +27,6 @@ public Button (string label) { font_size = 17 * MainWindow.units; this.label = new Text (label, font_size); - Theme.text_color (this.label, "Button Foreground"); padding = 15 * MainWindow.units; } @@ -46,6 +45,7 @@ cr.restore (); cr.save (); + Theme.text_color (label, "Button Foreground"); label.draw_at_top (cr, widget_x + padding, widget_y + (2 * padding - font_size - 3 * MainWindow.units) / 2.0); cr.restore (); }
--- a/libbirdfont/PenTool.vala +++ b/libbirdfont/PenTool.vala @@ -1229,7 +1229,7 @@ h = fmax (selection_box_y, selection_box_last_y) - y; cr.save (); - Theme.color (cr, "Background 4"); + Theme.color (cr, "Foreground 1"); cr.set_line_width (2); cr.rectangle (x, y, w, h); cr.stroke ();
--- a/libbirdfont/Renderer/TextArea.vala +++ b/libbirdfont/Renderer/TextArea.vala @@ -61,7 +61,9 @@ Gee.ArrayList<TextUndoItem> redo_items = new Gee.ArrayList<TextUndoItem> (); bool store_undo_state_at_next_event = false; + public bool editable; + public bool use_cache = true; public TextArea (double font_size = 20) { this.font_size = font_size; @@ -990,7 +992,7 @@ // background cr.save (); cr.set_line_width (1); - Theme.color (cr, "Background 2"); + Theme.color (cr, "Text Area Background"); draw_rounded_rectangle (cr, x, y, this.width, this.height, padding); cr.fill (); cr.restore (); @@ -1007,6 +1009,7 @@ cr.save (); word = new Text (); + word.use_cache (use_cache); width = this.width - padding; x += padding;
--- a/libbirdfont/SettingsDisplay.vala +++ b/libbirdfont/SettingsDisplay.vala @@ -166,7 +166,7 @@ Tool select_theme = new Tool (theme); select_theme.deselect_action.connect((self) => { - self.set_selected (true); + self.set_active (false); }); select_theme.select_action.connect((self) => { @@ -175,8 +175,13 @@ Preferences.set ("theme", theme_file); Theme.load_theme (theme_file); - - self.set_selected (false); + + foreach (Tool t in theme_buttons) { + t.set_selected (false); + t.set_active (false); + } + + self.set_selected (true); create_setting_items (); Toolbox.redraw_tool_box (); @@ -207,7 +212,7 @@ } foreach (Tool t in theme_buttons) { - t.set_selected (false); + t.set_selected (t.name == Theme.current_theme); } Tool add_theme = new Tool ("add_new_theme");
--- a/libbirdfont/Theme.vala +++ b/libbirdfont/Theme.vala @@ -148,6 +148,10 @@ 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); + + Theme.set_default_color ("Selected Tool Foreground", 101 / 255.0, 108 / 255.0, 116 / 255.0, 1); + + Theme.set_default_color ("Text Area Background", 101 / 255.0, 108 / 255.0, 116 / 255.0, 1); t_("Stroke Color"); t_("Handle Color"); @@ -192,6 +196,12 @@ t_("Button Background 4"); t_("Button Foreground"); + t_("Selected Button Foreground"); + + t_("Tool Foreground"); + t_("Selected Tool Foreground"); + + t_("Text Area Background"); } }
--- a/resources/default.theme +++ b/resources/default.theme @@ -1,37 +1,46 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <theme> <color name="Highlighted 1" red="0.91764705882352937" green="0.30196078431372547" blue="0.10196078431372549" alpha="1"/> - <color name="Tool Background 2" red="0.10196078431372549" green="0.11764705882352941" blue="0.12549019607843137" alpha="1"/> <color name="Guide 1" red="0.69999999999999996" green="0.69999999999999996" blue="0.80000000000000004" alpha="1"/> - <color name="Tool Background 3" red="0.17254901960784313" green="0.18431372549019609" blue="0.20000000000000001" alpha="1"/> + <color name="Foreground 6" red="0.17647058823529413" green="0.17647058823529413" blue="0.17647058823529413" alpha="1"/> <color name="Background 1" red="1" green="1" blue="1" alpha="1"/> <color name="Guide 2" red="0.69999999999999996" green="0" blue="0" alpha="0.5"/> - <color name="Tool Border 1" red="0.14901960784313725" green="0.15294117647058825" blue="0.16862745098039217" alpha="1"/> - <color name="Tool Background 4" red="0.12941176470588237" green="0.14117647058823529" blue="0.15294117647058825" alpha="1"/> + <color name="Foreground 7" red="0.85882352941176465" green="0.8666666666666667" blue="0.9137254901960784" alpha="1"/> <color name="Background 2" red="0.396078431372549" green="0.42352941176470588" blue="0.45490196078431372" alpha="1"/> <color name="Guide 3" red="0.47058823529411764" green="0.26666666666666666" blue="0.47058823529411764" alpha="0.47058823529411764"/> <color name="Background 3" red="0.14901960784313725" green="0.15294117647058825" blue="0.16862745098039217" alpha="1"/> - <color name="Tool Border 2" red="0.14901960784313725" green="0.15294117647058825" blue="0.16862745098039217" alpha="1"/> <color name="Background 4" red="0.20000000000000001" green="0.21176470588235294" blue="0.23137254901960785" alpha="1"/> - <color name="Tool Border 3" red="0.14901960784313725" green="0.15294117647058825" blue="0.16862745098039217" alpha="1"/> <color name="Background 5" red="0.29999999999999999" green="0.29999999999999999" blue="0.29999999999999999" alpha="1"/> - <color name="Tool Border 4" red="0.14901960784313725" green="0.15294117647058825" blue="0.16862745098039217" alpha="1"/> <color name="Background 6" red="0.8784313725490196" green="0.8784313725490196" blue="0.8784313725490196" alpha="1"/> <color name="Background 7" red="0.2196078431372549" green="0.23137254901960785" blue="0.25490196078431371" alpha="1"/> <color name="Background 8" red="0.21568627450980393" green="0.21568627450980393" blue="0.21568627450980393" alpha="1"/> <color name="Fill Color" red="0.5" green="0.5" blue="0.5" alpha="1"/> <color name="Background 9" red="0.28235294117647058" green="0.28235294117647058" blue="0.28235294117647058" alpha="1"/> <color name="Stroke Color" red="0" green="0" blue="0" alpha="1"/> - <color name="Button Foreground" red="0.396078431372549" green="0.42352941176470588" blue="0.45490196078431372" alpha="1"/> + <color name="Selected Tool Foreground" red="0.396078431372549" green="0.42352941176470588" blue="0.45490196078431372" alpha="1"/> + <color name="Button Foreground" red="1" green="1" blue="1" alpha="1"/> <color name="Grid" red="0.20000000000000001" green="0.59999999999999998" blue="0.20000000000000001" alpha="0.20000000000000001"/> + <color name="Text Area Background" red="0.396078431372549" green="0.42352941176470588" blue="0.45490196078431372" alpha="1"/> + <color name="Background 10" red="0.87450980392156863" green="0.87450980392156863" blue="0.87450980392156863" alpha="1"/> + <color name="Button Background 1" red="0.054901960784313725" green="0.062745098039215685" blue="0.066666666666666666" alpha="1"/> + <color name="Button Border 1" red="0.14901960784313725" green="0.15294117647058825" blue="0.16862745098039217" alpha="1"/> + <color name="Button Background 2" red="0.10196078431372549" green="0.11764705882352941" blue="0.12549019607843137" alpha="1"/> + <color name="Button Border 2" red="0.14901960784313725" green="0.15294117647058825" blue="0.16862745098039217" alpha="1"/> + <color name="Button Background 3" red="0.17254901960784313" green="0.18431372549019609" blue="0.20000000000000001" alpha="1"/> + <color name="Button Border 3" red="0.14901960784313725" green="0.15294117647058825" blue="0.16862745098039217" alpha="1"/> + <color name="Button Background 4" red="0.12941176470588237" green="0.14117647058823529" blue="0.15294117647058825" alpha="1"/> <color name="Background Glyph" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="0.5"/> <color name="Handle Color" red="0" green="0" blue="0" alpha="1"/> + <color name="Button Border 4" red="0.14901960784313725" green="0.15294117647058825" blue="0.16862745098039217" alpha="1"/> <color name="Highlighted Guide" red="0" green="0" blue="0.29999999999999999" alpha="1"/> + <color name="Selected Button Foreground" red="1" green="1" blue="1" alpha="1"/> + <color name="Menu Foreground" red="0.396078431372549" green="0.42352941176470588" blue="0.45490196078431372" alpha="1"/> + <color name="Tool Foreground" red="0.396078431372549" green="0.42352941176470588" blue="0.45490196078431372" alpha="1"/> <color name="Foreground 1" red="0" green="0" blue="0" alpha="1"/> <color name="Foreground 2" red="0.396078431372549" green="0.42352941176470588" blue="0.45490196078431372" alpha="1"/> <color name="Foreground 3" red="0.10196078431372549" green="0.11764705882352941" blue="0.12549019607843137" alpha="1"/> <color name="Foreground 4" red="0.15686274509803921" green="0.22352941176470589" blue="0.25490196078431371" alpha="1"/> + <color name="Foreground Inverted" red="1" green="1" blue="1" alpha="1"/> <color name="Foreground 5" red="0.27450980392156865" green="0.30196078431372547" blue="0.32549019607843138" alpha="1"/> - <color name="Tool Background 1" red="0.054901960784313725" green="0.062745098039215685" blue="0.066666666666666666" alpha="1"/> </theme>
--- /dev/null +++ b/resources/high_contrast.theme @@ -1,1 +1,46 @@ + <?xml version="1.0" encoding="utf-8" standalone="yes"?> + <theme> + <color name="Highlighted 1" red="0" green="0" blue="0" alpha="1"/> + <color name="Guide 1" red="0" green="0" blue="0" alpha="1"/> + <color name="Foreground 6" red="0" green="0" blue="0" alpha="1"/> + <color name="Background 1" red="1" green="1" blue="1" alpha="1"/> + <color name="Guide 2" red="0" green="0" blue="0" alpha="1"/> + <color name="Foreground 7" red="1" green="1" blue="1" alpha="1"/> + <color name="Background 2" red="0" green="0" blue="0" alpha="1"/> + <color name="Guide 3" red="0" green="0" blue="0" alpha="1"/> + <color name="Background 3" red="0" green="0" blue="0" alpha="1"/> + <color name="Background 4" red="1" green="1" blue="1" alpha="1"/> + <color name="Background 5" red="1" green="1" blue="1" alpha="1"/> + <color name="Background 6" red="1" green="1" blue="1" alpha="1"/> + <color name="Background 7" red="1" green="1" blue="1" alpha="1"/> + <color name="Background 8" red="1" green="1" blue="1" alpha="1"/> + <color name="Fill Color" red="0" green="0" blue="0" alpha="1"/> + <color name="Background 9" red="1" green="1" blue="1" alpha="1"/> + <color name="Stroke Color" red="0" green="0" blue="0" alpha="1"/> + <color name="Selected Tool Foreground" red="1" green="1" blue="1" alpha="1"/> + <color name="Button Foreground" red="0" green="0" blue="0" alpha="1"/> + <color name="Grid" red="0" green="0" blue="0" alpha="1"/> + <color name="Text Area Background" red="1" green="1" blue="1" alpha="1"/> + <color name="Background 10" red="1" green="1" blue="1" alpha="1"/> + <color name="Button Background 1" red="0" green="0" blue="0" alpha="1"/> + <color name="Button Border 1" red="0" green="0" blue="0" alpha="1"/> + <color name="Button Background 2" red="0" green="0" blue="0" alpha="1"/> + <color name="Button Border 2" red="0" green="0" blue="0" alpha="1"/> + <color name="Button Background 3" red="1" green="1" blue="1" alpha="1"/> + <color name="Button Border 3" red="0" green="0" blue="0" alpha="1"/> + <color name="Button Background 4" red="1" green="1" blue="1" alpha="1"/> + <color name="Background Glyph" red="0" green="0" blue="0" alpha="1"/> + <color name="Handle Color" red="0" green="0" blue="0" alpha="1"/> + <color name="Button Border 4" red="0" green="0" blue="0" alpha="1"/> + <color name="Highlighted Guide" red="0" green="0" blue="0" alpha="1"/> + <color name="Selected Button Foreground" red="1" green="1" blue="1" alpha="1"/> + <color name="Menu Foreground" red="1" green="1" blue="1" alpha="1"/> + <color name="Tool Foreground" red="0" green="0" blue="0" alpha="1"/> + <color name="Foreground 1" red="0" green="0" blue="0" alpha="1"/> + <color name="Foreground 2" red="0" green="0" blue="0" alpha="1"/> + <color name="Foreground 3" red="0" green="0" blue="0" alpha="1"/> + <color name="Foreground 4" red="1" green="1" blue="1" alpha="1"/> + <color name="Foreground Inverted" red="1" green="1" blue="1" alpha="1"/> + <color name="Foreground 5" red="0" green="0" blue="0" alpha="1"/> + </theme>