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

Daniel Burrows dburrows@costa.debian.org
Wed, 27 Apr 2005 02:37:22 +0000


Author: dburrows
Date: Wed Apr 27 02:37:19 2005
New Revision: 3121

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/apt_options.cc
Log:
  Fix the layout of the buttons in the options dialog.


Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Wed Apr 27 02:37:19 2005
@@ -1,5 +1,9 @@
 2005-04-26  Daniel Burrows  <dburrows@debian.org>
 
+	* src/apt_options.cc:
+
+	  Put the Ok/Cancel button in a separate table.
+
 	* src/apt_config_widgets.cc:
 
 	  Flow the text in the configuration button labels.

Modified: branches/aptitude-0.3/aptitude/src/apt_options.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/apt_options.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/apt_options.cc	Wed Apr 27 02:37:19 2005
@@ -251,10 +251,6 @@
   okbutton->pressed.connect(sigc::mem_fun(*manager, &dialog_manager::commit));
   cancelbutton->pressed.connect(sigc::mem_fun(*manager, &dialog_manager::destroy));
 
-  // FIXME: tables should support left/center/right-alignment..
-  vs_center *cok=new vs_center(okbutton);
-  vs_center *ccancel=new vs_center(cancelbutton);
-
   int row=0;
 
   while(items->type!=option_item::OPTION_END)
@@ -353,9 +349,18 @@
       items++;
     }
 
-  table->add_widget(cok, row, 0, 1, 1, false, false);
-  table->add_widget(ccancel, row, 1, 1, 1, false, false);
-
+  vs_table *bt=new vs_table;
+  bt->set_bg(get_color("DefaultWidgetBackground")|A_REVERSE);
+  bt->add_widget_opts(okbutton, 0, 0, 1, 1,
+		      vs_table::ALIGN_CENTER | vs_table::EXPAND,
+		      vs_table::ALIGN_CENTER);
+  bt->add_widget_opts(cancelbutton, 0, 1, 1, 1,
+		      vs_table::ALIGN_CENTER | vs_table::EXPAND,
+		      vs_table::ALIGN_CENTER);
+  table->add_widget_opts(bt, row, 0, 2, 1,
+			 vs_table::ALIGN_CENTER | vs_table::EXPAND,
+			 vs_table::ALIGN_CENTER);
+  
   vs_frame *frame=new vs_frame(table);
   frame->set_bg(get_color("DefaultWidgetBackground")|A_REVERSE);