From 6776d9b1f39ad45e99f613bf7a4843ec7d2ad0e3 Mon Sep 17 00:00:00 2001 From: Dimitris Panokostas Date: Sat, 16 May 2020 01:27:05 +0200 Subject: [PATCH] Fixed dropdowns would cut-off bottom part of contents --- external/libguisan/include/guisan/widget.hpp | 2 +- external/libguisan/src/widget.cpp | 4 ++-- external/libguisan/src/widgets/listbox.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/external/libguisan/include/guisan/widget.hpp b/external/libguisan/include/guisan/widget.hpp index 7706ea1d..7c7e3ee1 100644 --- a/external/libguisan/include/guisan/widget.hpp +++ b/external/libguisan/include/guisan/widget.hpp @@ -172,7 +172,7 @@ namespace gcn * * @return the widget height in pixels. */ - auto getHeight() const -> int; + [[nodiscard]] auto getHeight() const -> int; /** * Sets the size of the widget. diff --git a/external/libguisan/src/widget.cpp b/external/libguisan/src/widget.cpp index afda0ac6..a30d3fa7 100644 --- a/external/libguisan/src/widget.cpp +++ b/external/libguisan/src/widget.cpp @@ -591,7 +591,7 @@ namespace gcn if (getParent() != nullptr) { - return (mFocusHandler->getModalFocused() == this) || getParent()->hasModalFocus(); + return mFocusHandler->getModalFocused() == this || getParent()->hasModalFocus(); } return mFocusHandler->getModalFocused() == this; @@ -606,7 +606,7 @@ namespace gcn if (getParent() != nullptr) { - return (mFocusHandler->getModalMouseInputFocused() == this) || getParent()->hasModalMouseInputFocus(); + return mFocusHandler->getModalMouseInputFocused() == this || getParent()->hasModalMouseInputFocus(); } return mFocusHandler->getModalMouseInputFocused() == this; diff --git a/external/libguisan/src/widgets/listbox.cpp b/external/libguisan/src/widgets/listbox.cpp index 5a6001e4..f289388b 100644 --- a/external/libguisan/src/widgets/listbox.cpp +++ b/external/libguisan/src/widgets/listbox.cpp @@ -110,7 +110,7 @@ namespace gcn // Check the current clip area so we don't draw unnecessary items // that are not visible. const auto currentClipArea = graphics->getCurrentClipArea(); - const int rowHeight = getFont()->getHeight() + 2; + const int rowHeight = getFont()->getHeight(); // Calculate the number of rows to draw by checking the clip area. // The addition of two makes covers a partial visible row at the top