diff --git a/src/app.rs b/src/app.rs index ef2c8e2..8adb742 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1827,14 +1827,17 @@ impl App { /// Called on init and on every config update. Each entity carries the /// associated `ToolbarAction` as data so click/reorder handlers can /// round-trip Entity → ToolbarAction without maintaining a side map. + /// + /// We insert ONLY the icon (no `.text()`) so the toolbar renders as a + /// clean icon row — user-visible labels stay in Settings/tooltips on + /// other surfaces. fn rebuild_toolbar_model(&mut self) { self.toolbar_model.clear(); for action in self.config.toolbar.iter().copied() { - let (icon_name, label, _msg) = toolbar_action_ui(action); + let (icon_name, _label, _msg) = toolbar_action_ui(action); self.toolbar_model .insert() .icon(widget::icon::from_name(icon_name).size(16).icon()) - .text(label) .data::(action); } } @@ -6833,7 +6836,7 @@ impl Application for App { /// Creates a view after each update. fn view(&self) -> Element<'_, Self::Message> { let cosmic_theme::Spacing { - space_xxs, space_s, .. + space_xxs, space_xs, space_s, .. } = theme::active().cosmic().spacing; let mut tab_column = widget::column::with_capacity(4); @@ -6885,18 +6888,24 @@ impl Application for App { // ToolbarAction's message). Drag past threshold = reorder // (ToolbarTabReorder → model.reorder + sync to config). if !self.config.toolbar.is_empty() { + // Use Control style (no TabBar underline, no bottom border) + // and let each button shrink to its icon. Spacing = space_xs + // keeps the buttons visually separated so it looks like an + // icon toolbar rather than a conjoined segmented control. let toolbar = widget::segmented_button::horizontal(&self.toolbar_model) + .style(theme::SegmentedButton::Control) .button_height(32) - .button_spacing(space_xxs) - .minimum_button_width(36) - .maximum_button_width(36) + .button_spacing(space_xs) + .button_alignment(Alignment::Center) + .minimum_button_width(32) + .maximum_button_width(32) .enable_tab_drag(String::from("x-cosmic-files/toolbar-dnd")) .on_reorder(Message::ToolbarTabReorder) .tab_drag_threshold(8.) .on_activate(Message::ToolbarTabActivate); tab_column = tab_column.push( widget::container(toolbar) - .width(Length::Fill) + .width(Length::Shrink) .padding([space_xxs, space_s]), ); }