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

Daniel Burrows dburrows@costa.debian.org
Sat, 04 Jun 2005 17:20:14 +0000


Author: dburrows
Date: Sat Jun  4 17:20:11 2005
New Revision: 3300

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/vscreen/vs_button.cc
   branches/aptitude-0.3/aptitude/src/vscreen/vs_button.h
Log:
Fix vs_button for the new display protocol.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Sat Jun  4 17:20:11 2005
@@ -1,5 +1,9 @@
 2005-06-04  Daniel Burrows  <dburrows@debian.org>
 
+	* src/vscreen/vs_button.cc, src/vscreen/vs_button.h:
+
+	Fix the vs_button class for the new display protocol.
+
 	* src/vscreen/vscreen_widget.cc:
 
 	Properly pass style information into the paint() call.

Modified: branches/aptitude-0.3/aptitude/src/vscreen/vs_button.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/vscreen/vs_button.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/vscreen/vs_button.cc	Sat Jun  4 17:20:11 2005
@@ -54,17 +54,13 @@
   vscreen_update();
 }
 
-void vs_button::paint()
+void vs_button::paint(const style &st)
 {
   size_t labelw=getmaxx()>=4?getmaxx()-4:0;
-  fragment_contents lines=label->layout(labelw, labelw);
+  fragment_contents lines=label->layout(labelw, labelw, st);
 
-  // FIXME: should use cascading text styles for this:
   if(get_isfocussed())
-    {
-      bkgdset(get_bg()^A_REVERSE);
-      attrset(get_bg()^A_REVERSE);
-    }
+    apply_style(st+style_attrs_flip(A_REVERSE));
 
   // TODO: create a "bracebox" fragment that places left&right braces
   // automatically.
@@ -135,5 +131,5 @@
 {
   size_t label_width=(width>=4)?width-4:0;
 
-  return label->layout(label_width, label_width).size();
+  return label->layout(label_width, label_width, style()).size();
 }

Modified: branches/aptitude-0.3/aptitude/src/vscreen/vs_button.h
==============================================================================
--- branches/aptitude-0.3/aptitude/src/vscreen/vs_button.h	(original)
+++ branches/aptitude-0.3/aptitude/src/vscreen/vs_button.h	Sat Jun  4 17:20:11 2005
@@ -42,7 +42,7 @@
   vs_button(const std::string &_label);
   ~vs_button();
 
-  void paint();
+  void paint(const style &st);
 
   bool get_cursorvisible();
   point get_cursorloc();