[gnome-bluetooth] pairing-dialog: Fix lost styling for PINs



commit 274fc6ebabc7b14a0e2e42bff26c39c871296aa2
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Oct 13 17:01:12 2015 +0200

    pairing-dialog: Fix lost styling for PINs
    
    The styling was lost when moving the GTK+ theme from
    gnome-themes-standard to GTK+.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756446

 lib/Makefile.am                |    2 +-
 lib/bluetooth-pairing-dialog.c |   10 ++++++++++
 lib/bluetooth-settings.css     |    7 +++++++
 lib/bluetooth.gresource.xml    |    1 +
 4 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 80ad1ed..c8468b8 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -10,7 +10,7 @@ bluetooth-settings-resources.c: bluetooth.gresource.xml $(resource_files)
 bluetooth-settings-resources.h: bluetooth.gresource.xml $(resource_files)
        $(AM_V_GEN) glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-header --c-name 
bluetooth_settings $<
 
-EXTRA_DIST += bluetooth.gresource.xml settings.ui bluetooth-pairing-dialog.ui bluetooth-settings-row.ui
+EXTRA_DIST += bluetooth.gresource.xml settings.ui bluetooth-pairing-dialog.ui bluetooth-settings-row.ui 
bluetooth-settings.css
 BUILT_SOURCES += bluetooth-settings-resources.c bluetooth-settings-resources.h
 
 # will be scanned for introspection annotation, but won't be installed
diff --git a/lib/bluetooth-pairing-dialog.c b/lib/bluetooth-pairing-dialog.c
index 2aa95fc..8e3d3b6 100644
--- a/lib/bluetooth-pairing-dialog.c
+++ b/lib/bluetooth-pairing-dialog.c
@@ -254,10 +254,20 @@ text_changed_cb (GObject    *gobject,
 static void
 bluetooth_pairing_dialog_init (BluetoothPairingDialog *self)
 {
+       GtkCssProvider *provider;
+
        gtk_widget_init_template (GTK_WIDGET (self));
 
        gtk_widget_set_size_request (GTK_WIDGET (self), 380, -1);
        gtk_window_set_resizable (GTK_WINDOW (self), FALSE);
+
+       provider = gtk_css_provider_new ();
+       gtk_css_provider_load_from_resource (provider, "/org/gnome/bluetooth/bluetooth-settings.css");
+       gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
+                                                  GTK_STYLE_PROVIDER (provider),
+                                                  GTK_STYLE_PROVIDER_PRIORITY_USER);
+       g_object_unref (provider);
+
 }
 
 static void
diff --git a/lib/bluetooth-settings.css b/lib/bluetooth-settings.css
new file mode 100644
index 0000000..22bd0eb
--- /dev/null
+++ b/lib/bluetooth-settings.css
@@ -0,0 +1,7 @@
+GtkEntry.entry.pin-entry {
+       font: regular 50;
+}
+
+GtkLabel.pin-label {
+       font: regular 50;
+}
diff --git a/lib/bluetooth.gresource.xml b/lib/bluetooth.gresource.xml
index 8b3becb..4b8111b 100644
--- a/lib/bluetooth.gresource.xml
+++ b/lib/bluetooth.gresource.xml
@@ -4,5 +4,6 @@
     <file preprocess="xml-stripblanks">settings.ui</file>
     <file preprocess="xml-stripblanks">bluetooth-pairing-dialog.ui</file>
     <file preprocess="xml-stripblanks">bluetooth-settings-row.ui</file>
+    <file>bluetooth-settings.css</file>
   </gresource>
 </gresources>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]