[PR #651] [MERGED] Launcher truncate options & related refactors #7873

Closed
opened 2026-05-23 02:56:01 +01:00 by JakeStanger · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/JakeStanger/ironbar/pull/651
Author: @JakeStanger
Created: 6/28/2024
Status: Merged
Merged: 11/24/2024
Merged by: @JakeStanger

Base: masterHead: feat/launcher-truncate


📝 Commits (4)

  • df4bfc8 feat(truncate): explicit off mode
  • cc6f21e refactor: take reference into image provider
  • 8b05ed5 refactor: move label truncate function to ext trait
  • da13b9d feat(launcher): truncate and truncate_popup config options

📊 Changes

19 files changed (+230 additions, -146 deletions)

View changed files

📝 Cargo.lock (+8 -8)
📝 docs/modules/Clipboard.md (+9 -9)
📝 docs/modules/Focused.md (+9 -9)
📝 docs/modules/Launcher.md (+15 -7)
📝 docs/modules/Music.md (+21 -21)
📝 src/config/mod.rs (+1 -1)
📝 src/config/truncate.rs (+35 -22)
📝 src/gtk_helpers.rs (+18 -2)
📝 src/image/gtk.rs (+2 -2)
📝 src/image/provider.rs (+4 -3)
📝 src/modules/clipboard.rs (+2 -1)
📝 src/modules/custom/image.rs (+1 -1)
📝 src/modules/focused.rs (+3 -2)
📝 src/modules/launcher/item.rs (+50 -16)
📝 src/modules/launcher/mod.rs (+46 -36)
📝 src/modules/music/mod.rs (+2 -2)
📝 src/modules/networkmanager.rs (+2 -2)
📝 src/modules/sway/mode.rs (+1 -1)
📝 src/modules/upower.rs (+1 -1)

📄 Description

Adds two new options to the launcher module:

  • truncate - applies to application names when show_names is enabled. This defaults to mode = "end".
  • truncate_popup - applies to window names within the group popup. This defaults to mode = "end" max_length = 25 and replaces the previous hard-coded implementation.

The truncate.mode option can now also be explicitly set to off everywhere it's taken. This is the same as leaving it as null in most cases for now, but I will be reviewing the other modules to ensure they too are using a sensible default.

The truncation code has also been refactored.

Resolves partially #633


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/JakeStanger/ironbar/pull/651 **Author:** [@JakeStanger](https://github.com/JakeStanger) **Created:** 6/28/2024 **Status:** ✅ Merged **Merged:** 11/24/2024 **Merged by:** [@JakeStanger](https://github.com/JakeStanger) **Base:** `master` ← **Head:** `feat/launcher-truncate` --- ### 📝 Commits (4) - [`df4bfc8`](https://github.com/JakeStanger/ironbar/commit/df4bfc83d04146213ef44b125492e588c2a2d02b) feat(truncate): explicit `off` mode - [`cc6f21e`](https://github.com/JakeStanger/ironbar/commit/cc6f21ed682b5123c6a19309fbb03b50f995535a) refactor: take reference into image provider - [`8b05ed5`](https://github.com/JakeStanger/ironbar/commit/8b05ed526d29f9636075ae0674de848e0fb9b9ac) refactor: move label truncate function to ext trait - [`da13b9d`](https://github.com/JakeStanger/ironbar/commit/da13b9d5005639056a6f0e026c58acd3f454fcd6) feat(launcher): `truncate` and `truncate_popup` config options ### 📊 Changes **19 files changed** (+230 additions, -146 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+8 -8) 📝 `docs/modules/Clipboard.md` (+9 -9) 📝 `docs/modules/Focused.md` (+9 -9) 📝 `docs/modules/Launcher.md` (+15 -7) 📝 `docs/modules/Music.md` (+21 -21) 📝 `src/config/mod.rs` (+1 -1) 📝 `src/config/truncate.rs` (+35 -22) 📝 `src/gtk_helpers.rs` (+18 -2) 📝 `src/image/gtk.rs` (+2 -2) 📝 `src/image/provider.rs` (+4 -3) 📝 `src/modules/clipboard.rs` (+2 -1) 📝 `src/modules/custom/image.rs` (+1 -1) 📝 `src/modules/focused.rs` (+3 -2) 📝 `src/modules/launcher/item.rs` (+50 -16) 📝 `src/modules/launcher/mod.rs` (+46 -36) 📝 `src/modules/music/mod.rs` (+2 -2) 📝 `src/modules/networkmanager.rs` (+2 -2) 📝 `src/modules/sway/mode.rs` (+1 -1) 📝 `src/modules/upower.rs` (+1 -1) </details> ### 📄 Description Adds two new options to the `launcher` module: - `truncate` - applies to application names when `show_names` is enabled. This defaults to `mode = "end"`. - `truncate_popup` - applies to window names within the group popup. This defaults to `mode = "end" max_length = 25` and replaces the previous hard-coded implementation. The `truncate.mode` option can now also be explicitly set to `off` everywhere it's taken. This is the same as leaving it as `null` in most cases for now, but I will be reviewing the other modules to ensure they too are using a sensible default. The truncation code has also been refactored. Resolves partially #633 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
JakeStanger 2026-05-23 02:56:01 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JakeStanger/ironbar#7873
No description provided.