diff --git a/livesupport/src/modules/widgets/include/LiveSupport/Widgets/ScrolledWindow.h b/livesupport/src/modules/widgets/include/LiveSupport/Widgets/ScrolledWindow.h index 79490b5eb..938e029f7 100644 --- a/livesupport/src/modules/widgets/include/LiveSupport/Widgets/ScrolledWindow.h +++ b/livesupport/src/modules/widgets/include/LiveSupport/Widgets/ScrolledWindow.h @@ -65,6 +65,18 @@ namespace Widgets { */ class ScrolledWindow : public Gtk::ScrolledWindow { + private: + /** + * The shadow type of the child widget. + */ + Gtk::ShadowType shadowType; + + /** + * Whether the shadow type has been manually set on the child widget. + */ + bool useShadowType; + + protected: /** * Handle the realize event. @@ -84,6 +96,17 @@ class ScrolledWindow : public Gtk::ScrolledWindow */ virtual ~ScrolledWindow(void) throw (); + + /** + * Set the shadow_type of the child widget. + * Must be called before the window is realized. + */ + void + setShadowType(Gtk::ShadowType st) throw () + { + shadowType = st; + useShadowType = true; + } }; diff --git a/livesupport/src/modules/widgets/src/ScrolledWindow.cxx b/livesupport/src/modules/widgets/src/ScrolledWindow.cxx index f1bc62c83..a56c8262e 100644 --- a/livesupport/src/modules/widgets/src/ScrolledWindow.cxx +++ b/livesupport/src/modules/widgets/src/ScrolledWindow.cxx @@ -34,6 +34,7 @@ #endif #include +#include #include "LiveSupport/Widgets/WidgetFactory.h" #include "LiveSupport/Widgets/ScrolledWindow.h" @@ -57,7 +58,8 @@ using namespace LiveSupport::Widgets; * Constructor. *----------------------------------------------------------------------------*/ ScrolledWindow :: ScrolledWindow(void) throw () - : Gtk::ScrolledWindow() + : Gtk::ScrolledWindow(), + useShadowType(false) { } @@ -80,6 +82,13 @@ ScrolledWindow :: on_realize() throw () Widget * child = get_child(); child->modify_bg(Gtk::STATE_NORMAL, bgColor); + if (useShadowType) { + Gtk::Viewport * viewport = dynamic_cast(child); + if (viewport) { + viewport->set_shadow_type(shadowType); + } + } + Gtk::ScrolledWindow::on_realize(); } diff --git a/livesupport/src/products/gLiveSupport/src/BackupView.cxx b/livesupport/src/products/gLiveSupport/src/BackupView.cxx index 8c01866f6..484911f59 100644 --- a/livesupport/src/products/gLiveSupport/src/BackupView.cxx +++ b/livesupport/src/products/gLiveSupport/src/BackupView.cxx @@ -37,7 +37,10 @@ #include #include #include +#include +#include +#include "LiveSupport/Widgets/ScrolledWindow.h" #include "BackupView.h" @@ -65,11 +68,14 @@ BackupView :: BackupView (Ptr::Ref gLiveSupport, : LocalizedObject(bundle), gLiveSupport(gLiveSupport) { - Gtk::Box * criteriaView = constructCriteriaView(); - Gtk::Box * backupListView = constructBackupListView(); + Gtk::Box * criteriaView = constructCriteriaView(); + Gtk::Box * backupListView = constructBackupListView(); - pack_start(*criteriaView, Gtk::PACK_EXPAND_WIDGET, 5); - pack_start(*backupListView, Gtk::PACK_EXPAND_WIDGET, 5); + Gtk::VPaned * twoPanedView = Gtk::manage(new Gtk::VPaned); + twoPanedView->pack1(*criteriaView, Gtk::PACK_EXPAND_WIDGET, 5); + twoPanedView->pack2(*backupListView, Gtk::PACK_EXPAND_WIDGET, 5); + + add(*twoPanedView); } @@ -99,10 +105,16 @@ BackupView :: constructCriteriaView(void) throw () Gtk::Box * criteriaButtonBox = Gtk::manage(new Gtk::HButtonBox( Gtk::BUTTONBOX_END )); criteriaButtonBox->pack_start(*backupButton, Gtk::PACK_SHRINK, 5); - + + ScrolledWindow * criteriaWindow = Gtk::manage(new ScrolledWindow); + criteriaWindow->add(*criteriaEntry); + // NOTE: criteriaWindow->setShadowType() causes Gtk warnings here + // TODO: find out why and fix it + criteriaWindow->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); + Gtk::Box * criteriaView = Gtk::manage(new Gtk::VBox); - criteriaView->pack_start(*criteriaEntry, Gtk::PACK_SHRINK, 5); - criteriaView->pack_start(*criteriaButtonBox, Gtk::PACK_SHRINK, 5); + criteriaView->pack_start(*criteriaWindow, Gtk::PACK_EXPAND_WIDGET, 0); + criteriaView->pack_start(*criteriaButtonBox, Gtk::PACK_SHRINK, 5); return criteriaView; } @@ -140,9 +152,14 @@ BackupView :: constructBackupListView(void) throw () backupListButtonBox->pack_start(*deleteButton, Gtk::PACK_SHRINK, 5); backupListButtonBox->pack_start(*saveButton, Gtk::PACK_SHRINK, 5); + ScrolledWindow * backupListWindow = Gtk::manage(new ScrolledWindow); + backupListWindow->add(*backupList); + backupListWindow->setShadowType(Gtk::SHADOW_NONE); + backupListWindow->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); + Gtk::Box * backupListView = Gtk::manage(new Gtk::VBox); - backupListView->pack_start(*backupList, Gtk::PACK_SHRINK, 5); - backupListView->pack_start(*backupListButtonBox, Gtk::PACK_SHRINK, 5); + backupListView->pack_start(*backupListWindow, Gtk::PACK_EXPAND_WIDGET, 5); + backupListView->pack_start(*backupListButtonBox, Gtk::PACK_SHRINK, 5); return backupListView; } diff --git a/livesupport/src/products/gLiveSupport/src/BackupView.h b/livesupport/src/products/gLiveSupport/src/BackupView.h index bafa35933..b108798dd 100644 --- a/livesupport/src/products/gLiveSupport/src/BackupView.h +++ b/livesupport/src/products/gLiveSupport/src/BackupView.h @@ -65,7 +65,8 @@ using namespace LiveSupport::Widgets; /* =============================================================== data types */ /** - * The backup view. This will be contained in another window, most likely + * The backup view, a subclass of Gtk::VBox. + * This will be contained in another window, most likely * as the contents of a notebook tab. * * The layout of the view is roughly the following: diff --git a/livesupport/src/products/gLiveSupport/src/OptionsWindow.cxx b/livesupport/src/products/gLiveSupport/src/OptionsWindow.cxx index b9982d37f..315c02ac5 100644 --- a/livesupport/src/products/gLiveSupport/src/OptionsWindow.cxx +++ b/livesupport/src/products/gLiveSupport/src/OptionsWindow.cxx @@ -160,7 +160,7 @@ OptionsWindow :: OptionsWindow (Ptr::Ref gLiveSupport, // show everything set_name(windowName); - set_default_size(500, 400); + set_default_size(700, 400); set_modal(false); property_window_position().set_value(Gtk::WIN_POS_NONE);