diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-09-27 15:07:18 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-09-27 15:07:18 +0200 |
commit | e5da485f77b3b8cd3bc32c13e4497a64a2ad10c3 (patch) | |
tree | b7351c6674108ea5746d70fdc2ff6c59bdc84595 /src/gui/themeList.vala | |
parent | bbabe0f4e471dd984a1c01353c44d4eb1f336473 (diff) | |
parent | 16fe2e5d0525422ba6ca5db9e92a93d17caae302 (diff) |
Merge new upstream release
Diffstat (limited to 'src/gui/themeList.vala')
-rw-r--r-- | src/gui/themeList.vala | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/gui/themeList.vala b/src/gui/themeList.vala index 517c6d5..46ae876 100644 --- a/src/gui/themeList.vala +++ b/src/gui/themeList.vala @@ -51,9 +51,6 @@ class ThemeList : Gtk.TreeView { public ThemeList() { GLib.Object(); - var data = new Gtk.ListStore(2, typeof(Gdk.Pixbuf), - typeof(string)); - this.set_model(data); this.set_headers_visible(true); this.set_grid_lines(Gtk.TreeViewGridLines.NONE); this.set_fixed_height_mode(true); @@ -79,7 +76,7 @@ class ThemeList : Gtk.TreeView { Gtk.TreeIter active; if (this.get_selection().get_selected(null, out active)) { Timeout.add(10, () => { - int index = int.parse(data.get_path(active).to_string()); + int index = int.parse(this.model.get_path(active).to_string()); Config.global.theme = Config.global.themes[index]; this.on_select_new(); @@ -91,6 +88,15 @@ class ThemeList : Gtk.TreeView { } }); + reload(); + } + + public void reload() { + + var data = new Gtk.ListStore(2, typeof(Gdk.Pixbuf), + typeof(string)); + this.set_model(data); + // load all themes into the list var themes = Config.global.themes; foreach(var theme in themes) { @@ -99,10 +105,10 @@ class ThemeList : Gtk.TreeView { data.set(current, DataPos.ICON, theme.preview_icon.to_pixbuf()); data.set(current, DataPos.NAME, GLib.Markup.escape_text(theme.name)+"\n" + "<span font-size='x-small'>" + GLib.Markup.escape_text(theme.description) - + " - <i>"+GLib.Markup.escape_text(_("By")+" "+theme.author) - + "</i></span>"); - if(theme == Config.global.theme) + + "</span>"); + if(theme == Config.global.theme) { get_selection().select_iter(current); + } } } } |