Skip to content

Commit

Permalink
Use a smaller font size for theme UI buttons
Browse files Browse the repository at this point in the history
The impact of increasing button sizes on the top bar and replay UI
is a bit worse than expected and I can't be bothered to deal with the
consequences at this time.
  • Loading branch information
irydacea committed Mar 19, 2021
1 parent 8094f8c commit d3de899
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion changelog.md
Expand Up @@ -55,7 +55,7 @@
* Fixed the turn timer/system clock display on the top bar incorrectly using a larger font size at small resolutions.
* Made the Defense display label on the sidebar visible (a side-effect of replacing SDL_ttf) and rearranged it slightly.
* Set the correct default text color for in-game UI elements instead of #ffffff white for consistency with other UI elements.
* Increased font sizes in Help and some legacy UI elements including in-game menu and End Turn buttons.
* Increased font sizes in Help and some legacy UI elements.
### WML Engine
* Standard Location Filters now support gives_income=yes|no to make it simpler to match villages regardless of owner
* Fixed ThemeWML `[label] font_rgb=` generating text elements with broken UTF-8 sequences.
Expand Down
4 changes: 2 additions & 2 deletions src/display.cpp
Expand Up @@ -883,7 +883,7 @@ void display::create_buttons()
if (!menu.is_button()) continue;

std::shared_ptr<gui::button> b(new gui::button(screen_, menu.title(), gui::button::TYPE_PRESS, menu.image(),
gui::button::DEFAULT_SPACE, false, menu.overlay()));
gui::button::DEFAULT_SPACE, false, menu.overlay(), font::SIZE_BUTTON_SMALL));
DBG_DP << "drawing button " << menu.get_id() << "\n";
b->join_same(this);
b->set_id(menu.get_id());
Expand All @@ -902,7 +902,7 @@ void display::create_buttons()
DBG_DP << "creating action buttons...\n";
for(const auto& action : theme_.actions()) {
std::shared_ptr<gui::button> b(new gui::button(screen_, action.title(), string_to_button_type(action.type()), action.image(),
gui::button::DEFAULT_SPACE, false, action.overlay()));
gui::button::DEFAULT_SPACE, false, action.overlay(), font::SIZE_BUTTON_SMALL));

DBG_DP << "drawing button " << action.get_id() << "\n";
b->set_id(action.get_id());
Expand Down
1 change: 1 addition & 0 deletions src/font/constants.cpp
Expand Up @@ -22,6 +22,7 @@ const int
SIZE_TINY = 13 * (SIZE_NORMAL / 17),
SIZE_SMALL = 15 * (SIZE_NORMAL / 17),
SIZE_BUTTON = 16 * (SIZE_NORMAL / 17),
SIZE_BUTTON_SMALL = 14 * (SIZE_NORMAL / 17),

SIZE_15 = 15 * (SIZE_NORMAL / 17),
SIZE_PLUS = 18 * (SIZE_NORMAL / 17),
Expand Down
2 changes: 1 addition & 1 deletion src/font/constants.hpp
Expand Up @@ -21,7 +21,7 @@ namespace font {
// font sizes, to be made theme parameters
extern const int SIZE_NORMAL;
// automatic computation of other font sizes, to be made a default for theme-provided values
extern const int SIZE_TINY, SIZE_SMALL, SIZE_BUTTON,
extern const int SIZE_TINY, SIZE_SMALL, SIZE_BUTTON, SIZE_BUTTON_SMALL,
SIZE_15, SIZE_PLUS, SIZE_LARGE, SIZE_TITLE, SIZE_FLOAT_LABEL, SIZE_XLARGE;

// For arbitrary scaling:
Expand Down

0 comments on commit d3de899

Please sign in to comment.