[Aptitude-devel] r3092 - in branches/aptitude-0.3/aptitude: . src

Daniel Burrows dburrows@costa.debian.org
Tue, 26 Apr 2005 13:40:40 +0000


Author: dburrows
Date: Tue Apr 26 13:40:37 2005
New Revision: 3092

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/solution_dialog.cc
Log:
Add a scrollbar to the examination dialog.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Tue Apr 26 13:40:37 2005
@@ -1,3 +1,10 @@
+2005-04-26  Daniel Burrows  <dburrows@debian.org>
+
+	* src/solution_dialog.cc:
+
+	  Move the buttons into a separate "box" table, and add a
+	  scrollbar to the solution dialog.
+
 2005-04-25  Daniel Burrows  <dburrows@debian.org>
 
 	* src/solution_dialog.cc:

Modified: branches/aptitude-0.3/aptitude/src/solution_dialog.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/solution_dialog.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/solution_dialog.cc	Tue Apr 26 13:40:37 2005
@@ -29,6 +29,7 @@
 #include <vscreen/vs_button.h>
 #include <vscreen/vs_center.h>
 #include <vscreen/vs_frame.h>
+#include <vscreen/vs_scrollbar.h>
 #include <vscreen/vs_table.h>
 #include <vscreen/vs_text_layout.h>
 
@@ -112,11 +113,24 @@
   vs_table *t=new vs_table;
   vscreen_widget *rval=new vs_center(new vs_frame(t));
 
-  t->add_widget_opts(new solution_dialog,
-		     0, 0, 1, 4,
-		     vs_table::EXPAND | vs_table::FILL,
+  vs_text_layout *display=new solution_dialog;
+  vs_scrollbar *scrl=new vs_scrollbar(vs_scrollbar::VERTICAL);
+
+  display->location_changed.connect(sigc::mem_fun(scrl, &vs_scrollbar::set_slider));
+  scrl->scrollbar_interaction.connect(sigc::mem_fun(display, &vs_text_layout::scroll));
+
+  t->add_widget_opts(display,
+		     0, 0, 1, 1,
+		     vs_table::EXPAND | vs_table::FILL | vs_table::SHRINK,
 		     vs_table::FILL | vs_table::SHRINK);
 
+  t->add_widget_opts(scrl,
+		     0, 1, 1, 1,
+		     0,
+		     vs_table::EXPAND | vs_table::FILL | vs_table::SHRINK);
+
+  vs_table *bt=new vs_table;
+
   //t->set_bg(get_color("DefaultWidgetBackground")|A_REVERSE);
 
   // TODO: for dialogs like this, I really should have support for
@@ -139,18 +153,21 @@
   bapply->set_bg(get_color("DefaultWidgetBackground")|A_REVERSE);
   bclose->set_bg(get_color("DefaultWidgetBackground")|A_REVERSE);
 
-  t->add_widget_opts(bprev,
-		     1, 0, 1, 1,
-		     vs_table::FILL, vs_table::FILL);
-  t->add_widget_opts(bnext,
-		     1, 1, 1, 1,
-		     vs_table::FILL, vs_table::FILL);
-  t->add_widget_opts(bapply,
-		     1, 2, 1, 1,
-		     vs_table::FILL, vs_table::FILL);
-  t->add_widget_opts(bclose,
-		     1, 3, 1, 1,
-		     vs_table::FILL, vs_table::FILL);
+  bt->add_widget_opts(bprev,
+		     0, 0, 1, 1,
+		     vs_table::FILL | vs_table::EXPAND, vs_table::FILL);
+  bt->add_widget_opts(bnext,
+		     0, 1, 1, 1,
+		     vs_table::FILL | vs_table::EXPAND, vs_table::FILL);
+  bt->add_widget_opts(bapply,
+		     0, 2, 1, 1,
+		     vs_table::FILL | vs_table::EXPAND, vs_table::FILL);
+  bt->add_widget_opts(bclose,
+		     0, 3, 1, 1,
+		     vs_table::FILL | vs_table::EXPAND, vs_table::FILL);
+
+  t->add_widget_opts(bt, 1, 0, 1, 2,
+		     vs_table::FILL | vs_table::EXPAND, 0);
 
   return rval;
 }