feat(input-sources): Add variant data to applet (#1162)

Co-authored-by: Levi Portenier <levi@system76.com>
This commit is contained in:
Aliaksandr Trush 2026-01-26 16:58:10 +01:00 committed by GitHub
parent 1ba7afe017
commit 3d41a35168
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -219,11 +219,16 @@ impl cosmic::Application for Window {
}
fn view(&self) -> Element<'_, Self::Message> {
let input_source_text = self.core.applet.text(
self.active_layouts
.first()
.map_or("", |l| l.layout.as_str()),
);
let applet_text = if let Some(l) = self.active_layouts.first() {
if !l.variant.is_empty() {
format!("{} ({})", l.layout, l.variant)
} else {
l.layout.clone()
}
} else {
String::new()
};
let input_source_text = self.core.applet.text(applet_text);
let button = self
.core
.applet