summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Ouellette <oue.paul18@gmail.com>2020-05-09 11:14:29 -0400
committerGitHub <noreply@github.com>2020-05-09 17:14:29 +0200
commitb6242498aad793e579960f871f01ba5bd5456658 (patch)
treee1cc261d6c1ac77e750e401f81bc3f77a6bf04a1
parent454dbf83a9bf292910c1495a2aa49fd8b960c28f (diff)
downloadminetest-b6242498aad793e579960f871f01ba5bd5456658.tar.gz
minetest-b6242498aad793e579960f871f01ba5bd5456658.tar.bz2
minetest-b6242498aad793e579960f871f01ba5bd5456658.zip
Always use same default tabheader height (#9319)
Previously the default tabheader height was different when using real coordinates. This resulted in the height of tabs changing when switching tabs in sfinv if some tabs used real coordinates.
-rw-r--r--src/gui/guiFormSpecMenu.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/guiFormSpecMenu.cpp b/src/gui/guiFormSpecMenu.cpp
index 72095a86e..49133f1cb 100644
--- a/src/gui/guiFormSpecMenu.cpp
+++ b/src/gui/guiFormSpecMenu.cpp
@@ -2027,7 +2027,7 @@ void GUIFormSpecMenu::parseTabHeader(parserData* data, const std::string &elemen
// Width is not here because tabs are the width of the text, and
// there's no reason to change that.
unsigned int i = 0;
- std::vector<std::string> v_geom = {"1", "0.75"}; // Dummy width and default height
+ std::vector<std::string> v_geom = {"1", "1"}; // Dummy width and height
bool auto_width = true;
if (parts.size() == 7) {
i++;
@@ -2071,6 +2071,9 @@ void GUIFormSpecMenu::parseTabHeader(parserData* data, const std::string &elemen
pos = getRealCoordinateBasePos(v_pos);
geom = getRealCoordinateGeometry(v_geom);
+ // Set default height
+ if (parts.size() <= 6)
+ geom.Y = m_btn_height * 2;
pos.Y -= geom.Y; // TabHeader base pos is the bottom, not the top.
if (auto_width)
geom.X = DesiredRect.getWidth(); // Set automatic width