mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-18 18:38:05 +08:00
* Migrate coming soon and about dialog to Rust * Migrate confirm close and close all * Migrate dialog error * Improve keyboard navigation throughout UI * Cleanup and fix panic dialog * Reduce css spacing to better match old dialogs * Add new document modal * Fix crash when generating default name * Populate rust about graphite data on startup * Code review changes * Move one more :focus CSS rule into App.vue * Add a dialog message and move dialogs * Split out keyboard input navigation from this branch * Improvements including simplifying panic dialog code Co-authored-by: Keavon Chambers <keavon@keavon.com>
38 lines
950 B
Rust
38 lines
950 B
Rust
use crate::{layout::widgets::*, message_prelude::FrontendMessage};
|
|
|
|
/// A dialog to notify users of a non-fatal error.
|
|
pub struct Error {
|
|
pub title: String,
|
|
pub description: String,
|
|
}
|
|
|
|
impl PropertyHolder for Error {
|
|
fn properties(&self) -> WidgetLayout {
|
|
WidgetLayout::new(vec![
|
|
LayoutRow::Row {
|
|
widgets: vec![WidgetHolder::new(Widget::TextLabel(TextLabel {
|
|
value: self.title.clone(),
|
|
bold: true,
|
|
..Default::default()
|
|
}))],
|
|
},
|
|
LayoutRow::Row {
|
|
widgets: vec![WidgetHolder::new(Widget::TextLabel(TextLabel {
|
|
value: self.description.clone(),
|
|
multiline: true,
|
|
..Default::default()
|
|
}))],
|
|
},
|
|
LayoutRow::Row {
|
|
widgets: vec![WidgetHolder::new(Widget::TextButton(TextButton {
|
|
label: "OK".to_string(),
|
|
emphasized: true,
|
|
min_width: 96,
|
|
on_update: WidgetCallback::new(|_| FrontendMessage::DisplayDialogDismiss.into()),
|
|
..Default::default()
|
|
}))],
|
|
},
|
|
])
|
|
}
|
|
}
|