mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-27 03:58:12 +08:00
Add new icons to all menu bar entries
This commit is contained in:
@@ -30,25 +30,25 @@ impl LayoutHolder for DemoArtworkDialog {
|
||||
let mut rows_of_images_with_buttons: Vec<_> = ARTWORK
|
||||
.chunks(3)
|
||||
.flat_map(|chunk| {
|
||||
let images = chunk.iter().map(|(_, thumbnail, _)| ImageLabel::new(*thumbnail).width(Some("256px".into())).widget_holder()).collect();
|
||||
fn make_dialog(name: &str, filename: &str) -> Message {
|
||||
DialogMessage::CloseDialogAndThen {
|
||||
followups: vec![FrontendMessage::TriggerFetchAndOpenDocument {
|
||||
name: name.to_string(),
|
||||
filename: filename.to_string(),
|
||||
}
|
||||
.into()],
|
||||
}
|
||||
.into()
|
||||
}
|
||||
|
||||
let images = chunk
|
||||
.iter()
|
||||
.map(|(name, thumbnail, filename)| ImageButton::new(*thumbnail).width(Some("256px".into())).on_update(|_| make_dialog(name, filename)).widget_holder())
|
||||
.collect();
|
||||
|
||||
let buttons = chunk
|
||||
.iter()
|
||||
.map(|(name, _, filename)| {
|
||||
TextButton::new(*name)
|
||||
.min_width(256)
|
||||
.on_update(|_| {
|
||||
DialogMessage::CloseDialogAndThen {
|
||||
followups: vec![FrontendMessage::TriggerFetchAndOpenDocument {
|
||||
name: name.to_string(),
|
||||
filename: filename.to_string(),
|
||||
}
|
||||
.into()],
|
||||
}
|
||||
.into()
|
||||
})
|
||||
.widget_holder()
|
||||
})
|
||||
.map(|(name, _, filename)| TextButton::new(*name).min_width(256).flush(true).on_update(|_| make_dialog(name, filename)).widget_holder())
|
||||
.collect();
|
||||
|
||||
vec![LayoutGroup::Row { widgets: images }, LayoutGroup::Row { widgets: buttons }, LayoutGroup::Row { widgets: vec![] }]
|
||||
|
||||
Reference in New Issue
Block a user