[glade/modern-ui: 27/32] GladeWindow: moved css to glade-window.css file
- From: Juan Pablo Ugarte <jpu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade/modern-ui: 27/32] GladeWindow: moved css to glade-window.css file
- Date: Sun, 16 Jul 2017 00:39:00 +0000 (UTC)
commit 7b9fcd943ca2a4bcae16ce9243efeeb49c843015
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date: Sun Jul 2 00:40:33 2017 -0300
GladeWindow: moved css to glade-window.css file
src/Makefile.am | 6 +++-
src/glade-resources.gresource.xml | 1 +
src/glade-window.c | 40 +----------------------
src/glade-window.css | 62 +++++++++++++++++++++++++++++++++++++
4 files changed, 70 insertions(+), 39 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index b1046ac..67d1b3b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -59,6 +59,10 @@ endif
glade-win32-res.o: glade.rc
$(WINDRES) $< $@
-UI_FILES = glade.glade glade-preferences.glade glade-registration.glade glade-registration.css
+UI_FILES = glade.glade \
+ glade-preferences.glade \
+ glade-registration.glade \
+ glade-window.css \
+ glade-registration.css
EXTRA_DIST = glade.rc.in glade-resources.gresource.xml $(UI_FILES)
diff --git a/src/glade-resources.gresource.xml b/src/glade-resources.gresource.xml
index 4447f39..4ada8c6 100644
--- a/src/glade-resources.gresource.xml
+++ b/src/glade-resources.gresource.xml
@@ -4,6 +4,7 @@
<file compressed="true" preprocess="xml-stripblanks">glade.glade</file>
<file compressed="true" preprocess="xml-stripblanks">glade-preferences.glade</file>
<file compressed="true" preprocess="xml-stripblanks">glade-registration.glade</file>
+ <file compressed="true">glade-window.css</file>
<file compressed="true">glade-registration.css</file>
</gresource>
</gresources>
diff --git a/src/glade-window.c b/src/glade-window.c
index f10d8e6..731cc37 100644
--- a/src/glade-window.c
+++ b/src/glade-window.c
@@ -2366,7 +2366,7 @@ glade_window_init (GladeWindow *window)
*/
priv->preferences = (GladePreferences *)glade_preferences_new ();
glade_preferences_load (window->priv->preferences, glade_app_get_config ());
-
+
/* We need this for the icons to be available */
glade_init ();
@@ -2472,43 +2472,7 @@ glade_window_class_init (GladeWindowClass *klass)
widget_class->configure_event = glade_window_configure_event;
provider = gtk_css_provider_new ();
- gtk_css_provider_load_from_data (provider,
- "@binding-set DisableBindings {\n"
- " unbind \"<Control>s\";\n"
- " unbind \"<Control>p\";\n"
- " unbind \"<Control>w\";\n"
- " unbind \"<Control>z\";\n"
- " unbind \"<Control><shift>z\";\n"
- " unbind \"<Control>x\";\n"
- " unbind \"<Control>c\";\n"
- " unbind \"<Control>v\";\n"
- " unbind \"Delete\";\n"
- " unbind \"<Control>Page_Up\";\n"
- " unbind \"<Control>Page_Down\";\n"
- " unbind \"<Control>Next\";\n"
- " unbind \"<Control>n\";\n"
- " unbind \"<Control>o\";\n"
- " unbind \"<Control>q\";\n"
- " unbind \"F1\";\n"
- " unbind \"<Alt>0\";\n"
- " unbind \"<Alt>1\";\n"
- " unbind \"<Alt>2\";\n"
- " unbind \"<Alt>3\";\n"
- " unbind \"<Alt>4\";\n"
- " unbind \"<Alt>5\";\n"
- " unbind \"<Alt>6\";\n"
- " unbind \"<Alt>7\";\n"
- " unbind \"<Alt>8\";\n"
- " unbind \"<Alt>9\";\n"
- "}\n"
- "GladeDesignView * {\n"
- " -gtk-key-bindings: DisableBindings;\n"
- "}\n"
- ".glade-tight-fit {\n"
- " margin: 0;\n"
- " padding: 0;\n"
- "}", -1, NULL);
-
+ gtk_css_provider_load_from_resource (provider, "/org/gnome/glade/glade-window.css");
gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
GTK_STYLE_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
diff --git a/src/glade-window.css b/src/glade-window.css
new file mode 100644
index 0000000..0f49943
--- /dev/null
+++ b/src/glade-window.css
@@ -0,0 +1,62 @@
+/*
+ * glade-intro.css
+ *
+ * Copyright (C) 2017 Juan Pablo Ugarte
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author: Juan Pablo Ugarte <juanpablougarte gmail com>
+ *
+ */
+
+/* GladeWindow */
+
+@binding-set DisableBindings {
+ unbind "<Control>s";
+ unbind "<Control>p";
+ unbind "<Control>w";
+ unbind "<Control>z";
+ unbind "<Control><shift>z";
+ unbind "<Control>x";
+ unbind "<Control>c";
+ unbind "<Control>v";
+ unbind "Delete";
+ unbind "<Control>Page_Up";
+ unbind "<Control>Page_Down";
+ unbind "<Control>Next";
+ unbind "<Control>n";
+ unbind "<Control>o";
+ unbind "<Control>q";
+ unbind "F1";
+ unbind "<Alt>0";
+ unbind "<Alt>1";
+ unbind "<Alt>2";
+ unbind "<Alt>3";
+ unbind "<Alt>4";
+ unbind "<Alt>5";
+ unbind "<Alt>6";
+ unbind "<Alt>7";
+ unbind "<Alt>8";
+ unbind "<Alt>9";
+}
+
+GladeDesignView * {
+ -gtk-key-bindings: DisableBindings;
+}
+
+.glade-tight-fit {
+ margin: 0;
+ padding: 0;
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]