summaryrefslogtreecommitdiff
path: root/src/gui/widgets/label.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-19 14:49:19 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-20 00:02:36 +0300
commite224a077737739a895fe533c9cce93783621d8e9 (patch)
tree28194260919ffcc8aa77f52caf45cbf3a1747334 /src/gui/widgets/label.h
parentfd85f62f2e3003a79e90611e95b09e23710be479 (diff)
downloadManaVerse-e224a077737739a895fe533c9cce93783621d8e9.tar.gz
ManaVerse-e224a077737739a895fe533c9cce93783621d8e9.tar.bz2
ManaVerse-e224a077737739a895fe533c9cce93783621d8e9.tar.xz
ManaVerse-e224a077737739a895fe533c9cce93783621d8e9.zip
Add fast way for draw not changed text strings.
TextChunk with colors and image stored inside draw object. If string or color changed old string image moved to cache. New string image generated or moved from cache. Use new way in drawing string in label.
Diffstat (limited to 'src/gui/widgets/label.h')
-rw-r--r--src/gui/widgets/label.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gui/widgets/label.h b/src/gui/widgets/label.h
index 681908b71..9e82f0a5d 100644
--- a/src/gui/widgets/label.h
+++ b/src/gui/widgets/label.h
@@ -65,6 +65,8 @@
#ifndef GUI_WIDGETS_LABEL_H
#define GUI_WIDGETS_LABEL_H
+#include "gui/fonts/textchunk.h"
+
#include "gui/widgets/widget.h"
#include "listeners/tooltiplistener.h"
@@ -132,8 +134,7 @@ class Label final : public Widget,
* @param caption The caption of the label.
* @see getCaption, adjustSize
*/
- void setCaption(const std::string& caption)
- { mCaption = caption; }
+ void setCaption(const std::string& caption);
/**
* Sets the alignment of the caption. The alignment is relative
@@ -165,12 +166,16 @@ class Label final : public Widget,
*/
std::string mCaption;
+ TextChunk mTextChunk;
+
/**
* Holds the alignment of the caption.
*/
Graphics::Alignment mAlignment;
int mPadding;
+
+ bool mTextChanged;
};
#endif // GUI_WIDGETS_LABEL_H