[gnome-control-center] datetime: Fix the style of the date/time selection dialog



commit c890872843eb5bef72f9289e5a6474729c1e75ca
Author: Silvère Latchurié <slatchurie gmail com>
Date:   Mon May 15 20:08:50 2017 +0200

    datetime: Fix the style of the date/time selection dialog
    
    Fix the size of the AM/PM button. Add padding to the time widgets and to the panel.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=778146

 panels/datetime/cc-datetime-panel.c |   18 +++++++++++-------
 panels/datetime/datetime.ui         |    8 ++++----
 2 files changed, 15 insertions(+), 11 deletions(-)
---
diff --git a/panels/datetime/cc-datetime-panel.c b/panels/datetime/cc-datetime-panel.c
index df76f0f..5500b05 100644
--- a/panels/datetime/cc-datetime-panel.c
+++ b/panels/datetime/cc-datetime-panel.c
@@ -1128,8 +1128,8 @@ setup_datetime_dialog (CcDateTimePanel *self)
 {
   CcDateTimePanelPrivate *priv = self->priv;
   GtkAdjustment *adjustment;
+  GdkScreen *screen;
   GtkCssProvider *provider;
-  GtkStyleContext *context;
   GtkWidget *dialog;
   guint num_days;
 
@@ -1138,13 +1138,17 @@ setup_datetime_dialog (CcDateTimePanel *self)
   /* Big time buttons */
   provider = gtk_css_provider_new ();
   gtk_css_provider_load_from_data (GTK_CSS_PROVIDER (provider),
-                                   ".gnome-control-center-datetime-setup-time {\n"
-                                   "    font-size: 32px;\n"
+                                   ".gnome-control-center-datetime-setup-time>spinbutton,\n"
+                                   ".gnome-control-center-datetime-setup-time>label {\n"
+                                   "    font-size: 250%;\n"
+                                   "}\n"
+                                   ".gnome-control-center-datetime-setup-time>spinbutton>entry {\n"
+                                   "    padding: 8px 13px;\n"
                                    "}", -1, NULL);
-  context = gtk_widget_get_style_context (GTK_WIDGET (W ("time_grid")));
-  gtk_style_context_add_provider (context,
-                                  GTK_STYLE_PROVIDER (provider),
-                                  GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+  screen = gdk_screen_get_default ();
+  gtk_style_context_add_provider_for_screen (screen,
+                                             GTK_STYLE_PROVIDER (provider),
+                                             GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
   g_object_unref (provider);
 
   dialog = W ("datetime-dialog");
diff --git a/panels/datetime/datetime.ui b/panels/datetime/datetime.ui
index 89b3a45..4a5b863 100644
--- a/panels/datetime/datetime.ui
+++ b/panels/datetime/datetime.ui
@@ -71,10 +71,10 @@
           <object class="GtkBox" id="time-box">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="margin_start">6</property>
-            <property name="margin_end">6</property>
-            <property name="margin_top">6</property>
-            <property name="margin_bottom">6</property>
+            <property name="margin_start">28</property>
+            <property name="margin_end">40</property>
+            <property name="margin_top">28</property>
+            <property name="margin_bottom">28</property>
             <property name="spacing">24</property>
             <child>
               <object class="GtkGrid" id="time_grid">


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