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

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


Author: dburrows
Date: Wed Apr 27 02:39:57 2005
New Revision: 3122

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/vscreen/vs_table.cc
Log:
Change the semantics of vs_table::FILL.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Wed Apr 27 02:39:57 2005
@@ -1,5 +1,13 @@
 2005-04-26  Daniel Burrows  <dburrows@debian.org>
 
+	* src/vscreen/vs_table.cc:
+
+	  Change the semantics of FILL/EXPAND: EXPAND only changes whether
+	  a widget's row can be expanded; in order to expand the widget
+	  itself you must also specify FILL.  For backwards compatibility
+	  and ease of use, the non-opts add_widget sets FILL if EXPAND is
+	  set.
+
 	* src/apt_options.cc:
 
 	  Put the Ok/Cancel button in a separate table.

Modified: branches/aptitude-0.3/aptitude/src/vscreen/vs_table.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/vscreen/vs_table.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/vscreen/vs_table.cc	Wed Apr 27 02:39:57 2005
@@ -108,7 +108,7 @@
 {
   int opts=ALIGN_CENTER;
   if(expand)
-    opts|=EXPAND;
+    opts|=EXPAND|FILL;
   if(shrink)
     opts|=SHRINK;
 
@@ -1230,11 +1230,10 @@
 	assert(x+width<=getmaxx());
 	assert(y+height<=getmaxy());
 
-	// If the widget can't be filled or expanded and it was
-	// allocated too much space, make sure it's aligned in the
-	// space:
+	// If the widget can't be filled and it was allocated too much
+	// space, make sure it's aligned in the space:
 
-	if(width>i->request_w && !(i->fill_x || i->expand_x))
+	if(width>i->request_w && !i->fill_x)
 	  {
 	    if(i->align_left_x && i->align_right_x)
 	      x+=(width-i->request_w)/2;
@@ -1244,7 +1243,7 @@
 	    width=i->request_w;
 	  }
 
-	if(height>i->request_h && !(i->fill_y || i->expand_y))
+	if(height>i->request_h && !i->fill_y)
 	  {
 	    if(i->align_left_y && i->align_right_y)
 	      y+=(height-i->request_h)/2;