[gimp/gtk3-port: 214/226] Incomplete notebook and tab theming commit, to be improved



commit 83f275a8e0156ab940c75bc7230853b43c5a811f
Author: Michael Natterer <mitch gimp org>
Date:   Wed Feb 1 20:32:22 2012 +0100

    Incomplete notebook and tab theming commit, to be improved

 app/widgets/gimpdockbook.c         |   31 ++++++++-----------------------
 libgimpwidgets/gimpcolornotebook.c |   14 --------------
 themes/Default/gimp.css            |   24 +++++++++++++++++-------
 themes/Small/gimp.css              |   10 ++++++++--
 4 files changed, 33 insertions(+), 46 deletions(-)
---
diff --git a/app/widgets/gimpdockbook.c b/app/widgets/gimpdockbook.c
index bee9d6e..559366c 100644
--- a/app/widgets/gimpdockbook.c
+++ b/app/widgets/gimpdockbook.c
@@ -23,6 +23,7 @@
 #include <string.h>
 
 #include <gegl.h>
+#undef GTK_DISABLE_DEPRECATED
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"
@@ -51,7 +52,7 @@
 #include "gimp-log.h"
 #include "gimp-intl.h"
 
-#define DEFAULT_TAB_BORDER           0
+
 #define DEFAULT_TAB_ICON_SIZE        GTK_ICON_SIZE_BUTTON
 #define DND_WIDGET_ICON_SIZE         GTK_ICON_SIZE_BUTTON
 #define MENU_WIDGET_ICON_SIZE        GTK_ICON_SIZE_MENU
