[Aptitude-svn-commit] r3350 - in branches/aptitude-0.3/aptitude: . src

Daniel Burrows dburrows@costa.debian.org
Tue, 07 Jun 2005 05:34:43 +0000


Author: dburrows
Date: Tue Jun  7 05:34:40 2005
New Revision: 3350

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/apt_options.cc
Log:
Update the generation of the options dialog to use styles instead of explicit color setting.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Tue Jun  7 05:34:40 2005
@@ -1,5 +1,9 @@
 2005-06-06  Daniel Burrows  <dburrows@debian.org>
 
+	* src/apt_options.cc:
+
+	Update the option dialog generation to use styles.
+
 	* src/apt_config_widgets.cc:
 
 	Don't bother setting the color of apt_bool_widget; this shouldn't

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	Tue Jun  7 05:34:40 2005
@@ -236,12 +236,9 @@
   // that does this?
   vs_table *table=new vs_table;
   table->set_colsep(1);
-  table->set_bg(get_color("DefaultWidgetBackground")|A_REVERSE);
 
   vs_button *okbutton=new vs_button(_("Ok"));
   vs_button *cancelbutton=new vs_button(_("Cancel"));
-  okbutton->set_bg(get_color("DefaultWidgetBackground")|A_REVERSE);
-  cancelbutton->set_bg(get_color("DefaultWidgetBackground")|A_REVERSE);
 
   table->connect_key("Confirm", &global_bindings, okbutton->pressed.make_slot());
   table->connect_key("Cancel", &global_bindings, cancelbutton->pressed.make_slot());
@@ -265,8 +262,6 @@
 						   items->option_name,
 						   items->b_default);
 
-	    w->set_bg(get_color("DefaultWidgetBackground")|A_REVERSE);
-
 	    table->add_widget(w, row, 0, 1, 2, true, false);
 
 	    manager->add_widget(w);
@@ -278,8 +273,7 @@
 	    apt_string_widget *w=new apt_string_widget(items->option_name,
 						       items->s_default);
 
-	    l=new vs_label(_(items->description),
-			   get_color("DefaultWidgetBackground")|A_REVERSE);
+	    l=new vs_label(_(items->description));
 
 	    table->add_widget(l, row, 0, 1, 1, false, false);
 	    table->add_widget(w, row, 1, 1, 1, true, false);
@@ -306,8 +300,7 @@
 	    center->destroyed.connect(sigc::bind(sigc::ptr_fun(kill_radiogroup),
 						 w));
 
-	    l=new vs_label(_(items->description),
-			   get_color("DefaultWidgetBackground")|A_REVERSE);
+	    l=new vs_label(_(items->description));
 
 	    for(vector<string>::size_type i=0; i<items->choices.size(); ++i)
 	      {
@@ -317,8 +310,6 @@
 		vs_togglebutton *b=new vs_radiobutton(_(description.c_str()),
 						      choice == curr);
 
-		b->set_bg(get_color("DefaultWidgetBackground")|A_REVERSE);
-
 		table->add_widget(b, row+i, 1, 1, 1, false, false);
 
 		w->add_button(b, i);
@@ -350,7 +341,6 @@
     }
 
   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);
@@ -362,9 +352,9 @@
 			 vs_table::ALIGN_CENTER);
   
   vs_frame *frame=new vs_frame(table);
-  frame->set_bg(get_color("DefaultWidgetBackground")|A_REVERSE);
 
   center->add_widget(frame);
+  center->set_bg_style(style_attrs_flip(A_REVERSE));
 
   return center;
 }