menu: Fix text appearance of disabled entries
This commit is contained in:
parent
003b7fb538
commit
c306e11a22
1 changed files with 15 additions and 2 deletions
|
|
@ -338,7 +338,7 @@ impl Program for ContextMenu {
|
||||||
.map(|(idx, item)| match item {
|
.map(|(idx, item)| match item {
|
||||||
Item::Separator => horizontal_rule(1)
|
Item::Separator => horizontal_rule(1)
|
||||||
.style(theme::Rule::LightDivider)
|
.style(theme::Rule::LightDivider)
|
||||||
.width(Length::Shrink)
|
.width(mode)
|
||||||
.into(),
|
.into(),
|
||||||
Item::Submenu { title, .. } => Row::with_children(vec![
|
Item::Submenu { title, .. } => Row::with_children(vec![
|
||||||
horizontal_space(16).into(),
|
horizontal_space(16).into(),
|
||||||
|
|
@ -377,7 +377,20 @@ impl Program for ContextMenu {
|
||||||
} else {
|
} else {
|
||||||
horizontal_space(16).into()
|
horizontal_space(16).into()
|
||||||
},
|
},
|
||||||
text(title).width(mode).into(),
|
text(title)
|
||||||
|
.width(mode)
|
||||||
|
.style(if *disabled {
|
||||||
|
theme::Text::Custom(|theme| {
|
||||||
|
let mut color = theme.cosmic().background.component.on;
|
||||||
|
color.alpha *= 0.5;
|
||||||
|
TextAppearance {
|
||||||
|
color: Some(color.into()),
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
theme::Text::Default
|
||||||
|
})
|
||||||
|
.into(),
|
||||||
];
|
];
|
||||||
if let Some(shortcut) = shortcut.as_ref() {
|
if let Some(shortcut) = shortcut.as_ref() {
|
||||||
components.push(
|
components.push(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue