import { HorizontalBox } from "std-widgets.slint"; import { EmailLink, EmailRow, EmailTile, EmailReader, MailProfileRow, SidebarRow, MailLabelRow, MailListEntry, ThreadMessageRow } from "../models.slint"; import { LayoutMetrics } from "../design-system.slint"; import { MailSidebar } from "../components/sidebar.slint"; import { WorkspacePaneResizeHandle } from "../components/workspace-layout.slint"; import { MailListPane } from "mail-list-pane.slint"; import { MailReadingPane } from "mail-reading-pane.slint"; import { TabsUi } from "../components/workspace-navigation.slint"; import { Shortcuts } from "../shortcuts.slint"; import { KeyboardKeys } from "../components/kbd.slint"; import { LocalMailUi } from "../local-mail.slint"; import { MovePickerUi } from "../dialogs/move-dialog.slint"; // Mail workspace composition. AppWindow owns the public state while this // component owns the feature layout, interaction wiring, and clipboard bridge. export component MailView inherits FocusScope { focus-on-tab-navigation: false; focus-on-click: false; in property compact: false; in property available-width: 0px; // Keep the animated geometry outside conditionally instantiated sidebars. private property desktop-sidebar-width: root.mail_sidebar_collapsed ? 0px : LayoutMetrics.sidebar-width; animate desktop-sidebar-width { duration: 220ms; easing: spring(0); } in property layout-mode: "default"; in-out property list-pane-width: LayoutMetrics.list-pane-width; callback list-pane-width-committed(length); in property show-avatars: true; in property loading: false; in property <[EmailRow]> emails: []; in property <[MailListEntry]> list_entries: []; in property group_mail_by_date: true; in property <[ThreadMessageRow]> thread_messages: []; in property selected_thread_index: 0; in property <[SidebarRow]> sidebar_rows: []; // Compact layouts choose the profile from the sidebar. in property <[MailProfileRow]> mail_profiles: []; // The desktop sidebar shows the profile switcher when no top bar does. in property profiles-in-sidebar: false; in property active_mail_profile; in property account_count; callback select_mail_profile(string); callback create_mail_profile(); in-out property folder_filter_query: ""; private property sidebar-scroll-y: 0px; in property <[MailLabelRow]> mail_labels: []; in property <[MailLabelRow]> mail_label_results: []; in property selected_mail_label_count: 0; in property selected_account_uses_labels: false; in property <[EmailTile]> email_tiles: []; in property <[EmailLink]> email_links: []; in property active_view: "mail"; in property selected_scope: "Unified Inbox"; in property selected_scope_title: "Unified Inbox"; in property trash_view: false; in property unified_count: ""; in-out property search_query: ""; in property search_filter: "All mail"; in property selected_sender: ""; in property selected_address: ""; in property selected_subject: ""; in property selected_time: ""; in property selected_to: ""; in property selected_label: ""; in property selected_initials: "?"; in property selected_favicon; in property selected_has_favicon: false; in property selected_plain_text: ""; in property selected_source: ""; in property selected_text: ""; in property has_selection: false; in property clipboard_request: ""; in property clipboard_request_id: 0; in property sync_in_progress: false; in property can_load_more: false; in property loading_more: false; in property list_content_revision: 0; in property selection-count: 0; in property has_selected: true; in property previous-email-id: -1; in property next-email-id: -1; in property selected_starred: false; in property selected_unread: false; in property selected_is_draft: false; in property selected_sender_verification: ""; in property remote-images-blocked: false; in property monochrome_sidebar_icons: false; in property print_supported: true; in-out property mail_sidebar_collapsed: false; in-out property text_mode: false; in-out property source_mode: false; in-out property rendering_info_open: false; in-out property email-content-aspect: 900 / 520; in-out property email-scroll-y: 0px; in-out property settings_open: false; in-out property settings_tab: "General"; in-out property compact-page: "list"; in-out property folders-open: false; private property focus-list-after-settings: false; private property focus-search-after-page-change: false; out property list-focus-visible: root.single-pane ? compact-list-pane.keyboard-focus-visible : desktop-list-pane.keyboard-focus-visible; private property single-pane: root.compact || root.layout-mode == "minimal"; // The shown list's offset, saved with the tab when it is left. private property list-scroll-offset: -(root.single-pane ? compact-list-pane.scroll-y : desktop-list-pane.scroll-y); changed list-scroll-offset => { TabsUi.list-offset = root.list-scroll-offset; } private property list-pane-maximum-width: max( LayoutMetrics.list-pane-width, root.available-width - root.desktop-sidebar-width - LayoutMetrics.divider-width - LayoutMetrics.detail-pane-min-width ); private property effective-list-pane-width: root.list-pane-width.clamp( LayoutMetrics.list-pane-width, root.list-pane-maximum-width ); private property single-pane-content-x: root.compact ? 0px : root.desktop-sidebar-width; private property single-pane-content-width: max(0px, root.width - root.single-pane-content-x); private property page-transition-distance: root.compact ? root.single-pane-content-width : min(96px, root.single-pane-content-width); out property email-viewport-width: root.single-pane ? compact-reading-pane.email-viewport-width : desktop-reading-pane.email-viewport-width; out property email-viewport-height: root.single-pane ? compact-reading-pane.email-viewport-height : desktop-reading-pane.email-viewport-height; out property email-scroll-document-height: root.single-pane ? compact-reading-pane.email-scroll-document-height : desktop-reading-pane.email-scroll-document-height; in property accent; in property accent-soft; in property avatar-bg; in property avatar-selected-bg; in property body-text; in property border; in property border-subtle; in property control-bg; in property faint-text; in property heading; in property muted-control-bg; in property muted-text; in property secondary-text; in property selected-row; in property sidebar-bg; in property surface; in property surface-raised; in property title-color; callback select_email(int); callback select_thread_message(int); callback search_changed(string); callback set_search_filter(string); callback select_scope(string); callback toggle_folder(int, bool); callback toggle_sidebar_section(string, bool); callback filter_folders(string); callback request_folder_create(int, int, string); callback request_label_create(int, string, int, string); callback request_folder_rename(int, string); callback request_folder_delete(int, string); callback request_label_rename(int, string, color, string, bool); callback request_label_delete(int, string, string, bool, bool); callback load_more(); callback sync_mail(); callback sync_account(int); callback check_mail_in_view(); callback message_action(string); callback message_action_for_email(int, string); callback bulk_message_action(string); callback toggle_mail_group(string); callback request_empty_trash(int); callback set_email_checked(int, bool); callback set_all_emails_checked(bool); callback toggle_mail_label(int, bool); callback save_mail_label(int, int, string, color, bool, int); callback search_mail_labels(string); callback compose_message_action(string); callback close_preview(); callback print_message(); callback open_message_in_browser(); callback open_compose(); callback open_email_link(string); callback copy_email_status(string); callback report_rendering_issue(); callback email-pointer-event(float, float, string, bool, bool, bool, bool); callback email-scroll(float, float); callback email-key-event(string, bool, bool, bool, bool, bool, bool); callback select-email-text(); callback load-remote-images-for-message(); function dispatch-message-action(action: string) { if root.selection-count > 0 && (action == "trash" || action == "delete_permanently") { root.bulk_message_action(action); } else { root.message_action(action); } } public function focus-list(show-focus: bool) { if root.single-pane { compact-list-pane.focus-list(show-focus); } else { desktop-list-pane.focus-list(show-focus); } } function focus-reader() { if root.has_selected { if root.single-pane { compact-reading-pane.focus-content(); } else { desktop-reading-pane.focus-content(); } } } function focus-search() { root.folders-open = false; if root.single-pane && root.compact-page != "list" { // The list page takes focus once it is shown; send it to the field. root.focus-search-after-page-change = true; root.compact-page = "list"; root.close_preview(); } else if root.single-pane { compact-list-pane.focus-search(); } else { desktop-list-pane.focus-search(); } } function switch-pane() { if root.single-pane && root.compact-page == "message" { root.compact-page = "list"; root.close_preview(); } else if !root.single-pane && desktop-list-pane.keyboard-focused { root.focus-reader(); } else { root.focus-list(true); } } KeyBinding { keys: Shortcuts.compose; enabled: LocalMailUi.can-send; activated => { root.open_compose(); } } KeyBinding { keys: Shortcuts.search; activated => { root.focus-search(); } } KeyBinding { keys: Shortcuts.search-alternate; activated => { root.focus-search(); } } KeyBinding { keys: Shortcuts.switch-pane; activated => { root.switch-pane(); } } KeyBinding { keys: Shortcuts.check-mail; activated => { root.check_mail_in_view(); } } KeyBinding { keys: Shortcuts.check-all-mail; activated => { root.sync_mail(); } } if KeyboardKeys.apple : KeyBinding { keys: Shortcuts.check-all-mail-alternate; activated => { root.sync_mail(); } } init => { // A new mail view starts at the top; an earlier view's offset is stale. TabsUi.list-offset = root.list-scroll-offset; if root.single-pane && root.compact-page == "message" { root.focus-reader(); } else { root.focus-list(false); } } changed compact-page => { if root.compact-page == "list" && root.focus-search-after-page-change { root.focus-search-after-page-change = false; compact-list-pane.focus-search(); } else if root.compact-page == "list" { root.focus-list(false); } else { root.focus-reader(); } } capture-key-pressed(event) => { if event.modifiers.control || event.modifiers.meta || event.modifiers.alt { return reject; } if event.text == Key.Escape && root.single-pane && root.compact-page == "message" && !EmailReader.find-open && !root.has_selection && !EmailReader.caret-mode { root.compact-page = "list"; root.close_preview(); return accept; } reject } changed layout-mode => { if (root.layout-mode == "minimal") { root.compact-page = "list"; root.folders-open = false; } if root.settings_open { root.focus-list-after-settings = true; } else { root.focus-list(false); } } changed settings_open => { if !root.settings_open && root.focus-list-after-settings { root.focus-list-after-settings = false; root.focus-list(false); } } // Focus goes back to where Move to was opened from. private property move-picker-open: MovePickerUi.open; changed move-picker-open => { if root.move-picker-open { return; } if MovePickerUi.return-to == "reader" { root.focus-reader(); } else { root.focus-list(false); } } changed compact => { if root.single-pane && root.compact-page == "message" { root.focus-reader(); } else { root.focus-list(false); } } HorizontalBox { visible: root.active_view == "mail" && !root.single-pane; x: 0px; y: 0px; width: parent.width; height: parent.height; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; spacing: 0px; if root.active_view == "mail" && !root.single-pane : MailSidebar { show-profiles: root.profiles-in-sidebar; profiles: root.mail_profiles; active-profile: root.active_mail_profile; account-count: root.account_count; choose-profile(id) => { root.select_mail_profile(id); } create-profile => { root.create_mail_profile(); } manage-profiles => { root.settings_tab = "Accounts"; root.settings_open = true; } height: parent.height; touch-mode: false; rows: root.sidebar_rows; scroll-y <=> root.sidebar-scroll-y; unified-count: root.unified_count; sync-in-progress: root.sync_in_progress; selected-scope: root.selected_scope; filter-query <=> root.folder_filter_query; monochrome-icons: root.monochrome_sidebar_icons; collapsed <=> root.mail_sidebar_collapsed; background-color: root.sidebar-bg; hover-background: root.muted-control-bg; selection-background: root.accent-soft; accent-color: root.accent; title-color: root.title-color; body-color: root.body-text; muted-color: root.muted-text; select-scope(scope) => { root.select_scope(scope); } toggle-section(key, open) => { root.toggle_sidebar_section(key, open); } toggle-folder(id, expanded) => { root.toggle_folder(id, expanded); } filter-folders(query) => { root.filter_folders(query); } request-create-folder(account-id, parent-id, parent-name) => { root.request_folder_create(account-id, parent-id, parent-name); } request-create-label(account-id, account-name, parent-id, parent-path) => { root.request_label_create(account-id, account-name, parent-id, parent-path); } request-rename-folder(id, name) => { root.request_folder_rename(id, name); } request-delete-folder(id, name) => { root.request_folder_delete(id, name); } request-empty-trash(account-id) => { root.request_empty_trash(account-id); } request-rename-label(id, name, color, account, global) => { root.request_label_rename(id, name, color, account, global); } request-delete-label(id, name, account, global, has-children) => { root.request_label_delete(id, name, account, global, has-children); } sync-account(account-id) => { root.sync_account(account-id); } compose => { root.open_compose(); } manage-accounts => { root.settings_tab = "Accounts"; root.settings_open = true; } } desktop-list-pane := MailListPane { restores-scroll: !root.single-pane; width: root.effective-list-pane-width; show-avatars: root.show-avatars; loading: root.loading; emails: root.emails; list_entries: root.list_entries; group_mail_by_date: root.group_mail_by_date; selected_scope: root.selected_scope; scope_title: root.selected_scope_title; trash_view: root.trash_view; search_query <=> root.search_query; search_filter: root.search_filter; sync_in_progress: root.sync_in_progress; can_load_more: root.can_load_more; loading_more: root.loading_more; content_revision: root.list_content_revision; selection-count: root.selection-count; mail_sidebar_collapsed <=> root.mail_sidebar_collapsed; accent: root.accent; accent-soft: root.accent-soft; avatar-bg: root.avatar-bg; avatar-selected-bg: root.avatar-selected-bg; body-text: root.body-text; border: root.border; border-subtle: root.border-subtle; control-bg: root.control-bg; faint-text: root.faint-text; heading: root.heading; muted-control-bg: root.muted-control-bg; muted-text: root.muted-text; secondary-text: root.secondary-text; selected-row: root.selected-row; surface: root.surface; title-color: root.title-color; select_email(id) => { root.select_email(id); } open_email(id) => { root.select_email(id); root.focus-reader(); } search_changed(query) => { root.search_changed(query); } set_search_filter(filter) => { root.set_search_filter(filter); } load_more => { root.load_more(); } sync_mail => { root.sync_mail(); } open_compose => { root.open_compose(); } message_action_for_email(id, action) => { root.message_action_for_email(id, action); } bulk_message_action(action) => { root.bulk_message_action(action); } edit-as-new => { root.compose_message_action("edit_as_new"); } toggle_mail_group(key) => { root.toggle_mail_group(key); } open-mail-history => { root.settings_tab = "Accounts"; root.settings_open = true; } set_email_checked(id, checked) => { root.set_email_checked(id, checked); } set_all_emails_checked(checked) => { root.set_all_emails_checked(checked); } } WorkspacePaneResizeHandle { leading-width: root.effective-list-pane-width; maximum-leading-width: root.list-pane-maximum-width; divider-color: root.border; active-color: root.accent; accessibility-label: @tr("Message list width"); resizing(width) => { root.list-pane-width = width; } resize-finished(width) => { root.list-pane-width = width; root.list-pane-width-committed(width); } } desktop-reading-pane := MailReadingPane { shown: !root.single-pane; show-avatars: root.show-avatars; // This is the flexible column. Explicit constraints prevent // the subject's wrapping width from becoming a hard maximum, // so every pixel reclaimed from a collapsing sidebar belongs // to the message surface instead of the window background. min-width: 0px; preferred-width: 0px; max-width: root.width; horizontal-stretch: 1; print_supported: root.print_supported; window-width: root.width; email_tiles: root.email_tiles; email_links: root.email_links; thread-messages: root.thread_messages; selected-thread-index: root.selected_thread_index; selected_sender: root.selected_sender; selected_address: root.selected_address; selected_subject: root.selected_subject; selected_time: root.selected_time; selected_to: root.selected_to; selected_label: root.selected_label; mail_labels: root.mail_labels; mail-label-results: root.mail_label_results; selected-label-count: root.selected_mail_label_count; selected-account-uses-labels: root.selected_account_uses_labels; selected_initials: root.selected_initials; selected_favicon: root.selected_favicon; selected_has_favicon: root.selected_has_favicon; selected_plain_text: root.selected_plain_text; selected_source: root.selected_source; selected_text: root.selected_text; has_selection: root.has_selection; clipboard_request: root.clipboard_request; clipboard_request_id: root.clipboard_request_id; has_selected: root.has_selected; previous-email-id: root.previous-email-id; next-email-id: root.next-email-id; selected_starred: root.selected_starred; selected_unread: root.selected_unread; selected_is_draft: root.selected_is_draft; trash_view: root.trash_view; request_empty_trash => { root.request_empty_trash(-1); } selected_sender_verification: root.selected_sender_verification; remote-images-blocked: root.remote-images-blocked; text_mode <=> root.text_mode; source_mode <=> root.source_mode; rendering_info_open <=> root.rendering_info_open; email-content-aspect <=> root.email-content-aspect; email-scroll-y <=> root.email-scroll-y; accent: root.accent; accent-soft: root.accent-soft; border: root.border; border-subtle: root.border-subtle; control-bg: root.control-bg; heading: root.heading; muted-control-bg: root.muted-control-bg; muted-text: root.muted-text; secondary-text: root.secondary-text; surface: root.surface; surface-raised: root.surface-raised; title-color: root.title-color; message_action(action) => { root.dispatch-message-action(action); } toggle-mail-label(id, applied) => { root.toggle_mail_label(id, applied); } save-mail-label(id, name, color, global) => { root.save_mail_label(id, -1, name, color, global, -1); } search-mail-labels(query) => { root.search_mail_labels(query); } select_email(id) => { root.select_email(id); } select_thread_message(index) => { root.select_thread_message(index); } compose_message_action(action) => { root.compose_message_action(action); } close_preview => { root.close_preview(); root.focus-list(false); } print_message => { root.print_message(); } open_message_in_browser => { root.open_message_in_browser(); } open_email_link(url) => { root.open_email_link(url); } copy_email_status(status) => { root.copy_email_status(status); } report_rendering_issue => { root.report_rendering_issue(); } load-remote-images-for-message => { root.load-remote-images-for-message(); } email-pointer-event(x, y, kind, control, shift, alt, meta) => { root.email-pointer-event(x, y, kind, control, shift, alt, meta); } email-scroll(offset, viewport-height) => { root.email-scroll(offset, viewport-height); } email-key-event(text, pressed, repeat, control, shift, alt, meta) => { root.email-key-event(text, pressed, repeat, control, shift, alt, meta); } select-email-text => { root.select-email-text(); } } } // Compact screens and the desktop Minimal preference share one // navigation stack: folder drawer, message list, then message detail. Rectangle { visible: root.active_view == "mail" && root.single-pane; x: 0px; y: 0px; width: parent.width; height: parent.height; background: root.surface; clip: true; // Minimal changes the mail content presentation, not desktop // navigation. The Default collapsible sidebar remains, with the // list/reader stack consuming its animated remainder. if root.active_view == "mail" && root.single-pane && !root.compact : MailSidebar { show-profiles: root.profiles-in-sidebar; profiles: root.mail_profiles; active-profile: root.active_mail_profile; account-count: root.account_count; choose-profile(id) => { root.select_mail_profile(id); } create-profile => { root.create_mail_profile(); } manage-profiles => { root.settings_tab = "Accounts"; root.settings_open = true; } x: 0px; y: 0px; height: parent.height; touch-mode: false; rows: root.sidebar_rows; scroll-y <=> root.sidebar-scroll-y; unified-count: root.unified_count; sync-in-progress: root.sync_in_progress; selected-scope: root.selected_scope; filter-query <=> root.folder_filter_query; monochrome-icons: root.monochrome_sidebar_icons; collapsed <=> root.mail_sidebar_collapsed; background-color: root.sidebar-bg; hover-background: root.muted-control-bg; selection-background: root.accent-soft; accent-color: root.accent; title-color: root.title-color; body-color: root.body-text; muted-color: root.muted-text; select-scope(scope) => { root.select_scope(scope); root.compact-page = "list"; } toggle-section(key, open) => { root.toggle_sidebar_section(key, open); } toggle-folder(id, expanded) => { root.toggle_folder(id, expanded); } filter-folders(query) => { root.filter_folders(query); } request-create-folder(account-id, parent-id, parent-name) => { root.request_folder_create(account-id, parent-id, parent-name); } request-create-label(account-id, account-name, parent-id, parent-path) => { root.request_label_create(account-id, account-name, parent-id, parent-path); } request-rename-folder(id, name) => { root.request_folder_rename(id, name); } request-delete-folder(id, name) => { root.request_folder_delete(id, name); } request-rename-label(id, name, color, account, global) => { root.request_label_rename(id, name, color, account, global); } request-delete-label(id, name, account, global, has-children) => { root.request_label_delete(id, name, account, global, has-children); } sync-account(account-id) => { root.sync_account(account-id); } compose => { root.open_compose(); } manage-accounts => { root.settings_tab = "Accounts"; root.settings_open = true; } } compact-list-pane := MailListPane { restores-scroll: root.single-pane; loading: root.loading; visible: root.compact-page == "list"; x: root.single-pane-content-x + (root.compact-page == "list" ? 0px : -root.page-transition-distance); y: 0px; width: root.single-pane-content-width; height: parent.height; opacity: root.compact-page == "list" ? 1 : 0; animate x { duration: 260ms; easing: spring(0); } animate opacity { duration: 170ms; easing: ease-out; } compact: root.compact; single-pane-navigation: root.compact; preview-on-navigation: false; show-avatars: root.show-avatars; dense: !root.compact; emails: root.emails; list_entries: root.list_entries; group_mail_by_date: root.group_mail_by_date; selected_scope: root.selected_scope; scope_title: root.selected_scope_title; trash_view: root.trash_view; search_query <=> root.search_query; search_filter: root.search_filter; sync_in_progress: root.sync_in_progress; can_load_more: root.can_load_more; loading_more: root.loading_more; content_revision: root.list_content_revision; selection-count: root.selection-count; mail_sidebar_collapsed <=> root.mail_sidebar_collapsed; accent: root.accent; accent-soft: root.accent-soft; avatar-bg: root.avatar-bg; avatar-selected-bg: root.avatar-selected-bg; body-text: root.body-text; border: root.border; border-subtle: root.border-subtle; control-bg: root.control-bg; faint-text: root.faint-text; heading: root.heading; muted-control-bg: root.muted-control-bg; muted-text: root.muted-text; secondary-text: root.secondary-text; selected-row: root.selected-row; surface: root.surface; title-color: root.title-color; select_email(id) => { root.select_email(id); root.compact-page = "message"; root.folders-open = false; } open_email(id) => { root.select_email(id); root.compact-page = "message"; root.folders-open = false; root.focus-reader(); } search_changed(query) => { root.search_changed(query); } set_search_filter(filter) => { root.set_search_filter(filter); } load_more => { root.load_more(); } sync_mail => { root.sync_mail(); } open_folders => { root.folders-open = true; } open_compose => { root.open_compose(); } message_action_for_email(id, action) => { root.message_action_for_email(id, action); } bulk_message_action(action) => { root.bulk_message_action(action); } edit-as-new => { root.compose_message_action("edit_as_new"); } toggle_mail_group(key) => { root.toggle_mail_group(key); } open-mail-history => { root.settings_tab = "Accounts"; root.settings_open = true; } set_email_checked(id, checked) => { root.set_email_checked(id, checked); } set_all_emails_checked(checked) => { root.set_all_emails_checked(checked); } } compact-reading-pane := MailReadingPane { print_supported: root.print_supported; full-width: true; show-avatars: root.show-avatars; visible: root.compact-page == "message"; shown: root.single-pane && self.visible; x: root.single-pane-content-x + (root.compact-page == "message" ? 0px : root.page-transition-distance); y: 0px; width: root.single-pane-content-width; height: parent.height; opacity: root.compact-page == "message" ? 1 : 0; animate x { duration: 260ms; easing: spring(0); } animate opacity { duration: 170ms; easing: ease-out; } compact: root.compact; window-width: self.width; email_tiles: root.email_tiles; email_links: root.email_links; thread-messages: root.thread_messages; selected-thread-index: root.selected_thread_index; selected_sender: root.selected_sender; selected_address: root.selected_address; selected_subject: root.selected_subject; selected_time: root.selected_time; selected_to: root.selected_to; selected_label: root.selected_label; mail_labels: root.mail_labels; mail-label-results: root.mail_label_results; selected-label-count: root.selected_mail_label_count; selected-account-uses-labels: root.selected_account_uses_labels; selected_initials: root.selected_initials; selected_favicon: root.selected_favicon; selected_has_favicon: root.selected_has_favicon; selected_plain_text: root.selected_plain_text; selected_source: root.selected_source; selected_text: root.selected_text; has_selection: root.has_selection; clipboard_request: root.clipboard_request; clipboard_request_id: root.clipboard_request_id; has_selected: root.has_selected; previous-email-id: root.previous-email-id; next-email-id: root.next-email-id; selected_starred: root.selected_starred; selected_unread: root.selected_unread; selected_is_draft: root.selected_is_draft; trash_view: root.trash_view; request_empty_trash => { root.request_empty_trash(-1); } selected_sender_verification: root.selected_sender_verification; remote-images-blocked: root.remote-images-blocked; text_mode <=> root.text_mode; source_mode <=> root.source_mode; rendering_info_open <=> root.rendering_info_open; email-content-aspect <=> root.email-content-aspect; email-scroll-y <=> root.email-scroll-y; accent: root.accent; accent-soft: root.accent-soft; border: root.border; border-subtle: root.border-subtle; control-bg: root.control-bg; heading: root.heading; muted-control-bg: root.muted-control-bg; muted-text: root.muted-text; secondary-text: root.secondary-text; surface: root.surface; surface-raised: root.surface-raised; title-color: root.title-color; message_action(action) => { root.dispatch-message-action(action); } toggle-mail-label(id, applied) => { root.toggle_mail_label(id, applied); } save-mail-label(id, name, color, global) => { root.save_mail_label(id, -1, name, color, global, -1); } search-mail-labels(query) => { root.search_mail_labels(query); } select_email(id) => { root.select_email(id); } select_thread_message(index) => { root.select_thread_message(index); } compose_message_action(action) => { root.compose_message_action(action); } close_preview => { root.compact-page = "list"; root.close_preview(); } print_message => { root.print_message(); } open_message_in_browser => { root.open_message_in_browser(); } open_email_link(url) => { root.open_email_link(url); } copy_email_status(status) => { root.copy_email_status(status); } report_rendering_issue => { root.report_rendering_issue(); } load-remote-images-for-message => { root.load-remote-images-for-message(); } email-pointer-event(x, y, kind, control, shift, alt, meta) => { root.email-pointer-event(x, y, kind, control, shift, alt, meta); } email-scroll(offset, viewport-height) => { root.email-scroll(offset, viewport-height); } email-key-event(text, pressed, repeat, control, shift, alt, meta) => { root.email-key-event(text, pressed, repeat, control, shift, alt, meta); } select-email-text => { root.select-email-text(); } } // Modal drawer and scrim intentionally sit above both compact pages. Rectangle { visible: root.compact && (root.folders-open || self.opacity > 0); x: 0px; y: 0px; width: parent.width; height: parent.height; z: 100; background: #00000055; opacity: root.folders-open ? 1 : 0; animate opacity { duration: 180ms; easing: ease-out; } TouchArea { enabled: root.folders-open; accessible-role: button; accessible-label: @tr("Close folders"); accessible-action-default => { root.folders-open = false; } clicked => { root.folders-open = false; } } } if root.active_view == "mail" && root.compact : MailSidebar { visible: root.folders-open || self.x > -self.width - 11px; x: root.folders-open ? 0px : -self.width - 12px; y: 0px; width: min(300px, parent.width - 48px); height: parent.height; z: 101; opacity: root.folders-open ? 1 : 0.92; drop-shadow-blur: root.folders-open ? 24px : 0px; drop-shadow-offset-x: 6px; drop-shadow-color: #00000035; animate x { duration: 260ms; easing: spring(0.08); } animate opacity { duration: 180ms; easing: ease-out; } animate drop-shadow-blur { duration: 180ms; easing: ease-out; } touch-mode: true; show-profiles: true; profiles: root.mail_profiles; active-profile: root.active_mail_profile; account-count: root.account_count; choose-profile(id) => { root.select_mail_profile(id); root.folders-open = false; root.compact-page = "list"; } create-profile => { root.folders-open = false; root.create_mail_profile(); } manage-profiles => { root.folders-open = false; root.settings_tab = "Accounts"; root.settings_open = true; } rows: root.sidebar_rows; scroll-y <=> root.sidebar-scroll-y; unified-count: root.unified_count; sync-in-progress: root.sync_in_progress; selected-scope: root.selected_scope; filter-query <=> root.folder_filter_query; monochrome-icons: root.monochrome_sidebar_icons; collapsed: false; background-color: root.sidebar-bg; hover-background: root.muted-control-bg; selection-background: root.accent-soft; accent-color: root.accent; title-color: root.title-color; body-color: root.body-text; muted-color: root.muted-text; select-scope(scope) => { root.select_scope(scope); root.folders-open = false; root.compact-page = "list"; } toggle-section(key, open) => { root.toggle_sidebar_section(key, open); } toggle-folder(id, expanded) => { root.toggle_folder(id, expanded); } filter-folders(query) => { root.filter_folders(query); } request-create-folder(account-id, parent-id, parent-name) => { root.request_folder_create(account-id, parent-id, parent-name); } request-create-label(account-id, account-name, parent-id, parent-path) => { root.request_label_create(account-id, account-name, parent-id, parent-path); } request-rename-folder(id, name) => { root.request_folder_rename(id, name); } request-delete-folder(id, name) => { root.request_folder_delete(id, name); } request-empty-trash(account-id) => { root.request_empty_trash(account-id); } request-rename-label(id, name, color, account, global) => { root.request_label_rename(id, name, color, account, global); } request-delete-label(id, name, account, global, has-children) => { root.request_label_delete(id, name, account, global, has-children); } sync-account(account-id) => { root.sync_account(account-id); } compose => { root.folders-open = false; root.open_compose(); } manage-accounts => { root.folders-open = false; root.settings_tab = "Accounts"; root.settings_open = true; } } } }