summaryrefslogtreecommitdiff
path: root/src/gui/themeList.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2015-09-27 15:05:13 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2015-09-27 15:05:13 +0200
commit16fe2e5d0525422ba6ca5db9e92a93d17caae302 (patch)
treed6f1a9ed22335f6d0b457ccdd560b7525fb38d14 /src/gui/themeList.vala
parent10af7615316fd91eef61cc66a8ede38a2bff3fdc (diff)
Imported Upstream version 0.6.6upstream/0.6.6
Diffstat (limited to 'src/gui/themeList.vala')
-rw-r--r--src/gui/themeList.vala20
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);
+ }
}
}
}