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

Daniel Burrows dburrows@costa.debian.org
Tue, 07 Jun 2005 17:19:37 +0000


Author: dburrows
Date: Tue Jun  7 17:19:34 2005
New Revision: 3368

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/load_pkgview.cc
   branches/aptitude-0.3/aptitude/src/pkg_view.h
Log:
Fix package view loading for styles.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Tue Jun  7 17:19:34 2005
@@ -1,5 +1,11 @@
 2005-06-07  Daniel Burrows  <dburrows@debian.org>
 
+	* src/load_pkgview.cc, src/pkg_view.h:
+
+	Adjust the package view loading code to use styles rather than
+	colors, and change the package view structure to store a style
+	rather than a color.
+
 	* src/load_config.cc:
 
 	Change load_colors to load_styles.

Modified: branches/aptitude-0.3/aptitude/src/load_pkgview.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/load_pkgview.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/load_pkgview.cc	Tue Jun  7 17:19:34 2005
@@ -187,10 +187,10 @@
 	    }
 	}
 
-      if(subtree.Exists("Color"))
-	tmp.bg=get_color(subtree.Find("Color"));
-      else
-	tmp.bg=get_color("DefaultWidgetBackground");
+      if(subtree.Exists("Style"))
+	{
+	  tmp.st=get_style(subtree.Find("Style"));
+	}
 
       tmp.visible=subtree.FindB("Visible", true);
 

Modified: branches/aptitude-0.3/aptitude/src/pkg_view.h
==============================================================================
--- branches/aptitude-0.3/aptitude/src/pkg_view.h	(original)
+++ branches/aptitude-0.3/aptitude/src/pkg_view.h	Tue Jun  7 17:19:34 2005
@@ -13,6 +13,7 @@
 #define PKG_VIEW_H
 
 #include "vscreen/config/column_definition.h"
+#include "vscreen/config/style.h"
 #include "pkg_grouppolicy.h"
 
 #include <list>
@@ -60,8 +61,8 @@
   int xopts, yopts;
   // obvious table stuff
 
-  int bg;
-  // The item's packground attributes.
+  /** The style with which this item should be displayed. */
+  style st;
 
   std::string popupdownkey;
   // The key used to toggle the visibility of this item.  ("" for none)
@@ -78,33 +79,33 @@
   package_view_item(std::string _name,
 		    column_definition_list *_columns, std::string _columns_cfg,
 		    int _row, int _col, int _w, int _h, int _xopts, int _yopts,
-		    int _bg, std::string _popupdownkey,
+		    const style &_st, std::string _popupdownkey,
 		    std::string _popupdownlinked, bool _visible)
     :name(_name), type(PACKAGE_VIEW_STATIC), columns(_columns),
      columns_cfg(_columns_cfg), row(_row), col(_col), w(_w), h(_h),
-     xopts(_xopts), yopts(_yopts), bg(_bg), popupdownkey(_popupdownkey),
+     xopts(_xopts), yopts(_yopts), st(_st), popupdownkey(_popupdownkey),
      popupdownlinked(_popupdownlinked), widget(NULL), visible(_visible) {}
 
   package_view_item(std::string _name,
 		    int _row, int _col, int _w, int _h, int _xopts, int _yopts,
-		    int _bg, std::string _popupdownkey, 
+		    const style &_st, std::string _popupdownkey, 
 		    std::string _popupdownlinked, bool _visible)
     :name(_name), type(PACKAGE_VIEW_DESCRIPTION), columns(NULL),
      row(_row), col(_col), w(_w), h(_h), xopts(_xopts), yopts(_yopts),
-     bg(_bg), popupdownkey(_popupdownkey), popupdownlinked(_popupdownlinked),
+     st(_st), popupdownkey(_popupdownkey), popupdownlinked(_popupdownlinked),
      widget(NULL), visible(_visible) {}
 
   package_view_item(std::string _name,
 		    int _row, int _col, int _w, int _h,
-		    int _xopts, int _yopts, int _bg, bool _visible)
+		    int _xopts, int _yopts, const style &_st, bool _visible)
     :name(_name), type(PACKAGE_VIEW_MAINWIDGET), columns(NULL),
      row(_row), col(_col), w(_w), h(_h), xopts(_xopts), yopts(_yopts),
-     bg(_bg), widget(NULL), visible(_visible) {}
+     st(_st), widget(NULL), visible(_visible) {}
 
   package_view_item()
     :type((package_view_itemtype) -1), columns(NULL),
      row(-1), col(-1), w(-1), h(-1),
-     xopts(0), yopts(0), bg(0), widget(NULL), visible(true)
+     xopts(0), yopts(0), widget(NULL), visible(true)
   {
   }
 };