summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-06-19 21:03:42 +0300
committerAndrei Karas <akaras@inbox.ru>2017-06-19 21:03:42 +0300
commit64192ec89b46f7c34aaaae493e48352c3cbbf03f (patch)
tree625a2bf34f1d294a76fb4be5419bdab81e8e69ed /src
parent038270a1d6519237a13a8699582660ed0db04b6d (diff)
downloadplus-64192ec89b46f7c34aaaae493e48352c3cbbf03f.tar.gz
plus-64192ec89b46f7c34aaaae493e48352c3cbbf03f.tar.bz2
plus-64192ec89b46f7c34aaaae493e48352c3cbbf03f.tar.xz
plus-64192ec89b46f7c34aaaae493e48352c3cbbf03f.zip
Use staticbrowserbox in speechbubble.
Diffstat (limited to 'src')
-rw-r--r--src/gui/popups/speechbubble.cpp5
-rw-r--r--src/gui/popups/speechbubble.h4
2 files changed, 5 insertions, 4 deletions
diff --git a/src/gui/popups/speechbubble.cpp b/src/gui/popups/speechbubble.cpp
index 50d54e692..382d3c93c 100644
--- a/src/gui/popups/speechbubble.cpp
+++ b/src/gui/popups/speechbubble.cpp
@@ -29,8 +29,8 @@
#include "gui/fonts/font.h"
-#include "gui/widgets/browserbox.h"
#include "gui/widgets/label.h"
+#include "gui/widgets/staticbrowserbox.h"
#include "debug.h"
@@ -39,7 +39,7 @@ SpeechBubble::SpeechBubble() :
mText(),
mSpacing(mSkin != nullptr ? mSkin->getOption("spacing") : 2),
mCaption(new Label(this)),
- mSpeechBox(new BrowserBox(this, BrowserBoxMode::AUTO_SIZE, Opaque_true,
+ mSpeechBox(new StaticBrowserBox(this, Opaque_true,
"speechbrowserbox.xml"))
{
setContentSize(140, 46);
@@ -80,6 +80,7 @@ void SpeechBubble::setText(const std::string &text, const bool showName)
mSpeechBox->clearRows();
mSpeechBox->addRow(text);
mSpeechBox->setWidth(mSpeechBox->getDataWidth());
+ mSpeechBox->updateHeight();
const int speechWidth = mSpeechBox->getWidth();
const int nameHeight = showName ? mCaption->getHeight() + mSpacing : 0;
diff --git a/src/gui/popups/speechbubble.h b/src/gui/popups/speechbubble.h
index 63e41612e..694a6eb2a 100644
--- a/src/gui/popups/speechbubble.h
+++ b/src/gui/popups/speechbubble.h
@@ -27,7 +27,7 @@
#include "gui/widgets/popup.h"
class Label;
-class BrowserBox;
+class StaticBrowserBox;
class SpeechBubble final : public Popup
{
@@ -61,7 +61,7 @@ class SpeechBubble final : public Popup
std::string mText;
int mSpacing;
Label *mCaption A_NONNULLPOINTER;
- BrowserBox *mSpeechBox A_NONNULLPOINTER;
+ StaticBrowserBox *mSpeechBox A_NONNULLPOINTER;
};
#endif // GUI_POPUPS_SPEECHBUBBLE_H