Break context menu items out in theme

This commit is contained in:
Nathan Sobo 2022-05-24 19:59:08 -06:00 committed by Antonio Scandurra
parent 6b96822c1a
commit b428d0de38
2 changed files with 10 additions and 4 deletions

View file

@ -890,11 +890,11 @@ impl ProjectPanel {
Overlay::new( Overlay::new(
Flex::column() Flex::column()
.with_child(Label::new("Add File".to_string(), style.label.clone()).boxed()) .with_child(
Label::new("Add File".to_string(), style.item.label.clone()).boxed(),
)
.contained() .contained()
.with_style(style.container) .with_style(style.container)
// .constrained()
// .with_width(style.width)
.boxed(), .boxed(),
) )
.with_abs_position(menu.position) .with_abs_position(menu.position)

View file

@ -242,7 +242,13 @@ pub struct ProjectPanelEntry {
#[derive(Clone, Debug, Deserialize, Default)] #[derive(Clone, Debug, Deserialize, Default)]
pub struct ContextMenu { pub struct ContextMenu {
pub width: f32, #[serde(flatten)]
pub container: ContainerStyle,
pub item: ContextMenuItem,
}
#[derive(Clone, Debug, Deserialize, Default)]
pub struct ContextMenuItem {
#[serde(flatten)] #[serde(flatten)]
pub container: ContainerStyle, pub container: ContainerStyle,
pub label: TextStyle, pub label: TextStyle,