@@ -108,8 +109,7 @@ static void         gimp_dockbook_dispose                     (GObject        *o
 static void         gimp_dockbook_finalize                    (GObject        *object);
 static void         gimp_dockbook_size_allocate               (GtkWidget      *widget,
                                                                GtkAllocation  *allocation);
-static void         gimp_dockbook_style_set                   (GtkWidget      *widget,
-                                                               GtkStyle       *prev_style);
+static void         gimp_dockbook_style_updated               (GtkWidget      *widget);
 static void         gimp_dockbook_drag_leave                  (GtkWidget      *widget,
                                                                GdkDragContext *context,
                                                                guint           time);
@@ -228,7 +228,7 @@ gimp_dockbook_class_init (GimpDockbookClass *klass)
   object_class->finalize    = gimp_dockbook_finalize;
 
   widget_class->size_allocate = gimp_dockbook_size_allocate;
-  widget_class->style_set     = gimp_dockbook_style_set;
+  widget_class->style_updated = gimp_dockbook_style_updated;
   widget_class->drag_leave    = gimp_dockbook_drag_leave;
   widget_class->drag_motion   = gimp_dockbook_drag_motion;
   widget_class->drag_drop     = gimp_dockbook_drag_drop;
@@ -239,12 +239,6 @@ gimp_dockbook_class_init (GimpDockbookClass *klass)
   klass->dockable_reordered = NULL;
 
   gtk_widget_class_install_style_property (widget_class,
-                                           g_param_spec_int ("tab-border",
-                                                             NULL, NULL,
-                                                             0, G_MAXINT,
-                                                             DEFAULT_TAB_BORDER,
-                                                             GIMP_PARAM_READABLE));
-  gtk_widget_class_install_style_property (widget_class,
                                            g_param_spec_enum ("tab-icon-size",
                                                               NULL, NULL,
                                                               GTK_TYPE_ICON_SIZE,
@@ -346,12 +340,9 @@ gimp_dockbook_size_allocate (GtkWidget      *widget,
 }
 
 static void
-gimp_dockbook_style_set (GtkWidget *widget,
-                         GtkStyle  *prev_style)
+gimp_dockbook_style_updated (GtkWidget *widget)
 {
-  gint tab_border;
-
-  GTK_WIDGET_CLASS (parent_class)->style_set (widget, prev_style);
+  GTK_WIDGET_CLASS (parent_class)->style_updated (widget);
 
   /* Don't attempt to construct widgets that require a GimpContext if
    * we are detached from a top-level, we're either on our way to
@@ -362,14 +353,6 @@ gimp_dockbook_style_set (GtkWidget *widget,
   if (! gtk_widget_is_toplevel (gtk_widget_get_toplevel (widget)))
     return;
 
-  gtk_widget_style_get (widget,
-                        "tab-border", &tab_border,
-                        NULL);
-
-  g_object_set (widget,
-                "tab-border", tab_border,
-                NULL);
-
   gimp_dockbook_recreate_tab_widgets (GIMP_DOCKBOOK (widget),
                                       FALSE /*only_auto*/);
 }
@@ -780,9 +763,11 @@ gimp_dockbook_update_automatic_tab_style (GimpDockbook *dockbook)
   gint          action_widget_size  = 0;
 
   xthickness = gtk_widget_get_style (widget)->xthickness;
+#if 0
   g_object_get (widget,
                 "tab-hborder", &tab_hborder,
                 NULL);
+#endif
   gtk_widget_style_get (widget,
                         "tab-curvature",    &tab_curvature,
                         "focus-line-width", &focus_width,
diff --git a/libgimpwidgets/gimpcolornotebook.c b/libgimpwidgets/gimpcolornotebook.c
index f6b33d2..f89f066 100644
--- a/libgimpwidgets/gimpcolornotebook.c
+++ b/libgimpwidgets/gimpcolornotebook.c
@@ -50,7 +50,6 @@
  **/
 
 
-#define DEFAULT_TAB_BORDER     0
 #define DEFAULT_TAB_ICON_SIZE  GTK_ICON_SIZE_BUTTON
 
 
@@ -127,13 +126,6 @@ gimp_color_notebook_class_init (GimpColorNotebookClass *klass)
   selector_class->set_config            = gimp_color_notebook_set_config;
 
   gtk_widget_class_install_style_property (widget_class,
-                                           g_param_spec_int ("tab-border",
-                                                             NULL,
-                                                             "Width of the border around the tab contents",
-                                                             0, G_MAXINT,
-                                                             DEFAULT_TAB_BORDER,
-                                                             G_PARAM_READABLE));
-  gtk_widget_class_install_style_property (widget_class,
                                            g_param_spec_enum ("tab-icon-size",
                                                               NULL,
                                                               "Size for icons displayed in the tab",
@@ -200,20 +192,14 @@ gimp_color_notebook_style_updated (GtkWidget *widget)
 {
   GimpColorNotebookPrivate *private = GET_PRIVATE (widget);
   GList                    *list;
-  gint                      tab_border;
   GtkIconSize               icon_size;
 
   GTK_WIDGET_CLASS (parent_class)->style_updated (widget);
 
   gtk_widget_style_get (widget,
-                        "tab-border",    &tab_border,
                         "tab-icon_size", &icon_size,
                         NULL);
 
-  g_object_set (private->notebook,
-                "tab-border", tab_border,
-                NULL);
-
   for (list = private->selectors; list; list = g_list_next (list))
     {
       GimpColorSelectorClass *selector_class;
diff --git a/themes/Default/gimp.css b/themes/Default/gimp.css
index d3a31a8..7a54010 100644
--- a/themes/Default/gimp.css
+++ b/themes/Default/gimp.css
@@ -27,11 +27,9 @@
     -GimpDockWindow-menu-preview-size: button;
     -GimpToolPalette-tool-icon-size:   button;
     -GimpToolPalette-button-relief:    none;
-    -GimpDockbook-tab-border:          0;
     -GimpDockbook-tab-icon-size:       button;
-    -GimpColorNotebook-tab-border:     0;
     -GimpColorNotebook-tab-icon-size:  button;
-    -GimpDeviceEditor-handle-size;     12;
+    -GimpDeviceEditor-handle-size:     12;
     -GimpDockable-content-border:      2;
     -GimpEditor-content-spacing:       2;
     -GimpEditor-button-spacing:        2;
@@ -47,11 +45,23 @@ GimpToolDialog {
     -GtkDialog-action-area-border: 6;
 }
 
+GimpColorNotebook tab {
+    padding: 0 0 0 0;
+}
+
+GimpDockbook tab {
+    padding: 0 0 0 0;
+}
+
+GimpDockbook GtkButton {
+    -GtkWidget-focus-padding: 0;
+}
+
 GimpDockable {
     -GimpFrame-label-bold:       0;
     -GimpFrame-label-spacing:    2;
-    -GtkButton-focus-line-width: 1;
-    -GtkButton-focus-padding:    0;
+    -GtkWidget-focus-line-width: 1;
+    -GtkWidget-focus-padding:    0;
 }
 
 GimpDisplayShell {
@@ -60,8 +70,8 @@ GimpDisplayShell {
     -GimpScaleComboBox-label-scale: 0.8333;
     -GtkComboBox-arrow-size:        8;
     -GtkButton-inner-border:        0 0 0 0;
-    -GtkButton-focus-line_width:    0;
-    -GtkButton-focus-padding:       0;
+    -GtkWidget-focus-line_width:    0;
+    -GtkWidget-focus-padding:       0;
 }
 
 GimpColorFrame {
diff --git a/themes/Small/gimp.css b/themes/Small/gimp.css
index 3483846..05c79ea 100644
--- a/themes/Small/gimp.css
+++ b/themes/Small/gimp.css
@@ -27,9 +27,7 @@
     -GimpDockWindow-menu-preview-size: small-toolbar;
     -GimpToolPalette-tool-icon-size:   menu;
     -GimpToolPalette-button-relief:    none;
-    -GimpDockbook-tab-border:          0;
     -GimpDockbook-tab-icon-size:       menu;
-    -GimpColorNotebook-tab-border:     0;
     -GimpColorNotebook-tab-icon-size:  menu;
     -GimpDeviceEditor-handle-size:     12;
     -GimpDockable-content-border:      1;
@@ -47,6 +45,14 @@ GimpToolDialog {
     -GtkDialog-action-area-border: 6;
 }
 
+GimpColorNotebook tab {
+    padding: 0 0 0 0;
+}
+
+GimpDockbook tab {
+    padding: 0 0 0 0;
+}
+
 GimpDockable {
     -GimpFrame-label-bold:       0;
     -GimpFrame-label-spacing:    0;


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