summaryrefslogtreecommitdiff
path: root/src/gui/widgets/textpreview.h
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-23 21:59:21 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-23 22:00:09 +0100
commit99e8a3fd77b63a029fe02dcf771b6af1aad252ed (patch)
tree03c296d1f89859aae35336dfe2f58df09d256fd3 /src/gui/widgets/textpreview.h
parentfa8a4bf49100c0a1d5b96e00803f43bbbb861100 (diff)
parent347452b9b69ef3af29c577b7751082822e900c01 (diff)
downloadmana-99e8a3fd77b63a029fe02dcf771b6af1aad252ed.tar.gz
mana-99e8a3fd77b63a029fe02dcf771b6af1aad252ed.tar.bz2
mana-99e8a3fd77b63a029fe02dcf771b6af1aad252ed.tar.xz
mana-99e8a3fd77b63a029fe02dcf771b6af1aad252ed.zip
Merge branch 'aethyra/master'
Conflicts: Many files.
Diffstat (limited to 'src/gui/widgets/textpreview.h')
-rw-r--r--src/gui/widgets/textpreview.h30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/gui/widgets/textpreview.h b/src/gui/widgets/textpreview.h
index 1c1fa1e4..e7b7db80 100644
--- a/src/gui/widgets/textpreview.h
+++ b/src/gui/widgets/textpreview.h
@@ -29,7 +29,8 @@
/**
* Preview widget for particle colors, etc.
*/
-class TextPreview : public gcn::Widget {
+class TextPreview : public gcn::Widget
+{
public:
TextPreview(const std::string* text);
@@ -44,6 +45,16 @@ class TextPreview : public gcn::Widget {
}
/**
+ * Sets the text to use the set alpha value.
+ *
+ * @param alpha whether to use alpha values for the text or not
+ */
+ inline void useTextAlpha(bool alpha)
+ {
+ mTextAlpha = alpha;
+ }
+
+ /**
* Sets the color the text background is drawn in. This is only the
* rectangle directly behind the text, not to full widget.
*
@@ -101,12 +112,29 @@ class TextPreview : public gcn::Widget {
*/
void draw(gcn::Graphics *graphics);
+ /**
+ * Set opacity for this widget (whether or not to show the background
+ * color)
+ *
+ * @param opaque Whether the widget should be opaque or not
+ */
+ void setOpaque(bool opaque) { mOpaque = opaque; }
+
+ /**
+ * Gets opacity for this widget (whether or not the background color
+ * is shown below the widget)
+ */
+ bool isOpaque() { return mOpaque; }
+
private:
gcn::Font *mFont;
const std::string* mText;
const gcn::Color* mTextColor;
const gcn::Color* mBGColor;
const gcn::Color* mTextBGColor;
+ static float mAlpha;
+ bool mTextAlpha;
+ bool mOpaque;
bool mShadow;
bool mOutline;
};