|
2 | 2 | // |
3 | 3 | // SPDX-License-Identifier: GPL-2.0-or-later |
4 | 4 |
|
| 5 | +#include "DrawPoint.h" |
| 6 | +#include "Point.h" |
5 | 7 | #include "PointOutput.h" |
| 8 | +#include "Settings.h" |
6 | 9 | #include "WindowManager.h" |
7 | 10 | #include "controls/ctrlButton.h" |
8 | 11 | #include "controls/ctrlComboBox.h" |
|
12 | 15 | #include "controls/ctrlProgress.h" |
13 | 16 | #include "desktops/dskGameLobby.h" |
14 | 17 | #include "helpers/format.hpp" |
| 18 | +#include "ingameWindows/IngameWindow.h" |
15 | 19 | #include "ingameWindows/iwConnecting.h" |
16 | 20 | #include "ingameWindows/iwDirectIPConnect.h" |
17 | 21 | #include "ingameWindows/iwHelp.h" |
18 | 22 | #include "ingameWindows/iwMapGenerator.h" |
19 | 23 | #include "ingameWindows/iwMsgbox.h" |
20 | 24 | #include "uiHelper/uiHelpers.hpp" |
21 | 25 | #include "gameTypes/GameTypesOutput.h" |
| 26 | +#include "gameData/const_gui_ids.h" |
22 | 27 | #include "rttr/test/random.hpp" |
23 | 28 | #include "s25util/StringConversion.h" |
24 | 29 | #include <turtle/mock.hpp> |
@@ -194,4 +199,33 @@ BOOST_AUTO_TEST_CASE(ConnectingWindow) |
194 | 199 | } |
195 | 200 | } |
196 | 201 |
|
| 202 | +BOOST_AUTO_TEST_CASE(SaveAndRestoreMinimized) |
| 203 | +{ |
| 204 | + constexpr auto id = CGI_MINIMAP; |
| 205 | + auto it = SETTINGS.windows.persistentSettings.find(id); |
| 206 | + BOOST_REQUIRE(it !=SETTINGS.windows.persistentSettings.end()); |
| 207 | + |
| 208 | + { |
| 209 | + it->second.isMinimized = false; |
| 210 | + |
| 211 | + IngameWindow wnd(id, IngameWindow::posLastOrCenter, Extent(100, 100), "Test Window", nullptr); |
| 212 | + BOOST_TEST(!wnd.IsMinimized()); |
| 213 | + BOOST_TEST(wnd.GetSize() == Extent(100, 100)); |
| 214 | + |
| 215 | + wnd.SetMinimized(true); |
| 216 | + BOOST_TEST(it->second.isMinimized); |
| 217 | + } |
| 218 | + |
| 219 | + { |
| 220 | + it->second.isMinimized = true; |
| 221 | + |
| 222 | + IngameWindow wnd(id, IngameWindow::posLastOrCenter, Extent(100, 100), "Test Window", nullptr); |
| 223 | + BOOST_TEST(wnd.IsMinimized()); |
| 224 | + BOOST_TEST(wnd.GetSize() != Extent(100, 100)); |
| 225 | + |
| 226 | + wnd.SetMinimized(false); |
| 227 | + BOOST_TEST(!it->second.isMinimized); |
| 228 | + } |
| 229 | +} |
| 230 | + |
197 | 231 | BOOST_AUTO_TEST_SUITE_END() |
0 commit comments