diff options
| author | Alex Valavanis <valavanisalex@gmail.com> | 2012-04-17 11:21:44 +0000 |
|---|---|---|
| committer | Alex Valavanis <valavanisalex@gmail.com> | 2012-04-17 11:21:44 +0000 |
| commit | e48a286477d5b8d1d0f9188262e8252d5f77380b (patch) | |
| tree | f255b920768d807c134c973649c50d5788c922f0 /src/widgets/sp-color-slider.cpp | |
| parent | Fix for 169888 : HIG Style frame (diff) | |
| download | inkscape-e48a286477d5b8d1d0f9188262e8252d5f77380b.tar.gz inkscape-e48a286477d5b8d1d0f9188262e8252d5f77380b.zip | |
Work around for some missing glibmm headers in gtkmm (should be fixed in gtkmm 3.4)
(bzr r11261)
Diffstat (limited to 'src/widgets/sp-color-slider.cpp')
| -rw-r--r-- | src/widgets/sp-color-slider.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/widgets/sp-color-slider.cpp b/src/widgets/sp-color-slider.cpp index b74be502b..c983a4302 100644 --- a/src/widgets/sp-color-slider.cpp +++ b/src/widgets/sp-color-slider.cpp @@ -32,6 +32,15 @@ static void sp_color_slider_destroy (GtkObject *object); static void sp_color_slider_realize (GtkWidget *widget); static void sp_color_slider_size_request (GtkWidget *widget, GtkRequisition *requisition); + +static void sp_color_slider_get_preferred_width(GtkWidget *widget, + gint *minimal_width, + gint *natural_width); + +static void sp_color_slider_get_preferred_height(GtkWidget *widget, + gint *minimal_height, + gint *natural_height); + static void sp_color_slider_size_allocate (GtkWidget *widget, GtkAllocation *allocation); /* static void sp_color_slider_draw (GtkWidget *widget, GdkRectangle *area); */ /* static void sp_color_slider_draw_focus (GtkWidget *widget); */ @@ -117,7 +126,12 @@ sp_color_slider_class_init (SPColorSliderClass *klass) object_class->destroy = sp_color_slider_destroy; widget_class->realize = sp_color_slider_realize; +#if GTK_CHECK_VERSION(3,0,0) + widget_class->get_preferred_width = sp_color_slider_get_preferred_width; + widget_class->get_preferred_height = sp_color_slider_get_preferred_height; +#else widget_class->size_request = sp_color_slider_size_request; +#endif widget_class->size_allocate = sp_color_slider_size_allocate; /* widget_class->draw = sp_color_slider_draw; */ /* widget_class->draw_focus = sp_color_slider_draw_focus; */ @@ -225,6 +239,20 @@ sp_color_slider_size_request (GtkWidget *widget, GtkRequisition *requisition) requisition->height = SLIDER_HEIGHT + style->ythickness * 2; } +static void sp_color_slider_get_preferred_width(GtkWidget *widget, gint *minimal_width, gint *natural_width) +{ + GtkRequisition requisition; + sp_color_slider_size_request(widget, &requisition); + *minimal_width = *natural_width = requisition.width; +} + +static void sp_color_slider_get_preferred_height(GtkWidget *widget, gint *minimal_height, gint *natural_height) +{ + GtkRequisition requisition; + sp_color_slider_size_request(widget, &requisition); + *minimal_height = *natural_height = requisition.height; +} + static void sp_color_slider_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { |
