Adjust shortcut text style

This commit is contained in:
Jeremy Soller 2025-06-27 11:44:40 -06:00
parent 4a41aa1d86
commit cf9c0c51ae
No known key found for this signature in database
GPG key ID: 670FDFB5428E05CA
3 changed files with 44 additions and 35 deletions

View file

@ -2866,8 +2866,6 @@ impl Application for App {
fn subscription(&self) -> Subscription<Self::Message> {
struct ConfigSubscription;
struct TerminalEventSubscription;
struct ThemeSubscription;
struct ThemeModeSubscription;
Subscription::batch([
event::listen_with(|event, _status, _window_id| match event {

View file

@ -1,17 +1,19 @@
// SPDX-License-Identifier: GPL-3.0-only
use cosmic::widget::menu::key_bind::KeyBind;
use cosmic::widget::menu::{items as menu_items, menu_button, root as menu_root, Item as MenuItem};
use cosmic::widget::menu::{menu_button, Item as MenuItem};
use cosmic::{
app::Core,
iced::{
advanced::widget::text::Style as TextStyle,
widget::{column, horizontal_space},
Background, Length,
},
iced_core::Border,
theme,
widget::{
self, divider,
menu::{ItemHeight, ItemWidth, MenuBar, Tree as MenuTree},
menu::{ItemHeight, ItemWidth},
responsive_menu_bar, segmented_button,
},
Element,
@ -36,13 +38,22 @@ pub fn context_menu<'a>(
}
String::new()
};
fn key_style(theme: &cosmic::Theme) -> TextStyle {
let mut color = theme.cosmic().background.component.on;
color.alpha *= 0.75;
TextStyle {
color: Some(color.into()),
}
}
let menu_item = |label, action| {
let key = find_key(&action);
menu_button(vec![
widget::text(label).into(),
horizontal_space().into(),
widget::text(key).into(),
widget::text(key)
.class(theme::Text::Custom(key_style))
.into(),
])
.on_press(Message::TabContextAction(entity, action))
};