Commit 6285ef5d authored by Jens Georg's avatar Jens Georg

Fix Theme initialization code

Move everything into Resources.init():
 - Icon theme search paths
 - CSS provider
parent 49ced8dc
install_subdir('16x16',
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor'))
install_subdir('22x22',
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor'))
install_subdir('24x24',
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor'))
install_subdir('256x256',
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor'))
install_subdir('32x32',
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor'))
install_subdir('48x48',
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor'))
install_subdir('symbolic',
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor'))
......@@ -439,13 +439,6 @@ public abstract class AppWindow : PageWindow {
// with each ActionGroup while we're adding the groups to the UIManager.
add_actions ();
Gtk.CssProvider provider = new Gtk.CssProvider();
provider.load_from_resource("/org/gnome/Shotwell/themes/org.gnome.Shotwell.css");
Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(), provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
var foo = Gtk.IconTheme.get_default();
foo.add_resource_path("/org/gnome/Shotwell/icons/hicolor");
}
private const GLib.ActionEntry[] common_actions = {
......
......@@ -798,7 +798,8 @@ along with Shotwell; if not, write to the Free Software Foundation, Inc.,
private string END_MULTIMONTH_DATE_FORMAT_STRING = null;
public void init () {
get_icon_theme_engine();
init_icon_theme_engine();
init_css_provider();
// load application-wide stock icons as IconSets
generate_rating_strings();
}
......@@ -990,12 +991,17 @@ along with Shotwell; if not, write to the Free Software Foundation, Inc.,
return noninterpretable_badge_pixbuf;
}
private void init_css_provider() {
Gtk.CssProvider provider = new Gtk.CssProvider();
provider.load_from_resource("/org/gnome/Shotwell/themes/org.gnome.Shotwell.css");
Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(), provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
}
public Gtk.IconTheme get_icon_theme_engine() {
private void init_icon_theme_engine() {
Gtk.IconTheme icon_theme = Gtk.IconTheme.get_default();
icon_theme.add_resource_path("/org/gnome/Shotwell/icons");
return icon_theme;
icon_theme.add_resource_path("/org/gnome/Shotwell/icons/hicolor");
}
// This method returns a reference to a cached pixbuf that may be shared throughout the system.
......
......@@ -148,7 +148,7 @@ private class ManifestListView : Gtk.TreeView {
set_grid_lines(Gtk.TreeViewGridLines.NONE);
get_selection().set_mode(Gtk.SelectionMode.BROWSE);
Gtk.IconTheme icon_theme = Resources.get_icon_theme_engine();
Gtk.IconTheme icon_theme = Gtk.IconTheme.get_default();
// create a list of plugins (sorted by name) that are separated by extension points (sorted
// by name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment