Skip to content

Conversation

@tobias47n9e
Copy link

Still working on my text only ironbar and was not able to escape the keyboard layout.

This commit allows to escape the keyboard layout:

layout_escaped

Using this config:

[end.icons.layout_map]
German = "<span color='#0091e5'>LAYOUT</span>\n<span color='#0091e5'>[</span>de<span color='#0091e5'>]</span>"

@tobias47n9e tobias47n9e force-pushed the feat/keyboard-layout-escaped branch from c50bdca to a7f2c16 Compare May 30, 2025 18:16
@JakeStanger
Copy link
Owner

This should already work without this patch. The existing IconLabel implementation will call set_label_escaped if the input is not detected to be an image:

ironbar/src/image/gtk.rs

Lines 160 to 170 in 098df1e

glib::spawn_future_local(async move {
let res = provider.load_into_image(&input, size, false, &image).await;
if matches!(res, Ok(true)) {
label.hide();
image.show();
} else {
label.set_label_escaped(&input);
image.hide();
label.show();
}

Are you not seeing it work currently?

@JakeStanger
Copy link
Owner

Oh no, I see the issue. It's an IconButton not IconLabel so it's using the button's in-built set_label method.

The fix here is to extend IconButton to include a set_label method similar to that of IconLabel, rather than re-implementing in the module as you have here.

@JakeStanger JakeStanger added M:Keyboard Related to the Keyboard module T:Module Enhancement Improvements to an existing module. A:UX/UI Relating to user experience or interface. labels Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A:UX/UI Relating to user experience or interface. M:Keyboard Related to the Keyboard module T:Module Enhancement Improvements to an existing module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants