[gnome-taquin] Let GameWindow load the CSS.
- From: Arnaud Bonatti <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-taquin] Let GameWindow load the CSS.
- Date: Tue, 3 Mar 2015 20:33:21 +0000 (UTC)
commit e5efd662ed02152cdf8cb1ee03e0792be8019525
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Tue Mar 3 21:20:44 2015 +0100
Let GameWindow load the CSS.
src/game-window.vala | 9 ++++++++-
src/taquin-main.vala | 7 ++-----
2 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/src/game-window.vala b/src/game-window.vala
index 4770790..16b675b 100644
--- a/src/game-window.vala
+++ b/src/game-window.vala
@@ -88,8 +88,15 @@ public class GameWindow : ApplicationWindow
public SimpleAction undo_action;
public SimpleAction redo_action;
- public GameWindow (string name, int width, int height, bool maximized, bool start_now, GameWindowFlags
flags, Box new_game_screen, Widget _view)
+ public GameWindow (string? css_resource, string name, int width, int height, bool maximized, bool
start_now, GameWindowFlags flags, Box new_game_screen, Widget _view)
{
+ if (css_resource != null)
+ {
+ CssProvider css_provider = new CssProvider ();
+ css_provider.load_from_resource (css_resource);
+ StyleContext.add_provider_for_screen (Gdk.Screen.get_default (), css_provider,
STYLE_PROVIDER_PRIORITY_APPLICATION);
+ }
+
view = _view;
/* window actions */
diff --git a/src/taquin-main.vala b/src/taquin-main.vala
index 23726d7..76b3947 100644
--- a/src/taquin-main.vala
+++ b/src/taquin-main.vala
@@ -117,10 +117,6 @@ public class Taquin : Gtk.Application
{
base.startup ();
- CssProvider css_provider = new CssProvider ();
- css_provider.load_from_resource ("/org/gnome/taquin/ui/taquin.css");
- StyleContext.add_provider_for_screen (Gdk.Screen.get_default (), css_provider,
STYLE_PROVIDER_PRIORITY_APPLICATION);
-
settings = new GLib.Settings ("org.gnome.taquin");
if (sound != null)
settings.set_boolean ("sound", sound);
@@ -135,7 +131,8 @@ public class Taquin : Gtk.Application
Builder builder = new Builder.from_resource ("/org/gnome/taquin/ui/taquin-screens.ui");
/* Window */
- window = new GameWindow (_("Taquin"),
+ window = new GameWindow ("/org/gnome/taquin/ui/taquin.css",
+ _("Taquin"),
settings.get_int ("window-width"),
settings.get_int ("window-height"),
settings.get_boolean ("window-is-maximized"),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]