From 49a7927ecf31ace696e9e5770e8d6543c356db7a Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Thu, 28 Jul 2016 19:15:34 +0100 Subject: Finish removing GTK+ 2 fallbacks (bzr r15023.2.8) --- src/ui/previewholder.cpp | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'src/ui/previewholder.cpp') diff --git a/src/ui/previewholder.cpp b/src/ui/previewholder.cpp index 8336467c4..bb7f077b0 100644 --- a/src/ui/previewholder.cpp +++ b/src/ui/previewholder.cpp @@ -259,12 +259,8 @@ void PreviewHolder::on_size_allocate( Gtk::Allocation& allocation ) if ( _insides && !_wrap && (_view != VIEW_TYPE_LIST) && (_anchor == SP_ANCHOR_NORTH || _anchor == SP_ANCHOR_SOUTH) ) { Gtk::Requisition req; -#if GTK_CHECK_VERSION(3,0,0) Gtk::Requisition req_natural; _insides->get_preferred_size(req, req_natural); -#else - req = _insides->size_request(); -#endif gint delta = allocation.get_width() - req.width; if ( (delta > 4) && req.height < allocation.get_height() ) { @@ -306,43 +302,27 @@ void PreviewHolder::calcGridSize( const Gtk::Widget* thing, int itemCount, int& if ( _anchor == SP_ANCHOR_SOUTH || _anchor == SP_ANCHOR_NORTH ) { Gtk::Requisition req; -#if GTK_CHECK_VERSION(3,0,0) Gtk::Requisition req_natural; _scroller->get_preferred_size(req, req_natural); -#else - req = _scroller->size_request(); -#endif int currW = _scroller->get_width(); if ( currW > req.width ) { req.width = currW; } -#if GTK_CHECK_VERSION(3,0,0) - Gtk::Scrollbar* hs = dynamic_cast(_scroller)->get_hscrollbar(); -#else - Gtk::HScrollbar* hs = dynamic_cast(_scroller)->get_hscrollbar(); -#endif + auto hs = dynamic_cast(_scroller)->get_hscrollbar(); if ( hs ) { Gtk::Requisition scrollReq; -#if GTK_CHECK_VERSION(3,0,0) Gtk::Requisition scrollReq_natural; hs->get_preferred_size(scrollReq, scrollReq_natural); -#else - scrollReq = hs->size_request(); -#endif // the +8 is a temporary hack req.height -= scrollReq.height + 8; } Gtk::Requisition req2; -#if GTK_CHECK_VERSION(3,0,0) Gtk::Requisition req2_natural; const_cast(thing)->get_preferred_size(req2, req2_natural); -#else - req2 = const_cast(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; -- cgit v1.2.3