Commit acd3a6f1 authored by Michael Natterer's avatar Michael Natterer 😴

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
parent 2b8b780b
......@@ -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",
......
......@@ -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));
}
......
......@@ -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"),
......
......@@ -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));
}
......
......@@ -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
......
......@@ -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
......
......@@ -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",
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment