Compact the toolbar so it fits and wraps

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

author
Marijn Besseling <njirambem@gmail.com> · 2026-10-24 22:20 UTC
commit
8de1aa4f2ba8c632d1dba77eea0784b85efa2bf5
parent
d95ecc9559
tree
browse at this commit

2 files changed +11 -7

src/actions.rs +3 -3

@@ -54,10 +54,10 @@ impl Action {
54 54 Action::ToggleStockpileTool => "Stockpile",
55 55 Action::ToggleFarmTool => "Farm",
56 56 Action::CycleBuildTool => "Build",
57 - Action::ToggleDesignateTool => "Chop/Mine",
57 + Action::ToggleDesignateTool => "Mark",
58 58 Action::Cancel => "Cancel",
59 - Action::NewWorld => "New world",
60 - Action::ToggleUi => "Hide UI",
59 + Action::NewWorld => "New map",
60 + Action::ToggleUi => "Hide",
61 61 Action::ZoomIn => "+",
62 62 Action::ZoomOut => "-",
63 63 }

src/ui.rs +8 -4

@@ -89,14 +89,14 @@ fn action_button(action: Action, label: &str) -> impl Bundle {
89 89 Node {
90 90 flex_direction: FlexDirection::Column,
91 91 align_items: AlignItems::Center,
92 - min_width: px(52),
93 - padding: UiRect::axes(px(8), px(4)),
92 + min_width: px(36),
93 + padding: UiRect::axes(px(5), px(3)),
94 94 border_radius: BorderRadius::all(px(4)),
95 95 ..default()
96 96 },
97 97 BackgroundColor(BUTTON_COLOR),
98 98 children![
99 - (Text::new(label), TextFont::from_font_size(14.0)),
99 + (Text::new(label), TextFont::from_font_size(12.0)),
100 100 (
101 101 Text::new(action.key_label()),
102 102 TextFont::from_font_size(10.0),
@@ -123,7 +123,11 @@ fn spawn_toolbar(mut commands: Commands) {
123 123 let row = commands
124 124 .spawn((
125 125 Node {
126 - column_gap: px(4),
126 + column_gap: px(3),
127 + row_gap: px(3),
128 + flex_wrap: FlexWrap::Wrap,
129 + justify_content: JustifyContent::Center,
130 + max_width: percent(100),
127 131 padding: UiRect::all(px(4)),
128 132 border_radius: BorderRadius::all(px(6)),
129 133 ..default()