diff options
| author | Alex Valavanis <valavanisalex@gmail.com> | 2012-06-09 15:43:34 +0000 |
|---|---|---|
| committer | Alex Valavanis <valavanisalex@gmail.com> | 2012-06-09 15:43:34 +0000 |
| commit | 3c3a754c162492932c8037100155a0cd7281e437 (patch) | |
| tree | e904cc141533d600e6beafd3bd4b87775daf638e /src/ui/widget/imagetoggler.cpp | |
| parent | Fix build failure with old GtkAdjustment API (diff) | |
| download | inkscape-3c3a754c162492932c8037100155a0cd7281e437.tar.gz inkscape-3c3a754c162492932c8037100155a0cd7281e437.zip | |
Fix remaining size_request issues for Gtk+ build
(bzr r11475)
Diffstat (limited to 'src/ui/widget/imagetoggler.cpp')
| -rw-r--r-- | src/ui/widget/imagetoggler.cpp | 46 |
1 files changed, 39 insertions, 7 deletions
diff --git a/src/ui/widget/imagetoggler.cpp b/src/ui/widget/imagetoggler.cpp index 73c343887..29907f4c9 100644 --- a/src/ui/widget/imagetoggler.cpp +++ b/src/ui/widget/imagetoggler.cpp @@ -53,13 +53,44 @@ ImageToggler::ImageToggler( char const* on, char const* off) : property_pixbuf() = _property_pixbuf_off.get_value(); } -void -ImageToggler::get_size_vfunc( Gtk::Widget& widget, - const Gdk::Rectangle* cell_area, - int* x_offset, - int* y_offset, - int* width, - int* height ) const + +#if WITH_GTKMM_3_0 +void ImageToggler::get_preferred_height_vfunc(Gtk::Widget& widget, + int& min_h, + int& nat_h) const +{ + Gtk::CellRendererPixbuf::get_preferred_height_vfunc(widget, min_h, nat_h); + + if (min_h) { + min_h += (min_h) >> 1; + } + + if (nat_h) { + nat_h += (nat_h) >> 1; + } +} + +void ImageToggler::get_preferred_width_vfunc(Gtk::Widget& widget, + int& min_w, + int& nat_w) const +{ + Gtk::CellRendererPixbuf::get_preferred_width_vfunc(widget, min_w, nat_w); + + if (min_w) { + min_w += (min_w) >> 1; + } + + if (nat_w) { + nat_w += (nat_w) >> 1; + } +} +#else +void ImageToggler::get_size_vfunc(Gtk::Widget& widget, + const Gdk::Rectangle* cell_area, + int* x_offset, + int* y_offset, + int* width, + int* height ) const { Gtk::CellRendererPixbuf::get_size_vfunc( widget, cell_area, x_offset, y_offset, width, height ); @@ -70,6 +101,7 @@ ImageToggler::get_size_vfunc( Gtk::Widget& widget, *height += (*height) >> 1; } } +#endif #if WITH_GTKMM_3_0 void ImageToggler::render_vfunc( const Cairo::RefPtr<Cairo::Context>& cr, |
