feat: more native menus with expected reactions

This commit is contained in:
Georg Bauer
2026-07-27 15:09:12 +02:00
parent 8f02f0934b
commit c96675c462
11 changed files with 738 additions and 70 deletions

View File

@@ -53,16 +53,46 @@ const TRAFFIC_LIGHT_WIDTH: f32 = 78.0;
impl App {
pub(crate) fn view(&self, id: window::Id) -> Element<'_, Message> {
if self.model_manager_window == Some(id) {
let content = if self.model_manager_window == Some(id) {
self.model_manager()
} else if self.help_window == Some(id) {
self.help_view()
} else {
let content = self.main_view();
#[cfg(target_os = "macos")]
return crate::native_edit::native_edit(content, self.native_edit_commands.clone())
.into();
#[cfg(not(target_os = "macos"))]
content
}
self.main_view()
};
#[cfg(target_os = "macos")]
return crate::native_edit::native_edit(
content,
self.native_edit_commands.clone(),
self.native_edit_availability.clone(),
)
.into();
#[cfg(not(target_os = "macos"))]
content
}
fn help_view(&self) -> Element<'_, Message> {
container(
scrollable(
container(
markdown::view(
self.help_markdown.items(),
markdown::Settings::with_text_size(
15,
markdown::Style::from_palette(app_theme().palette()),
),
)
.map(Message::OpenLink),
)
.max_width(760)
.padding(32),
)
.height(Length::Fill),
)
.center_x(Length::Fill)
.height(Length::Fill)
.style(sidebar_style)
.into()
}
/// Whether a dialog covers the window. Focus moves through the whole widget