diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-03-27 15:54:25 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-03-28 09:34:21 +0100 |
commit | 474442f1a49d29d85de769c4fbb3aa8636877b49 (patch) | |
tree | 2d8218d3648f370d31009831c86fc4c6b9f30033 /src/gui/widgets | |
parent | dac3832265fa17de8d3b9d3ea8d930b83efe9c17 (diff) | |
download | mana-474442f1a49d29d85de769c4fbb3aa8636877b49.tar.gz mana-474442f1a49d29d85de769c4fbb3aa8636877b49.tar.bz2 mana-474442f1a49d29d85de769c4fbb3aa8636877b49.tar.xz mana-474442f1a49d29d85de769c4fbb3aa8636877b49.zip |
Fixed size and child positions for various popups
Most prominently, fixes the tooltips on the window buttons being clipped
due to their position being slightly outside of the clipping children
area. And fixes NPC tooltips from having a lot of empty space below the
NPC name.
Also reduced the space between texts in the item tooltip to match the
padding rather than being an entire empty line.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/popup.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gui/widgets/popup.cpp b/src/gui/widgets/popup.cpp index b79f1370..94d8cf85 100644 --- a/src/gui/widgets/popup.cpp +++ b/src/gui/widgets/popup.cpp @@ -43,7 +43,7 @@ Popup::Popup(const std::string &name, const std::string &skin): if (!windowContainer) throw GCN_EXCEPTION("Popup::Popup(): no windowContainer set"); - setPadding(3); + setPadding(6); // Loads the skin mSkin = Theme::instance()->load(skin); @@ -78,7 +78,8 @@ void Popup::draw(gcn::Graphics *graphics) gcn::Rectangle Popup::getChildrenArea() { - return gcn::Rectangle(getPadding(), 0, getWidth() - getPadding() * 2, + return gcn::Rectangle(getPadding(), getPadding(), + getWidth() - getPadding() * 2, getHeight() - getPadding() * 2); } @@ -115,12 +116,12 @@ void Popup::setLocationRelativeTo(gcn::Widget *widget) void Popup::setMinWidth(int width) { - mMinWidth = width > mSkin->getMinWidth() ? width : mSkin->getMinWidth(); + mMinWidth = std::max(width, mSkin->getMinWidth()); } void Popup::setMinHeight(int height) { - mMinHeight = height > mSkin->getMinHeight() ? height : mSkin->getMinHeight(); + mMinHeight = std::max(height, mSkin->getMinHeight()); } void Popup::setMaxWidth(int width) |