[gtk+] colorbutton: don't hardcode a 16px margin around the color sample
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] colorbutton: don't hardcode a 16px margin around the color sample
- Date: Thu, 3 May 2012 19:03:36 +0000 (UTC)
commit b9eb02ebbe25f5642fd5cfba354dfa18c52076ca
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Thu May 3 15:00:38 2012 -0400
colorbutton: don't hardcode a 16px margin around the color sample
Since themes might want different paddings around the color sample
according to where it's being used, don't hardcode a 16px one here.
The theme can specify a padding to get the same effect.
Reported by Christian Persch <chpe gnome org>
gtk/gtkcolorbutton.c | 11 +----------
1 files changed, 1 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtkcolorbutton.c b/gtk/gtkcolorbutton.c
index ab2821f..7ad5cd5 100644
--- a/gtk/gtkcolorbutton.c
+++ b/gtk/gtkcolorbutton.c
@@ -60,8 +60,6 @@
#define CHECK_DARK (1.0 / 3.0)
#define CHECK_LIGHT (2.0 / 3.0)
-#define COLOR_SAMPLE_MARGIN 1
-
struct _GtkColorButtonPrivate
{
GtkWidget *draw_area; /* Widget where we draw the color sample */
@@ -437,19 +435,12 @@ gtk_color_button_init (GtkColorButton *button)
gtk_widget_push_composite_child ();
button->priv->draw_area = gtk_drawing_area_new ();
- g_object_set (button->priv->draw_area,
- "margin-top", COLOR_SAMPLE_MARGIN,
- "margin-bottom", COLOR_SAMPLE_MARGIN,
- "margin-left", 16,
- "margin-right", 16,
- NULL);
-
layout = gtk_widget_create_pango_layout (GTK_WIDGET (button), "Black");
pango_layout_get_pixel_extents (layout, NULL, &rect);
g_object_unref (layout);
gtk_widget_set_size_request (button->priv->draw_area,
- rect.width, rect.height - 2 * COLOR_SAMPLE_MARGIN);
+ rect.width, rect.height);
g_signal_connect (button->priv->draw_area, "draw",
G_CALLBACK (gtk_color_button_draw_cb), button);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]