From b83fce9a5c87d1fcba5bf623eae6ad6297a96a75 Mon Sep 17 00:00:00 2001 From: Jesper Juhl Date: Sun, 1 Mar 2026 19:27:26 +0100 Subject: [PATCH 1/4] Remove a few redundant 'namespace tgui' declarations in Color.hpp --- include/TGUI/Color.hpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/include/TGUI/Color.hpp b/include/TGUI/Color.hpp index b2baa8ff1..0358d1960 100644 --- a/include/TGUI/Color.hpp +++ b/include/TGUI/Color.hpp @@ -39,18 +39,12 @@ namespace tgui { class Color; -} -namespace tgui -{ namespace priv { TGUI_API Color constructColorFromString(const String& string); } -} -namespace tgui -{ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// @brief Wrapper for colors /// @@ -300,12 +294,9 @@ namespace tgui {U"transparent"sv, Color::Transparent}} }; #endif -} ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -namespace tgui -{ namespace priv { ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// From 7bbd7a82afa4c78b42636f8b1b5a91f438e22671 Mon Sep 17 00:00:00 2001 From: Jesper Juhl Date: Sun, 1 Mar 2026 19:48:10 +0100 Subject: [PATCH 2/4] Fix incorrect comment in Slider::setMaximum --- src/Widgets/Slider.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Widgets/Slider.cpp b/src/Widgets/Slider.cpp index 14fb8a402..5bb41cd41 100644 --- a/src/Widgets/Slider.cpp +++ b/src/Widgets/Slider.cpp @@ -243,7 +243,7 @@ namespace tgui // Set the new maximum m_maximum = maximum; - // The minimum can't be below the maximum + // The minimum can't be above the maximum if (m_minimum > m_maximum) setMinimum(m_maximum); From 1a3d55e915c0386db7d9712a65e8a615e022ff35 Mon Sep 17 00:00:00 2001 From: Jesper Juhl Date: Mon, 2 Mar 2026 19:26:11 +0100 Subject: [PATCH 3/4] Remove a few includes not needed by the file including them --- src/Global.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Global.cpp b/src/Global.cpp index ee055ba6e..a94dd36d0 100644 --- a/src/Global.cpp +++ b/src/Global.cpp @@ -26,9 +26,7 @@ #include #include "TGUI/Exception.hpp" -#include #include -#include #include #include // C header for compatibility with _wfopen_s, NOLINT(modernize-deprecated-headers) From 0fd488eddf8d7dbde92daf6ab57333c381f85179 Mon Sep 17 00:00:00 2001 From: Jesper Juhl Date: Mon, 2 Mar 2026 19:37:53 +0100 Subject: [PATCH 4/4] Add test for Text::getLineWidth without a font --- tests/Text.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/Text.cpp b/tests/Text.cpp index fb3d08277..4bed3e767 100644 --- a/tests/Text.cpp +++ b/tests/Text.cpp @@ -23,6 +23,7 @@ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #include "TGUI/Color.hpp" +#include "TGUI/TextStyle.hpp" #include "Tests.hpp" TEST_CASE("[Text]") @@ -165,5 +166,13 @@ TEST_CASE("[Text]") text3.setFont("resources/DejaVuSans.ttf"); REQUIRE(text.getSize().y == text3.getSize().y); } + + SECTION("Line width without font") + { + REQUIRE(text.getLineWidth("Foo", nullptr, 0, {}) == 0.0f); + REQUIRE(text.getLineWidth("Bar", nullptr, 1, tgui::TextStyle::Underlined) == 0.0f); + REQUIRE(text.getLineWidth("Baz", nullptr, 42, {}) == 0.0f);; + REQUIRE(text.getLineWidth("FooBar", nullptr, 666, tgui::TextStyle::StrikeThrough) == 0.0f); + } } }