mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-30 17:55:43 +00:00
Adjust the palette size for low resolutions.
This commit is contained in:
parent
1a3a7b3dce
commit
a8b7bb529b
@ -225,7 +225,7 @@ void editor_palette<Item>::adjust_size(const SDL_Rect& target)
|
||||
static_cast<unsigned> (space_for_items / item_space_) *
|
||||
item_width_;
|
||||
nitems_ = std::min<int>(items_fitting, nmax_items_);
|
||||
buttons_.resize(nitems_, gui::tristate_button(gui_.video(), "", this));
|
||||
buttons_.resize(nitems_, gui::tristate_button(gui_.video(), this));
|
||||
set_location(target);
|
||||
set_dirty(true);
|
||||
}
|
||||
|
@ -219,7 +219,7 @@ void terrain_palette::draw_item(const t_translation::t_terrain& terrain,
|
||||
terrain_palette::terrain_palette(editor_display &gui, const config& cfg,
|
||||
mouse_action** active_mouse_action)
|
||||
//TODO avoid magic numbers
|
||||
: editor_palette<t_translation::t_terrain>(gui, cfg, 38, 4, active_mouse_action)
|
||||
: editor_palette<t_translation::t_terrain>(gui, cfg, 36, 4, active_mouse_action)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -38,12 +38,11 @@ const int horizontal_padding = font::SIZE_SMALL;
|
||||
const int checkbox_horizontal_padding = font::SIZE_SMALL / 2;
|
||||
const int vertical_padding = font::SIZE_SMALL / 2;
|
||||
|
||||
tristate_button::tristate_button(CVideo& video, const std::string& label,
|
||||
tristate_button::tristate_button(CVideo& video,
|
||||
editor::common_palette* palette,
|
||||
std::string button_image_name, SPACE_CONSUMPTION spacing,
|
||||
const bool auto_join) :
|
||||
widget(video, auto_join),
|
||||
label_(label),
|
||||
baseImage_(NULL), touchedBaseImage_(NULL), activeBaseImage_(NULL),
|
||||
itemImage_(NULL),
|
||||
pressedDownImage_(NULL), pressedUpImage_(NULL), pressedBothImage_(NULL),
|
||||
|
@ -36,7 +36,7 @@ public:
|
||||
|
||||
enum SPACE_CONSUMPTION { DEFAULT_SPACE, MINIMUM_SPACE };
|
||||
|
||||
tristate_button(CVideo& video, const std::string& label,
|
||||
tristate_button(CVideo& video,
|
||||
editor::common_palette* palette,
|
||||
std::string button_image="",
|
||||
SPACE_CONSUMPTION spacing=DEFAULT_SPACE,
|
||||
|
@ -119,7 +119,7 @@ void unit_palette::draw_item(const unit_type& u, surface& image, std::stringstre
|
||||
unit_palette::unit_palette(editor_display &gui, const config& cfg,
|
||||
mouse_action** active_mouse_action)
|
||||
//TODO avoid magic numbers
|
||||
: editor_palette<unit_type>(gui, cfg, 72, 2, active_mouse_action)
|
||||
: editor_palette<unit_type>(gui, cfg, 36, 4, active_mouse_action)
|
||||
{
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user