Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@telenet.be>2021-11-21 17:29:50 +0100
committerStijn Buys <ingar@telenet.be>2021-11-21 17:29:50 +0100
commit16472132ada3393ede71e1c6d648c80841608ebb (patch)
tree735848635af13cb908c5989c688d8f17cc6c6624 /src/client
parente2a11df5e1e660c1df5bca78d78e2fbcf2880c13 (diff)
Small cleanup of the load/save menu layout.
Diffstat (limited to 'src/client')
-rw-r--r--src/client/savegamemenu.cc28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/client/savegamemenu.cc b/src/client/savegamemenu.cc
index d7b8293..aa43087 100644
--- a/src/client/savegamemenu.cc
+++ b/src/client/savegamemenu.cc
@@ -81,14 +81,14 @@ SaveGameMenu::SaveGameMenu(ui::Widget *parent, const char *label, const Mode mod
savegamemenu_descrlabel->set_background(true);
savegamemenu_descrlabel->set_border(true);
+ // delete button is a child of description label
+ savegamemenu_deletebutton = new ui::IconButton(savegamemenu_descrlabel, "bitmaps/icons/button_delete", "Delete");
+ savegamemenu_deletebutton->set_label("delete");
+
// save button
savegamemenu_savebutton = new ui::Button(this, "Save");
savegamemenu_savebutton->set_label("save");
- // delete button
- savegamemenu_deletebutton = new ui::IconButton(this, "bitmaps/icons/button_delete", "Delete");
- savegamemenu_deletebutton->set_label("delete");
-
// cancel save/load/overwrite button
savegamemenu_cancelbutton = new ui::Button(this, "Cancel");
savegamemenu_cancelbutton->set_label("cancel");
@@ -114,7 +114,7 @@ SaveGameMenu::~SaveGameMenu()
void SaveGameMenu::resize()
{
const float padding = ui::UI::padding;
- const float icon_size = 24.0f; // small icons
+ const float icon_size = ui::UI::icon_small;
// resize title label
savegamemenu_titlelabel->set_size(width() - padding * 2.0f, savegamemenu_titlelabel->font()->height());
@@ -127,20 +127,13 @@ void SaveGameMenu::resize()
// resize files listview
savegamemenu_filelistview->set_size(
ui::UI::elementsize.width(),
- height() - icon_size - padding * 3.0f - savegamemenu_titlelabel->bottom()
+ height() - 2.0f * padding - savegamemenu_titlelabel->bottom()
);
savegamemenu_filelistview->set_location(
padding,
savegamemenu_titlelabel->bottom() + padding
);
- // resize delete button
- savegamemenu_deletebutton->set_size(icon_size, icon_size);
- savegamemenu_deletebutton->set_location(
- savegamemenu_filelistview->left(),
- savegamemenu_filelistview->bottom() + padding
- );
-
// resize description title
savegamemenu_descrtitle->set_size(
width() - savegamemenu_filelistview->right() - 2.0f * padding,
@@ -154,13 +147,20 @@ void SaveGameMenu::resize()
// resize description label
savegamemenu_descrlabel->set_size(
savegamemenu_descrtitle->width(),
- savegamemenu_filelistview->bottom() - savegamemenu_descrtitle->bottom() - padding
+ savegamemenu_filelistview->bottom() - savegamemenu_descrtitle->bottom() - 2.0f * padding - ui::UI::elementsize.height()
);
savegamemenu_descrlabel->set_location(
savegamemenu_filelistview->right() + padding,
savegamemenu_descrtitle->bottom() + padding
);
+ // resize delete button
+ savegamemenu_deletebutton->set_size(icon_size, icon_size);
+ savegamemenu_deletebutton->set_location(
+ savegamemenu_descrtitle->width() - savegamemenu_deletebutton->width() - padding,
+ padding
+ );
+
// resize screenshot
const model::Material *screenshotmaterial = model::Material::find("ui/screenshot");
if (screenshotmaterial) {