index da991e1dfc85756e7abf220be1c5ba08325ca41c..ba0b6a7efa31f9aa822b0c17bf2cc1d062d85c1a 100644 (file)
--- a/src/ui/previewholder.cpp
+++ b/src/ui/previewholder.cpp
{
items.clear();
_prefCols = 0;
+ // Kludge to restore scrollbars
+ if ( !_wrap && (_view != VIEW_TYPE_LIST) && (_anchor == Gtk::ANCHOR_NORTH || _anchor == Gtk::ANCHOR_SOUTH) ) {
+ dynamic_cast<Gtk::ScrolledWindow*>(_scroller)->set_policy( Gtk::POLICY_AUTOMATIC, Gtk::POLICY_NEVER );
+ }
rebuildUI();
}
_baseSize = size;
_view = view;
_ratio = ratio;
+ // Kludge to restore scrollbars
+ if ( !_wrap && (_view != VIEW_TYPE_LIST) && (_anchor == Gtk::ANCHOR_NORTH || _anchor == Gtk::ANCHOR_SOUTH) ) {
+ dynamic_cast<Gtk::ScrolledWindow*>(_scroller)->set_policy( Gtk::POLICY_AUTOMATIC, Gtk::POLICY_NEVER );
+ }
rebuildUI();
}
}
// g_message( "on_size_allocate(%d, %d) (%d, %d)", allocation.get_x(), allocation.get_y(), allocation.get_width(), allocation.get_height() );
// g_message(" anchor:%d", _anchor);
Gtk::VBox::on_size_allocate( allocation );
+
+ if ( _insides && !_wrap && (_view != VIEW_TYPE_LIST) && (_anchor == Gtk::ANCHOR_NORTH || _anchor == Gtk::ANCHOR_SOUTH) ) {
+ Gtk::Requisition req;
+ _insides->size_request(req);
+ gint delta = allocation.get_width() - req.width;
+
+ if ( (delta > 4) && req.height < allocation.get_height() ) {
+ dynamic_cast<Gtk::ScrolledWindow*>(_scroller)->set_policy( Gtk::POLICY_NEVER, Gtk::POLICY_NEVER );
+ } else {
+ dynamic_cast<Gtk::ScrolledWindow*>(_scroller)->set_policy( Gtk::POLICY_AUTOMATIC, Gtk::POLICY_NEVER );
+ }
+ }
}
void PreviewHolder::on_size_request( Gtk::Requisition* requisition )