summaryrefslogtreecommitdiff
path: root/plugingui/abouttab.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2017-05-19 19:09:17 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2017-05-19 19:09:17 +0200
commitff83cfac10939ceba524c93d4e36f634f4bec805 (patch)
treed481913f2136bf04d2d1deb650e6bd084a531676 /plugingui/abouttab.cc
parenta3dc9bd19f976cbc84ba3d1a16c72257b42b28ba (diff)
Make sure we don't resize to negative values.
Diffstat (limited to 'plugingui/abouttab.cc')
-rw-r--r--plugingui/abouttab.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugingui/abouttab.cc b/plugingui/abouttab.cc
index 2e4eace..f731100 100644
--- a/plugingui/abouttab.cc
+++ b/plugingui/abouttab.cc
@@ -38,14 +38,16 @@ AboutTab::AboutTab(Widget* parent)
{
text_edit.setText(getAboutText());
text_edit.setReadOnly(true);
- text_edit.resize(width() - 2*margin, height() - 2*margin);
+ text_edit.resize(std::max((int)width() - 2*margin,0),
+ std::max((int)height() - 2*margin, 0));
text_edit.move(margin, margin);
}
void AboutTab::resize(std::size_t width, std::size_t height)
{
Widget::resize(width, height);
- text_edit.resize(width - 2*margin, height - 2*margin);
+ text_edit.resize(std::max((int)width - 2*margin, 0),
+ std::max((int)height - 2*margin, 0));
}
std::string AboutTab::getAboutText()