[Aptitude-svn-commit] r3777 - in branches/aptitude-0.3/aptitude: .
src/vscreen
Daniel Burrows
dburrows at costa.debian.org
Tue Aug 9 01:41:25 UTC 2005
Author: dburrows
Date: Tue Aug 9 01:41:22 2005
New Revision: 3777
Modified:
branches/aptitude-0.3/aptitude/ChangeLog
branches/aptitude-0.3/aptitude/src/vscreen/vs_label.cc
branches/aptitude-0.3/aptitude/src/vscreen/vs_label.h
Log:
Set the background of the whole widget, not just the text, in
the vs_label constructor.
Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog (original)
+++ branches/aptitude-0.3/aptitude/ChangeLog Tue Aug 9 01:41:22 2005
@@ -1,5 +1,11 @@
2005-08-08 Daniel Burrows <dburrows at debian.org>
+ * src/vscreen/vs_label.cc, src/vscreen/vs_label.h:
+
+ Restore the old behavior of setting the background of the whole
+ widget from the constructor of vs_label, not just the color of
+ the actual text.
+
* src/ui.cc:
Use sw?sprintf rather than a local w?snprintf in several spots.
Modified: branches/aptitude-0.3/aptitude/src/vscreen/vs_label.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/vscreen/vs_label.cc (original)
+++ branches/aptitude-0.3/aptitude/src/vscreen/vs_label.cc Tue Aug 9 01:41:22 2005
@@ -17,8 +17,9 @@
}
vs_label::vs_label(const string &_txt, const style &st)
- :txt(new fragment_cache(style_fragment(text_fragment(_txt), st)))
+ :txt(new fragment_cache(text_fragment(_txt)))
{
+ set_bg_style(st);
}
vs_label::vs_label(const string &_txt)
@@ -27,8 +28,9 @@
}
vs_label::vs_label(const wstring &_txt, const style &st)
- :txt(new fragment_cache(style_fragment(text_fragment(_txt), st)))
+ :txt(new fragment_cache(text_fragment(_txt)))
{
+ set_bg_style(st);
}
vs_label::vs_label(const wstring &_txt)
Modified: branches/aptitude-0.3/aptitude/src/vscreen/vs_label.h
==============================================================================
--- branches/aptitude-0.3/aptitude/src/vscreen/vs_label.h (original)
+++ branches/aptitude-0.3/aptitude/src/vscreen/vs_label.h Tue Aug 9 01:41:22 2005
@@ -8,6 +8,15 @@
class fragment;
class fragment_cache;
+/** vs_label widgets display some (possibly formatted) text
+ * statically. The text cannot be scrolled or selected in any way;
+ * if there isn't room for it, it just gets clipped.
+ *
+ * Passing a "background" style into the constructor modifies the
+ * background style of the widget (as set_bg_style would); this
+ * differs from wrapping the text in a style_fragment in that it
+ * even affects parts of the widget which aren't covered by text.
+ */
class vs_label:public vscreen_widget
{
fragment_cache *txt;
@@ -24,11 +33,16 @@
return new vs_label(f);
}
+ /** Create a vs_label with the given text and background. */
static ref_ptr<vs_label> create(const std::string &txt, const style &st);
+
+ /** Create a vs_label with the given text. */
static ref_ptr<vs_label> create(const std::string &txt);
+ /** Create a vs_label with the given text and background. */
static ref_ptr<vs_label> create(const std::wstring &txt, const style &st);
+ /** CReate a vs_label with the given text. */
static ref_ptr<vs_label> create(const std::wstring &txt);
More information about the Aptitude-svn-commit
mailing list