Skip to content

Commit

Permalink
* - GResource the custom icons
Browse files Browse the repository at this point in the history
  • Loading branch information
Lains committed Jul 20, 2018
1 parent 3a43199 commit 6364189
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 25 deletions.
4 changes: 3 additions & 1 deletion data/app.gresource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
<file alias="app-stylesheet.css" compressed="true">styles/app-stylesheet.css</file>
<file alias="app-stylesheet-dark.css" compressed="true">styles/app-stylesheet-dark.css</file>
<file alias="app-stylesheet-sepia.css" compressed="true">styles/app-stylesheet-sepia.css</file>
<file alias="set-font.svg">icons/24/set-font.svg</file>
<file alias="mode-change-symbolic.svg">icons/symbolic/mode-change-symbolic.svg</file>
</gresource>
</gresources>
</gresources>
15 changes: 0 additions & 15 deletions data/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,6 @@ foreach i : icon_sizes
)
endforeach

install_data(
join_paths('icons', 'symbolic', 'mode-change-symbolic.svg'),
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', 'symbolic', 'apps')
)

install_data(
join_paths('icons', '24', 'set-font.svg'),
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', '24x24', 'apps')
)

install_data(
join_paths('icons', '24', 'set-font.svg'),
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', '24x24@2', 'apps')
)

install_data(
meson.project_name() + '.gschema.xml',
install_dir: join_paths(get_option('datadir'), 'glib-2.0', 'schemas')
Expand Down
3 changes: 3 additions & 0 deletions src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ namespace Quilter {
height_request: 600,
width_request: 700);

weak Gtk.IconTheme default_theme = Gtk.IconTheme.get_default ();
default_theme.add_resource_path ("/com/github/lainsce/quilter");

statusbar.update_wordcount ();
statusbar.update_linecount ();
statusbar.update_readtimecount ();
Expand Down
15 changes: 6 additions & 9 deletions src/Widgets/Preferences.vala
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ namespace Quilter.Widgets {
}

private Gtk.Widget get_interface_grid () {
weak Gtk.IconTheme default_theme = Gtk.IconTheme.get_default ();
default_theme.add_resource_path ("/com/github/lainsce/quilter");

var main_settings = AppSettings.get_default ();
var interface_grid = new Gtk.Grid ();
interface_grid.row_spacing = 6;
Expand All @@ -177,9 +180,7 @@ namespace Quilter.Widgets {

var mode_header = new Granite.HeaderLabel (_("Modes"));
var color_button_light = new Gtk.Button ();
var color_button_light_icon = new Gtk.Image ();
color_button_light_icon.gicon = new ThemedIcon ("mode-change-symbolic");
color_button_light_icon.pixel_size = 48;
var color_button_light_icon = new Gtk.Image.from_icon_name ("mode-change-symbolic", Gtk.IconSize.DIALOG);
color_button_light.set_image (color_button_light_icon);
color_button_light.halign = Gtk.Align.CENTER;
color_button_light.height_request = 64;
Expand All @@ -192,9 +193,7 @@ namespace Quilter.Widgets {
var color_button_light_text = new Gtk.Label (_("Light Mode"));

var color_button_sepia = new Gtk.Button ();
var color_button_sepia_icon = new Gtk.Image ();
color_button_sepia_icon.gicon = new ThemedIcon ("mode-change-symbolic");
color_button_sepia_icon.pixel_size = 48;
var color_button_sepia_icon = new Gtk.Image.from_icon_name ("mode-change-symbolic", Gtk.IconSize.DIALOG);
color_button_sepia.set_image (color_button_sepia_icon);
color_button_sepia.halign = Gtk.Align.CENTER;
color_button_sepia.height_request = 64;
Expand All @@ -207,9 +206,7 @@ namespace Quilter.Widgets {
var color_button_sepia_text = new Gtk.Label (_("Sepia Mode"));

var color_button_dark = new Gtk.Button ();
var color_button_dark_icon = new Gtk.Image ();
color_button_dark_icon.gicon = new ThemedIcon ("mode-change-symbolic");
color_button_dark_icon.pixel_size = 48;
var color_button_dark_icon = new Gtk.Image.from_icon_name ("mode-change-symbolic", Gtk.IconSize.DIALOG);
color_button_dark.set_image (color_button_dark_icon);
color_button_dark.halign = Gtk.Align.CENTER;
color_button_dark.height_request = 64;
Expand Down

0 comments on commit 6364189

Please sign in to comment.