Skip to content

Commit

Permalink
refactor: reduce height of savestates widgets
Browse files Browse the repository at this point in the history
This should help make them fit even with taller fonts
  • Loading branch information
midwan committed Jan 12, 2025
1 parent 54ecc1b commit 6494832
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/osdep/gui/PanelSavestate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ void InitPanelSavestate(const config_category& category)
int pos_y = 10;
for (const auto& radioButton : optStateSlot) {
grpNumber->add(radioButton, 10, pos_y);
pos_y += radioButton->getHeight() + DISTANCE_NEXT_Y;
pos_y += radioButton->getHeight() + 12;
}
grpNumber->setMovable(false);
grpNumber->setSize(BUTTON_WIDTH - 20, TITLEBAR_HEIGHT + pos_y);
Expand All @@ -232,7 +232,9 @@ void InitPanelSavestate(const config_category& category)

grpScreenshot = new gcn::Window("State screenshot");
grpScreenshot->setMovable(false);
grpScreenshot->setSize(category.panel->getWidth() - grpNumber->getWidth() - DISTANCE_BORDER * 2 - DISTANCE_NEXT_X, grpNumber->getHeight());
const auto screenshot_width = category.panel->getWidth() - grpNumber->getWidth() - DISTANCE_BORDER * 2 - DISTANCE_NEXT_X;
const auto screenshot_height = grpNumber->getHeight();
grpScreenshot->setSize(screenshot_width, screenshot_height);
grpScreenshot->setTitleBarHeight(TITLEBAR_HEIGHT);
grpScreenshot->setBaseColor(gui_base_color);
grpScreenshot->setForegroundColor(gui_foreground_color);
Expand Down Expand Up @@ -282,7 +284,7 @@ void InitPanelSavestate(const config_category& category)
category.panel->add(cmdSaveStateSlot, cmdLoadStateSlot->getX() + cmdLoadStateSlot->getWidth() + DISTANCE_NEXT_X, pos_y);
category.panel->add(cmdDeleteStateSlot, cmdSaveStateSlot->getX() + cmdSaveStateSlot->getWidth() + DISTANCE_NEXT_X, pos_y);

pos_y = cmdLoadStateSlot->getY() + cmdLoadStateSlot->getHeight() + DISTANCE_NEXT_Y;
pos_y = cmdLoadStateSlot->getY() + cmdLoadStateSlot->getHeight() + DISTANCE_NEXT_Y/2;
category.panel->add(cmdLoadState, grpScreenshot->getX(), pos_y);
category.panel->add(cmdSaveState, cmdLoadState->getX() + cmdLoadState->getWidth() + DISTANCE_NEXT_X, pos_y);

Expand Down

0 comments on commit 6494832

Please sign in to comment.