diff options
author | Juan Pablo Ugarte <juanpablougarte@gmail.com> | 2017-07-02 00:40:33 -0300 |
---|---|---|
committer | Juan Pablo Ugarte <juanpablougarte@gmail.com> | 2017-12-30 13:42:16 -0300 |
commit | 65036a67e814a11ad15269d0a3f93cf2c312f74f (patch) | |
tree | 1cef0087ec5a8612262be1d728d9729cdc4bf090 | |
parent | 5c5cec96a9eb72187ca359169e19c5405c0b0dfc (diff) | |
download | glade-65036a67e814a11ad15269d0a3f93cf2c312f74f.tar.gz |
GladeWindow: moved css to glade-window.css file
-rw-r--r-- | src/Makefile.am | 6 | ||||
-rw-r--r-- | src/glade-resources.gresource.xml | 1 | ||||
-rw-r--r-- | src/glade-window.c | 40 | ||||
-rw-r--r-- | src/glade-window.css | 62 |
4 files changed, 70 insertions, 39 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index b1046ac5..67d1b3b0 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 4447f39a..4ada8c66 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 f10d8e67..731cc377 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 00000000..0f499438 --- /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; +} |