Skip to content

Commit ad0749b

Browse files
authored
Merge pull request #1614 from falbrechtskirchinger/fix-buttons
Fix button placement in minimized in-game windows
2 parents 25dca9a + f320335 commit ad0749b

5 files changed

Lines changed: 21 additions & 14 deletions

File tree

libs/s25main/ingameWindows/IngameWindow.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ Extent IngameWindow::GetIwSize() const
112112
return Extent(GetSize().x - contentOffset.x - contentOffsetEnd.x, iwHeight);
113113
}
114114

115+
Extent IngameWindow::GetFullSize() const
116+
{
117+
return Extent(GetSize().x, contentOffset.y + contentOffsetEnd.y + iwHeight);
118+
}
119+
115120
DrawPoint IngameWindow::GetRightBottomBoundary()
116121
{
117122
return DrawPoint(GetSize() - contentOffsetEnd);

libs/s25main/ingameWindows/IngameWindow.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ class IngameWindow : public Window
6868
void SetIwSize(const Extent& newSize);
6969
/// Get the size of the (expanded) content area
7070
Extent GetIwSize() const;
71+
/// Get the full size of the window, even when minimized
72+
Extent GetFullSize() const;
7173
/// Get the current lower right corner of the content area
7274
DrawPoint GetRightBottomBoundary();
7375

libs/s25main/ingameWindows/iwBuildings.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ iwBuildings::iwBuildings(GameWorldView& gwv, GameCommandFactory& gcFactory)
6767
}
6868
}
6969

70-
// Hilfe-Button
70+
// "Help" button
7171
Extent btSize = Extent(30, 32);
72-
AddImageButton(32, GetSize() - DrawPoint(14, 20) - btSize, btSize, TextureColor::Grey, LOADER.GetImageN("io", 225),
73-
_("Help"));
72+
AddImageButton(32, GetFullSize() - DrawPoint(14, 20) - btSize, btSize, TextureColor::Grey,
73+
LOADER.GetImageN("io", 225), _("Help"));
7474
}
7575

7676
/// Anzahlen der Gebäude zeichnen

libs/s25main/ingameWindows/iwDistribution.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ iwDistribution::iwDistribution(const GameWorldViewer& gwv, GameCommandFactory& g
6262
tab->SetSelection(0);
6363

6464
const Extent btSize(32, 32);
65-
// Hilfe
66-
AddImageButton(2, DrawPoint(15, GetSize().y - 15 - btSize.y), btSize, TextureColor::Grey,
65+
// "Help" button
66+
AddImageButton(2, DrawPoint(15, GetFullSize().y - 15 - btSize.y), btSize, TextureColor::Grey,
6767
LOADER.GetImageN("io", 225), _("Help"));
68-
// Standardbelegung
69-
AddImageButton(10, GetSize() - DrawPoint::all(15) - btSize, btSize, TextureColor::Grey, LOADER.GetImageN("io", 191),
70-
_("Default"));
68+
// "Default" button
69+
AddImageButton(10, GetFullSize() - DrawPoint::all(15) - btSize, btSize, TextureColor::Grey,
70+
LOADER.GetImageN("io", 191), _("Default"));
7171

7272
iwDistribution::UpdateSettings();
7373
}

libs/s25main/ingameWindows/iwWares.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,12 @@ iwWares::iwWares(unsigned id, const DrawPoint& pos, const Extent& size, const st
130130
}
131131
}
132132

133-
// "Blättern"
134-
AddImageButton(0, DrawPoint(52, GetSize().y - 47), Extent(66, 32), TextureColor::Grey, LOADER.GetImageN("io", 84),
135-
_("Next page"));
136-
// Hilfe
137-
AddImageButton(12, DrawPoint(16, GetSize().y - 47), Extent(32, 32), TextureColor::Grey, LOADER.GetImageN("io", 225),
138-
_("Help"));
133+
// "Next page" button
134+
AddImageButton(0, DrawPoint(52, GetFullSize().y - 47), Extent(66, 32), TextureColor::Grey,
135+
LOADER.GetImageN("io", 84), _("Next page"));
136+
// "Help" button
137+
AddImageButton(12, DrawPoint(16, GetFullSize().y - 47), Extent(32, 32), TextureColor::Grey,
138+
LOADER.GetImageN("io", 225), _("Help"));
139139

140140
waresPage.SetVisible(true);
141141
curPage_ = warePageID;

0 commit comments

Comments
 (0)