summaryrefslogtreecommitdiffstats
path: root/src/ui/previewholder.cpp
diff options
context:
space:
mode:
authorAlex Valavanis <valavanisalex@gmail.com>2012-04-17 11:21:44 +0000
committerAlex Valavanis <valavanisalex@gmail.com>2012-04-17 11:21:44 +0000
commite48a286477d5b8d1d0f9188262e8252d5f77380b (patch)
treef255b920768d807c134c973649c50d5788c922f0 /src/ui/previewholder.cpp
parentFix for 169888 : HIG Style frame (diff)
downloadinkscape-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/ui/previewholder.cpp')
-rw-r--r--src/ui/previewholder.cpp28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/ui/previewholder.cpp b/src/ui/previewholder.cpp
index d8f1a21a9..ec5d2dc77 100644
--- a/src/ui/previewholder.cpp
+++ b/src/ui/previewholder.cpp
@@ -207,7 +207,12 @@ void PreviewHolder::on_size_allocate( Gtk::Allocation& allocation )
Gtk::VBox::on_size_allocate( allocation );
if ( _insides && !_wrap && (_view != VIEW_TYPE_LIST) && (_anchor == SP_ANCHOR_NORTH || _anchor == SP_ANCHOR_SOUTH) ) {
- Gtk::Requisition req = _insides->size_request();
+ Gtk::Requisition req;
+#if WITH_GTKMM_3_0
+ _insides->get_preferred_size(&req, NULL);
+#else
+ req = _insides->size_request();
+#endif
gint delta = allocation.get_width() - req.width;
if ( (delta > 4) && req.height < allocation.get_height() ) {
@@ -233,7 +238,12 @@ void PreviewHolder::calcGridSize( const Gtk::Widget* thing, int itemCount, int&
height = 1;
if ( _anchor == SP_ANCHOR_SOUTH || _anchor == SP_ANCHOR_NORTH ) {
- Gtk::Requisition req = _scroller->size_request();
+ Gtk::Requisition req;
+#if WITH_GTKMM_3_0
+ _scroller->get_preferred_size(&req, NULL);
+#else
+ req = _scroller->size_request();
+#endif
int currW = _scroller->get_width();
if ( currW > req.width ) {
req.width = currW;
@@ -241,13 +251,23 @@ void PreviewHolder::calcGridSize( const Gtk::Widget* thing, int itemCount, int&
Gtk::HScrollbar* hs = dynamic_cast<Gtk::ScrolledWindow*>(_scroller)->get_hscrollbar();
if ( hs ) {
- Gtk::Requisition scrollReq = hs->size_request();
+ Gtk::Requisition scrollReq;
+#if WITH_GTKMM_3_0
+ hs->get_preferred_size(&req, NULL);
+#else
+ req = hs->size_request();
+#endif
// the +8 is a temporary hack
req.height -= scrollReq.height + 8;
}
- Gtk::Requisition req2 = const_cast<Gtk::Widget*>(thing)->size_request();
+ Gtk::Requisition req2;
+#if WITH_GTKMM_3_0
+ const_cast<Gtk::Widget*>(thing)->get_preferred_size(&req, NULL);
+#else
+ req = const_cast<Gtk::Widget*>(thing)->size_request();
+#endif
int h2 = ((req2.height > 0) && (req.height > req2.height)) ? (req.height / req2.height) : 1;
int w2 = ((req2.width > 0) && (req.width > req2.width)) ? (req.width / req2.width) : 1;