[goffice] ColorSelector: don't let the colour areas expand
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [goffice] ColorSelector: don't let the colour areas expand
- Date: Sun, 3 Dec 2017 20:03:16 +0000 (UTC)
commit 376dabd9e34848098a500dc5c017b632df7683a4
Author: Morten Welinder <terra gnome org>
Date: Sun Dec 3 15:02:12 2017 -0500
ColorSelector: don't let the colour areas expand
...because then they will do it independently for x and y directions.
goffice/gtk/go-color-palette.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/goffice/gtk/go-color-palette.c b/goffice/gtk/go-color-palette.c
index 34bbc0e..453ffd8 100644
--- a/goffice/gtk/go-color-palette.c
+++ b/goffice/gtk/go-color-palette.c
@@ -242,6 +242,10 @@ go_color_palette_class_init (GObjectClass *gobject_class)
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1, G_TYPE_OBJECT);
+
+#ifdef HAVE_GTK_WIDGET_CLASS_SET_CSS_NAME
+ gtk_widget_class_set_css_name ((GtkWidgetClass *)gobject_class, "colorpalette");
+#endif
}
static void
@@ -371,6 +375,8 @@ go_color_palette_button_new (GOColorPalette *pal, GtkGrid *grid,
g_object_set_data (G_OBJECT (swatch), "color",
GUINT_TO_POINTER (color_name->color));
gtk_widget_set_size_request (swatch, COLOR_PREVIEW_WIDTH, COLOR_PREVIEW_HEIGHT);
+ gtk_widget_set_halign (swatch, GTK_ALIGN_CENTER);
+ gtk_widget_set_valign (swatch, GTK_ALIGN_CENTER);
/* Wrap inside a vbox with a border so that we can see the focus indicator */
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]