[gimp] Clean up color selector styling



commit acd3a6f169d990a6aab0617975275ca4dce3db0a
Author: Michael Natterer <mitch gimp org>
Date:   Sun Jun 24 15:36:00 2018 +0200

    Clean up color selector styling
    
    - remove redundant frames, 3d-frames are gone anyway, so no need to
      keep double out/in frames around
    - give all color selector classes CSS names
    - add/fix some theme CSS styles

 app/widgets/gimpcolorselectorpalette.c | 12 ++++--------
 libgimpwidgets/gimpcolornotebook.c     |  4 ++--
 libgimpwidgets/gimpcolorselect.c       |  2 ++
 libgimpwidgets/gimpcolorselection.c    |  2 ++
 modules/color-selector-cmyk.c          |  2 ++
 modules/color-selector-water.c         |  2 ++
 modules/color-selector-wheel.c         | 11 +++--------
 themes/System/gimp.css                 | 12 ++++++++----
 8 files changed, 25 insertions(+), 22 deletions(-)
---
diff --git a/app/widgets/gimpcolorselectorpalette.c b/app/widgets/gimpcolorselectorpalette.c
index b3c4ad69da..3fec4988ad 100644
--- a/app/widgets/gimpcolorselectorpalette.c
+++ b/app/widgets/gimpcolorselectorpalette.c
@@ -61,6 +61,9 @@ gimp_color_selector_palette_class_init (GimpColorSelectorPaletteClass *klass)
   selector_class->icon_name  = GIMP_ICON_PALETTE;
   selector_class->set_color  = gimp_color_selector_palette_set_color;
   selector_class->set_config = gimp_color_selector_palette_set_config;
+
+  gtk_widget_class_set_css_name (GTK_WIDGET_CLASS (klass),
+                                 "GimpColorSelectorPalette");
 }
 
 static void
@@ -139,13 +142,6 @@ gimp_color_selector_palette_set_config (GimpColorSelector *selector,
 
       if (! select->view)
         {
-          GtkWidget *frame;
-
-          frame = gtk_frame_new (NULL);
-          gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
-          gtk_box_pack_start (GTK_BOX (select), frame, TRUE, TRUE, 0);
-          gtk_widget_show (frame);
-
           select->view = gimp_view_new_full_by_types (select->context,
                                                       GIMP_TYPE_PALETTE_VIEW,
                                                       GIMP_TYPE_PALETTE,
@@ -158,7 +154,7 @@ gimp_color_selector_palette_set_config (GimpColorSelector *selector,
           gimp_view_renderer_palette_set_draw_grid
             (GIMP_VIEW_RENDERER_PALETTE (GIMP_VIEW (select->view)->renderer),
              TRUE);
-          gtk_container_add (GTK_CONTAINER (frame), select->view);
+          gtk_box_pack_start (GTK_BOX (select), select->view, TRUE, TRUE, 0);
           gtk_widget_show (select->view);
 
           g_signal_connect (select->view, "entry-clicked",
diff --git a/libgimpwidgets/gimpcolornotebook.c b/libgimpwidgets/gimpcolornotebook.c
index fddf74f6c2..78152db1f7 100644
--- a/libgimpwidgets/gimpcolornotebook.c
+++ b/libgimpwidgets/gimpcolornotebook.c
@@ -135,8 +135,6 @@ gimp_color_notebook_class_init (GimpColorNotebookClass *klass)
   selector_class->set_model_visible     = gimp_color_notebook_set_model_visible;
   selector_class->set_config            = gimp_color_notebook_set_config;
 
-  gtk_widget_class_set_css_name (widget_class, "GimpColorNotebook");
-
   gtk_widget_class_install_style_property (widget_class,
                                            g_param_spec_enum ("tab-icon-size",
                                                               NULL,
@@ -145,6 +143,8 @@ gimp_color_notebook_class_init (GimpColorNotebookClass *klass)
                                                               DEFAULT_TAB_ICON_SIZE,
                                                               G_PARAM_READABLE));
 
+  gtk_widget_class_set_css_name (widget_class, "GimpColorNotebook");
+
   g_type_class_add_private (object_class, sizeof (GimpColorNotebookPrivate));
 }
 
diff --git a/libgimpwidgets/gimpcolorselect.c b/libgimpwidgets/gimpcolorselect.c
index f6340b87b6..103a707fbf 100644
--- a/libgimpwidgets/gimpcolorselect.c
+++ b/libgimpwidgets/gimpcolorselect.c
@@ -329,6 +329,8 @@ gimp_color_select_class_init (GimpColorSelectClass *klass)
   selector_class->set_model_visible     = gimp_color_select_set_model_visible;
   selector_class->set_config            = gimp_color_select_set_config;
 
+  gtk_widget_class_set_css_name (GTK_WIDGET_CLASS (klass), "GimpColorSelect");
+
   fish_rgb_to_lch    = babl_fish (babl_format ("R'G'B'A double"),
                                   babl_format ("CIE LCH(ab) double"));
   fish_lch_to_rgb    = babl_fish (babl_format ("CIE LCH(ab) double"),
diff --git a/libgimpwidgets/gimpcolorselection.c b/libgimpwidgets/gimpcolorselection.c
index 293d324567..2f927883c7 100644
--- a/libgimpwidgets/gimpcolorselection.c
+++ b/libgimpwidgets/gimpcolorselection.c
@@ -167,6 +167,8 @@ gimp_color_selection_class_init (GimpColorSelectionClass *klass)
                   g_cclosure_marshal_VOID__VOID,
                   G_TYPE_NONE, 0);
 
+  gtk_widget_class_set_css_name (GTK_WIDGET_CLASS (klass), "GimpColorSelection");
+
   g_type_class_add_private (object_class, sizeof (GimpColorSelectionPrivate));
 }
 
diff --git a/modules/color-selector-cmyk.c b/modules/color-selector-cmyk.c
index 0135341a04..249bccaeba 100644
--- a/modules/color-selector-cmyk.c
+++ b/modules/color-selector-cmyk.c
@@ -118,6 +118,8 @@ colorsel_cmyk_class_init (ColorselCmykClass *klass)
   selector_class->icon_name  = GIMP_ICON_COLOR_SELECTOR_CMYK;
   selector_class->set_color  = colorsel_cmyk_set_color;
   selector_class->set_config = colorsel_cmyk_set_config;
+
+  gtk_widget_class_set_css_name (GTK_WIDGET_CLASS (klass), "ColorselCmyk");
 }
 
 static void
diff --git a/modules/color-selector-water.c b/modules/color-selector-water.c
index bba87c3b35..34d2e84da5 100644
--- a/modules/color-selector-water.c
+++ b/modules/color-selector-water.c
@@ -131,6 +131,8 @@ colorsel_water_class_init (ColorselWaterClass *klass)
   selector_class->help_id    = "gimp-colorselector-watercolor";
   selector_class->icon_name  = GIMP_ICON_COLOR_SELECTOR_WATER;
   selector_class->set_config = colorsel_water_set_config;
+
+  gtk_widget_class_set_css_name (GTK_WIDGET_CLASS (klass), "ColorselWater");
 }
 
 static void
diff --git a/modules/color-selector-wheel.c b/modules/color-selector-wheel.c
index e8f539aa38..11a654f3ba 100644
--- a/modules/color-selector-wheel.c
+++ b/modules/color-selector-wheel.c
@@ -106,6 +106,8 @@ colorsel_wheel_class_init (ColorselWheelClass *klass)
   selector_class->icon_name  = GIMP_ICON_COLOR_SELECTOR_TRIANGLE;
   selector_class->set_color  = colorsel_wheel_set_color;
   selector_class->set_config = colorsel_wheel_set_config;
+
+  gtk_widget_class_set_css_name (GTK_WIDGET_CLASS (klass), "ColorselWheel");
 }
 
 static void
@@ -116,17 +118,10 @@ colorsel_wheel_class_finalize (ColorselWheelClass *klass)
 static void
 colorsel_wheel_init (ColorselWheel *wheel)
 {
-  GtkWidget *frame;
-
-  frame = gtk_frame_new (NULL);
-  gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
-  gtk_box_pack_start (GTK_BOX (wheel), frame, TRUE, TRUE, 0);
-  gtk_widget_show (frame);
-
   wheel->hsv = gimp_color_wheel_new ();
   g_object_add_weak_pointer (G_OBJECT (wheel->hsv),
                              (gpointer) &wheel->hsv);
-  gtk_container_add (GTK_CONTAINER (frame), wheel->hsv);
+  gtk_box_pack_start (GTK_BOX (wheel), wheel->hsv, TRUE, TRUE, 0);
   gtk_widget_show (wheel->hsv);
 
   g_signal_connect (wheel->hsv, "changed",
diff --git a/themes/System/gimp.css b/themes/System/gimp.css
index 7e5763b2f2..a6196f5500 100644
--- a/themes/System/gimp.css
+++ b/themes/System/gimp.css
@@ -29,18 +29,22 @@ GimpColorNotebook tab {
     padding: 0 0 0 0;
 }
 
-GimpColorScales spinbutton {
-    min-height: 0;
-}
-
+GimpColorNotebook spinbutton,
+GimpColorNotebook spinbutton entry,
+GimpColorScales spinbutton,
 GimpColorScales spinbutton entry {
     min-height: 0;
 }
 
+GimpColorNotebook spinbutton button,
 GimpColorScales spinbutton button {
     padding: 0 0 0 0;
 }
 
+GimpColorSelection ColorselCmyk {
+    padding: 2px 2px 2px 2px;
+}
+
 GimpColorHistory button {
     padding: 3px 3px 3px 3px;
 }


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