1084 lines
36 KiB
Text
1084 lines
36 KiB
Text
import "../../../assets/fonts/MaterialSymbolsRounded[FILL,GRAD,opsz,wght].ttf";
|
|
import { Theme } from "theme.slint";
|
|
import { Shapes, ShapeKind } from "shapes.slint";
|
|
import { Icons } from "components/icon.slint";
|
|
import { Motion, MotionPrefs } from "motion.slint";
|
|
import { Menu, MenuItem, MenuEntry } from "components/menu.slint";
|
|
import { Dialog } from "components/dialog.slint";
|
|
import { ButtonKind } from "components/button.slint";
|
|
import { TextField } from "components/text-field.slint";
|
|
import { DetailRow, FolderActions, FolderState, FolderStatus, Grouping, NavKey, SortColumn, Travel, ViewKeys, ViewMode } from "views/details-view.slint";
|
|
import { GridRow } from "views/grid-view.slint";
|
|
import { TabBar, TabData } from "shell/tab-bar.slint";
|
|
import { Toolbar } from "shell/toolbar.slint";
|
|
import { Crumb, Completion, CompletionList } from "shell/breadcrumb.slint";
|
|
import { Pane, PaneData } from "shell/pane.slint";
|
|
import { Sidebar, SidebarSection, PlaceItem } from "shell/sidebar.slint";
|
|
import { StatusBar, TrashBar } from "shell/status-bar.slint";
|
|
import { PlayerBar, PlayerData } from "shell/player-bar.slint";
|
|
import { ToastStack, ToastData, ToastProgress } from "components/toast.slint";
|
|
import { TooltipLayer } from "components/tooltip.slint";
|
|
import { DialogAction } from "components/dialog.slint";
|
|
import { ConflictDialog, ConflictInfo } from "dialogs/conflict.slint";
|
|
import { ConfirmDialog } from "dialogs/confirm.slint";
|
|
import { ErrorsDialog } from "dialogs/errors.slint";
|
|
import { PropertiesDialog, PropertiesInfo, PropRow } from "dialogs/properties.slint";
|
|
import { OpenWithDialog, AppRow } from "dialogs/open-with.slint";
|
|
import { FolderAppearanceDialog } from "dialogs/folder-appearance.slint";
|
|
import { LauncherDialog, LauncherData } from "dialogs/launcher.slint";
|
|
import { PlaceIconDialog } from "dialogs/place-icon.slint";
|
|
import { IconChoice, IconBrowser, IconRow } from "components/icon-picker.slint";
|
|
import { TagEditorDialog, TagEditorData, TagField } from "dialogs/tag-editor.slint";
|
|
import { TagLookupDialog, TagLookupData, ReleaseRow, MapRow } from "dialogs/tag-lookup.slint";
|
|
import { SettingsDialog, SettingsData, EditRow, KeyRow } from "dialogs/settings.slint";
|
|
import { ConnectionDialog, ConnectionData } from "dialogs/connection.slint";
|
|
import { HostKeyDialog, HostKeyData } from "dialogs/host-key.slint";
|
|
import { SecretPromptDialog, SecretPromptData } from "dialogs/secret-prompt.slint";
|
|
import { Dnd, DropAction, DropMenu, DropTarget } from "components/drop-menu.slint";
|
|
|
|
export { Theme, Shapes, ShapeKind, MotionPrefs, MenuItem, MenuEntry, DetailRow, FolderState, FolderStatus, Grouping, NavKey, SortColumn, Travel, ViewMode, GridRow }
|
|
export { IconBrowser, IconRow, LauncherData }
|
|
export { FileKind, FilePicks } from "components/text-field.slint";
|
|
export { ColorPicks, Swatch } from "dialogs/appearance-page.slint";
|
|
export { ButtonKind, TabData, PaneData, Crumb, Completion, SidebarSection, PlaceItem, ToastData, ToastProgress, DialogAction, ConflictInfo, SettingsData, EditRow }
|
|
export { PlayerData, FolderActions, ViewKeys, KeyRow, ConnectionData, HostKeyData, SecretPromptData }
|
|
export { PropertiesInfo, PropRow, AppRow, IconChoice, Dnd, DropAction, DropTarget, TagEditorData, TagField, TagLookupData, ReleaseRow, MapRow }
|
|
export { Gallery, GalleryPage } from "gallery.slint";
|
|
|
|
// The window: sidebar, tab bar, toolbar with the breadcrumb, the panes of the current tab
|
|
// (two in split view) and the status bar. State comes from Rust (shell/).
|
|
export component MainWindow inherits Window {
|
|
title: "Tunal";
|
|
icon: @image-url("../../../assets/tunal.png");
|
|
min-width: 720px;
|
|
min-height: 480px;
|
|
preferred-width: 960px;
|
|
preferred-height: 640px;
|
|
// The sidebar and tab bar sit on the window; the panes on a rounded card above it.
|
|
background: Theme.surface-container;
|
|
animate background { duration: Motion.time(Motion.medium2); easing: Motion.standard; }
|
|
|
|
// Tabs, by opening order (see TabData).
|
|
in property <[TabData]> tabs;
|
|
in property <int> current-tab;
|
|
in property <int> current-slot;
|
|
callback tab-selected(int);
|
|
callback tab-closed(int);
|
|
callback tab-moved(int, int);
|
|
callback new-tab();
|
|
in property <[MenuItem]> tab-menu;
|
|
callback tab-menu-requested(int);
|
|
callback tab-menu-activated(int, int);
|
|
|
|
// The panes of the current tab; the toolbar, breadcrumb and keys act on the active one.
|
|
in property <[PaneData]> panes;
|
|
in property <int> active-pane;
|
|
// Bumped by Rust to move keyboard focus into the active pane.
|
|
in property <int> focus-request;
|
|
// The pane under the pointer (mouse back and forward buttons), -1 for none.
|
|
out property <int> hovered-pane: -1;
|
|
callback pane-activated(int);
|
|
callback sort-by(int, SortColumn);
|
|
callback filter-typed(int, string);
|
|
callback filter-edited(int, string);
|
|
callback toggle-hidden(int);
|
|
callback toggle-previews(int);
|
|
callback viewport-changed(int, length, length, length, length);
|
|
callback row-clicked(int, int, bool, bool);
|
|
callback band-selected(int, float, length, float, length, bool, bool);
|
|
callback row-activated(int, int);
|
|
callback select-all(int);
|
|
callback clear-selection(int);
|
|
callback navigate(int, NavKey, bool, int) -> int;
|
|
callback grid-columns-changed(int, int);
|
|
callback motion-settled(int);
|
|
callback view-mode-selected(int, ViewMode);
|
|
in property <[MenuItem]> sort-menu;
|
|
callback sort-menu-activated(int, int);
|
|
|
|
// Every key the window sees, before the focused control: text, Ctrl, Shift, Alt, Super,
|
|
// and whether the location field has the keyboard. True when it ran a shortcut
|
|
// (keymap.rs, shell/commands.rs).
|
|
callback shortcut-key(string, bool, bool, bool, bool, bool) -> bool;
|
|
// File actions (actions.rs): the context menu, inline rename, jobs.
|
|
in property <[MenuItem]> context-menu-items;
|
|
// A right click in pane `i` on row (-1: none) at window coordinates.
|
|
callback context-menu-requested(int, int, length, length);
|
|
callback actions-menu-requested(length, length);
|
|
callback context-menu-activated(int, int);
|
|
callback row-renamed(int, int, string);
|
|
callback rename-cancelled(int);
|
|
in property <[ToastData]> toasts;
|
|
callback toast-cancelled(int);
|
|
callback toast-removed(int);
|
|
in property <ConflictInfo> conflict;
|
|
callback conflict-chosen(int, bool);
|
|
in property <string> confirm-title;
|
|
in property <string> confirm-body;
|
|
in property <string> confirm-action;
|
|
callback confirm-answered(bool);
|
|
in property <string> errors-title;
|
|
in property <string> errors-body;
|
|
in property <[string]> errors-lines;
|
|
in property <[DialogAction]> errors-actions;
|
|
// The cookie's glyph; empty for the error sign.
|
|
in property <string> errors-glyph;
|
|
// The buttons Enter and Escape press.
|
|
in property <int> errors-default;
|
|
in property <int> errors-cancel;
|
|
callback errors-answered(int);
|
|
|
|
// Settings dialog (settings.rs). `settings-opening` runs before it shows, so Rust can
|
|
// fill it in.
|
|
in-out property <SettingsData> settings;
|
|
in property <[string]> menu-contexts;
|
|
in property <int> menu-context;
|
|
in property <[EditRow]> menu-rows;
|
|
in property <[EditRow]> menu-available;
|
|
in property <bool> menu-can-reset;
|
|
callback settings-opening();
|
|
callback settings-changed(SettingsData);
|
|
callback menu-context-selected(int);
|
|
callback menu-moved(int, int);
|
|
callback menu-removed(int);
|
|
callback menu-added(int);
|
|
callback menu-separator-added();
|
|
callback menu-reset();
|
|
// The shortcut editor (settings.rs).
|
|
in property <[KeyRow]> key-rows;
|
|
in property <int> key-recording: -1;
|
|
in property <string> key-message;
|
|
in property <bool> key-conflict;
|
|
in property <bool> key-can-reset-all;
|
|
callback key-search(string);
|
|
callback key-record(int);
|
|
callback key-pressed(string, bool, bool, bool, bool);
|
|
callback key-replace();
|
|
callback key-cancel();
|
|
callback key-reset(int);
|
|
callback key-reset-all();
|
|
|
|
// Folder appearance (folder/appearance.rs).
|
|
in property <[IconChoice]> appearance-icons;
|
|
in-out property <int> appearance-choice;
|
|
in-out property <string> appearance-name;
|
|
in-out property <string> appearance-image;
|
|
in-out property <IconChoice> appearance-browsed;
|
|
in-out property <bool> appearance-remember;
|
|
in property <string> appearance-placeholder;
|
|
in property <string> appearance-error;
|
|
in property <bool> appearance-can-elevate;
|
|
callback appearance-saved(bool);
|
|
callback appearance-done(bool);
|
|
|
|
// Tag editor and lookup (tags_bridge.rs).
|
|
in-out property <TagEditorData> tag-editor;
|
|
callback tag-editor-saved();
|
|
callback tag-editor-lookup();
|
|
callback tag-field-changed(int, string);
|
|
callback tag-cover-path(string);
|
|
callback tag-cover-dropped(data-transfer);
|
|
callback tag-cover-removed();
|
|
callback tag-cover-reset();
|
|
in-out property <TagLookupData> tag-lookup;
|
|
callback tag-artist-edited(string);
|
|
callback tag-album-edited(string);
|
|
callback tag-search();
|
|
callback tag-release-picked(int);
|
|
callback tag-next();
|
|
callback tag-back();
|
|
callback tag-lookup-cancelled();
|
|
callback tag-map-step(int, int);
|
|
callback tag-embed-toggled(bool);
|
|
callback tag-apply();
|
|
// Tags were written to the files; the argument is the message for a toast.
|
|
callback tags-written(string);
|
|
|
|
// The quick player (player_bridge.rs).
|
|
in property <PlayerData> player;
|
|
in property <float> player-position;
|
|
callback player-toggle();
|
|
callback player-close();
|
|
// Fraction of the track.
|
|
callback player-seek(float);
|
|
// -1 back, 1 forward.
|
|
callback player-step(int);
|
|
callback player-volume(float);
|
|
callback player-mute();
|
|
|
|
// Properties (properties.rs) and Open with (open.rs).
|
|
in property <PropertiesInfo> properties;
|
|
callback properties-closed();
|
|
in property <[AppRow]> open-with-apps;
|
|
in-out property <int> open-with-selected;
|
|
in-out property <bool> open-with-as-default;
|
|
in property <string> open-with-mime;
|
|
// Row -1: cancelled.
|
|
callback open-with-chosen(int, bool);
|
|
|
|
// Navigation of the active pane.
|
|
in property <bool> can-back;
|
|
in property <bool> can-forward;
|
|
in property <bool> can-up;
|
|
in property <[Crumb]> crumbs;
|
|
in property <string> path;
|
|
in property <[Completion]> completions;
|
|
callback back();
|
|
callback forward();
|
|
callback up();
|
|
callback go-crumb(int);
|
|
callback path-edited(string);
|
|
callback path-accepted(string);
|
|
// Editing the path ended without going anywhere.
|
|
callback path-reverted();
|
|
callback toggle-split();
|
|
|
|
// Sidebar.
|
|
in property <[SidebarSection]> sections;
|
|
in property <bool> show-sidebar: true;
|
|
// Set after a resize, not bound: the window's size depends on the toolbar's buttons.
|
|
property <bool> toolbar-compact;
|
|
function fit-toolbar() {
|
|
root.toolbar-compact = root.width - (root.show-sidebar ? 240px : 0) < Theme.toolbar-compact-width;
|
|
}
|
|
changed width => {
|
|
root.fit-toolbar();
|
|
}
|
|
changed show-sidebar => {
|
|
root.fit-toolbar();
|
|
}
|
|
in property <[MenuItem]> place-menu;
|
|
callback toggle-sidebar();
|
|
in property <bool> has-current-place;
|
|
in property <int> current-place-section;
|
|
in property <int> current-place-row;
|
|
in property <int> current-place-rows-before;
|
|
callback place-opened(int, int, bool);
|
|
callback place-ejected(int, int);
|
|
callback section-toggled(int);
|
|
callback add-bookmark();
|
|
callback place-menu-requested(int, int);
|
|
callback place-menu-activated(int, int);
|
|
callback place-renamed(string);
|
|
// The launcher maker and editor (launcher.rs).
|
|
in-out property <LauncherData> launcher;
|
|
in property <[IconChoice]> launcher-icons;
|
|
callback launcher-saved();
|
|
// The icon of a sidebar entry (shell/place_icon.rs).
|
|
in property <[IconChoice]> place-icons;
|
|
in-out property <int> place-icon-choice;
|
|
in-out property <string> place-icon-image;
|
|
in-out property <IconChoice> place-icon-browsed;
|
|
in property <string> place-icon-error;
|
|
callback place-icon-saved();
|
|
|
|
in property <string> status;
|
|
// The Trash is shown: what it holds ("" when empty), and its Empty Trash button.
|
|
in property <bool> trash-shown;
|
|
in property <string> trash-text;
|
|
callback empty-trash();
|
|
|
|
// Network connections (net_bridge.rs): the connection editor, an unknown or changed host
|
|
// key, and a password or passphrase to ask for.
|
|
in-out property <ConnectionData> connection;
|
|
// Returns the reason it can't be saved, or an empty string.
|
|
callback connection-saved(ConnectionData) -> string;
|
|
callback connection-removed();
|
|
callback connection-host-edited(ConnectionData) -> ConnectionData;
|
|
callback add-connection();
|
|
in property <HostKeyData> host-key;
|
|
// 0 refuse, 1 connect once, 2 connect and remember.
|
|
callback host-key-answered(int);
|
|
in property <SecretPromptData> secret-prompt;
|
|
callback secret-answered(bool, string);
|
|
|
|
public function show-connection() {
|
|
connection-dialog.show();
|
|
}
|
|
|
|
public function show-host-key() {
|
|
host-key-dialog.show();
|
|
}
|
|
|
|
public function close-host-key() {
|
|
host-key-dialog.close();
|
|
}
|
|
|
|
public function show-secret() {
|
|
secret-dialog.show();
|
|
}
|
|
|
|
public function close-secret() {
|
|
secret-dialog.close();
|
|
}
|
|
|
|
public function open-place-menu(x: length, y: length) {
|
|
place-popup.open-at(x, y);
|
|
}
|
|
|
|
public function show-launcher() {
|
|
launcher-dialog.show();
|
|
}
|
|
|
|
public function close-launcher() {
|
|
launcher-dialog.close();
|
|
}
|
|
|
|
public function show-place-icon() {
|
|
place-icon-dialog.show();
|
|
}
|
|
|
|
public function close-place-icon() {
|
|
place-icon-dialog.close();
|
|
}
|
|
|
|
public function rename-place(name: string) {
|
|
rename-field.text = name;
|
|
rename-dialog.show();
|
|
}
|
|
|
|
public function open-context-menu(x: length, y: length) {
|
|
context-popup.open-at(x, y);
|
|
}
|
|
|
|
// After a drop without modifiers (dnd.rs): 0 move, 1 copy, 2 link, else cancel.
|
|
callback drop-chosen(int);
|
|
public function open-drop-menu(x: length, y: length) {
|
|
drop-popup.open-at(x, y);
|
|
}
|
|
|
|
public function show-settings(page: int) {
|
|
root.settings-opening();
|
|
settings-dialog.page = page;
|
|
settings-dialog.show();
|
|
}
|
|
|
|
public function show-conflict() {
|
|
conflict-dialog.apply-all = false;
|
|
conflict-dialog.show();
|
|
}
|
|
|
|
public function close-conflict() {
|
|
conflict-dialog.close();
|
|
}
|
|
|
|
public function show-confirm() {
|
|
confirm-dialog.show();
|
|
}
|
|
|
|
public function close-confirm() {
|
|
confirm-dialog.close();
|
|
}
|
|
|
|
public function show-properties() {
|
|
properties-dialog.show();
|
|
}
|
|
|
|
public function close-properties() {
|
|
properties-dialog.close();
|
|
}
|
|
|
|
public function show-appearance() {
|
|
appearance-dialog.show();
|
|
}
|
|
|
|
public function close-appearance() {
|
|
appearance-dialog.close();
|
|
}
|
|
|
|
public function show-tag-editor() {
|
|
tag-editor-dialog.show();
|
|
}
|
|
|
|
public function close-tag-editor() {
|
|
tag-editor-dialog.close();
|
|
}
|
|
|
|
public function show-tag-lookup() {
|
|
tag-lookup-dialog.show();
|
|
}
|
|
|
|
public function close-tag-lookup() {
|
|
tag-lookup-dialog.close();
|
|
}
|
|
|
|
public function show-open-with() {
|
|
open-with-dialog.show();
|
|
}
|
|
|
|
public function close-open-with() {
|
|
open-with-dialog.close();
|
|
}
|
|
|
|
public function show-errors() {
|
|
errors-dialog.show();
|
|
}
|
|
|
|
public function close-errors() {
|
|
errors-dialog.close();
|
|
}
|
|
|
|
// Puts `text` on the system clipboard.
|
|
public function copy-text(text: string) {
|
|
clip.text = text;
|
|
clip.select-all();
|
|
clip.copy();
|
|
}
|
|
|
|
public function edit-path() {
|
|
toolbar.edit-path();
|
|
}
|
|
|
|
// Holds the text `copy-text` puts on the clipboard.
|
|
clip := TextInput {
|
|
visible: false;
|
|
width: 0;
|
|
height: 0;
|
|
}
|
|
|
|
shortcuts := FocusScope {
|
|
// Shift during a drag picks move without the drop menu (see Dnd.shift).
|
|
capture-key-released(event) => {
|
|
if event.text == Key.Shift || event.text == Key.ShiftR {
|
|
Dnd.shift = false;
|
|
}
|
|
reject
|
|
}
|
|
capture-key-pressed(event) => {
|
|
if event.text == Key.Shift || event.text == Key.ShiftR {
|
|
Dnd.shift = true;
|
|
}
|
|
if root.shortcut-key(event.text, event.modifiers.control, event.modifiers.shift, event.modifiers.alt, event.modifiers.meta, toolbar.editing) {
|
|
return accept;
|
|
}
|
|
reject
|
|
}
|
|
|
|
HorizontalLayout {
|
|
Sidebar {
|
|
width: root.show-sidebar ? 240px : 0;
|
|
visible: self.width > 0;
|
|
sections: root.sections;
|
|
has-current: root.has-current-place;
|
|
current-section: root.current-place-section;
|
|
current-row: root.current-place-row;
|
|
rows-before: root.current-place-rows-before;
|
|
animate width { duration: Motion.time(Motion.medium2); easing: Motion.emphasized; }
|
|
open(section, index, new-tab) => {
|
|
root.place-opened(section, index, new-tab);
|
|
}
|
|
eject(section, index) => {
|
|
root.place-ejected(section, index);
|
|
}
|
|
toggle(section) => {
|
|
root.section-toggled(section);
|
|
}
|
|
add-bookmark => {
|
|
root.add-bookmark();
|
|
}
|
|
add-connection => {
|
|
root.add-connection();
|
|
}
|
|
item-menu(section, index, x, y) => {
|
|
root.place-menu-requested(section, index);
|
|
place-popup.open-at(x, y);
|
|
}
|
|
}
|
|
|
|
VerticalLayout {
|
|
HorizontalLayout {
|
|
padding-left: Theme.space-2;
|
|
padding-right: Theme.space-2;
|
|
padding-top: Theme.space-1;
|
|
|
|
TabBar {
|
|
tabs: root.tabs;
|
|
current: root.current-tab;
|
|
current-slot: root.current-slot;
|
|
selected(id) => {
|
|
root.tab-selected(id);
|
|
}
|
|
close(id) => {
|
|
root.tab-closed(id);
|
|
}
|
|
moved(id, slot) => {
|
|
root.tab-moved(id, slot);
|
|
}
|
|
new-tab => {
|
|
root.new-tab();
|
|
}
|
|
tab-menu(id, x, y) => {
|
|
root.tab-menu-requested(id);
|
|
tab-popup.open-at(x, y);
|
|
}
|
|
}
|
|
}
|
|
|
|
// The content card: toolbar, panes and status bar, inset from the window edge.
|
|
HorizontalLayout {
|
|
padding-right: Theme.space-2;
|
|
padding-bottom: Theme.space-2;
|
|
padding-left: root.show-sidebar ? 0 : Theme.space-2;
|
|
|
|
Rectangle {
|
|
border-radius: Theme.corner-card;
|
|
background: Theme.surface;
|
|
drop-shadow-blur: Theme.card-shadow-blur;
|
|
drop-shadow-offset-y: Theme.card-shadow-offset;
|
|
drop-shadow-color: Theme.shadow.with-alpha(Theme.card-shadow-opacity);
|
|
clip: true;
|
|
animate background { duration: Motion.time(Motion.medium2); easing: Motion.standard; }
|
|
|
|
VerticalLayout {
|
|
toolbar := Toolbar {
|
|
compact: root.toolbar-compact;
|
|
can-back: root.can-back;
|
|
can-forward: root.can-forward;
|
|
can-up: root.can-up;
|
|
split: root.panes.length > 1;
|
|
sidebar: root.show-sidebar;
|
|
crumbs: root.crumbs;
|
|
path: root.path;
|
|
completions: root.completions;
|
|
view-mode: root.active-pane < root.panes.length ? root.panes[root.active-pane].folder.mode : ViewMode.details;
|
|
view-mode-selected(mode) => {
|
|
root.view-mode-selected(root.active-pane, mode);
|
|
}
|
|
previews: root.active-pane < root.panes.length ? root.panes[root.active-pane].folder.previews : false;
|
|
previews-toggled => {
|
|
root.toggle-previews(root.active-pane);
|
|
}
|
|
sort-menu(x, y) => {
|
|
sort-popup.open-at(x, y);
|
|
}
|
|
back => {
|
|
root.back();
|
|
}
|
|
forward => {
|
|
root.forward();
|
|
}
|
|
up => {
|
|
root.up();
|
|
}
|
|
toggle-split => {
|
|
root.toggle-split();
|
|
}
|
|
actions(x, y) => {
|
|
root.actions-menu-requested(x, y);
|
|
}
|
|
toggle-sidebar => {
|
|
root.toggle-sidebar();
|
|
}
|
|
go(i) => {
|
|
root.go-crumb(i);
|
|
}
|
|
path-edited(text) => {
|
|
root.path-edited(text);
|
|
}
|
|
path-accepted(text) => {
|
|
root.path-accepted(text);
|
|
}
|
|
path-reverted => {
|
|
root.path-reverted();
|
|
}
|
|
}
|
|
|
|
HorizontalLayout {
|
|
padding-left: root.panes.length > 1 ? Theme.space-2 : 0;
|
|
padding-right: root.panes.length > 1 ? Theme.space-2 : 0;
|
|
spacing: Theme.space-2;
|
|
|
|
for pane[i] in root.panes: Pane {
|
|
property <int> request: root.focus-request + root.refocus;
|
|
data: pane;
|
|
index: i;
|
|
active: i == root.active-pane;
|
|
split: root.panes.length > 1;
|
|
init => {
|
|
if self.active {
|
|
self.focus-view();
|
|
}
|
|
}
|
|
changed request => {
|
|
if self.active {
|
|
self.focus-view();
|
|
}
|
|
}
|
|
changed hovered => {
|
|
if self.hovered {
|
|
root.hovered-pane = i;
|
|
} else if root.hovered-pane == i {
|
|
root.hovered-pane = -1;
|
|
}
|
|
}
|
|
activated => {
|
|
root.pane-activated(i);
|
|
}
|
|
sort-by(column) => {
|
|
root.sort-by(i, column);
|
|
}
|
|
open-sort-menu(x, y) => {
|
|
sort-popup.open-at(x, y);
|
|
}
|
|
filter-typed(text) => {
|
|
root.filter-typed(i, text);
|
|
}
|
|
filter-edited(text) => {
|
|
root.filter-edited(i, text);
|
|
}
|
|
toggle-hidden => {
|
|
root.toggle-hidden(i);
|
|
}
|
|
row-clicked(row, ctrl, shift) => {
|
|
root.row-clicked(i, row, ctrl, shift);
|
|
}
|
|
band(c1, y1, c2, y2, add, start) => {
|
|
root.band-selected(i, c1, y1, c2, y2, add, start);
|
|
}
|
|
row-activated(row) => {
|
|
root.row-activated(i, row);
|
|
}
|
|
select-all => {
|
|
root.select-all(i);
|
|
}
|
|
clear-selection => {
|
|
root.clear-selection(i);
|
|
}
|
|
navigate(key, shift, page) => {
|
|
root.navigate(i, key, shift, page)
|
|
}
|
|
columns-changed(n) => {
|
|
root.grid-columns-changed(i, n);
|
|
}
|
|
motion-settled => {
|
|
root.motion-settled(i);
|
|
}
|
|
viewport-changed(top, height, row, cell) => {
|
|
root.viewport-changed(i, top, height, row, cell);
|
|
}
|
|
row-renamed(row, text) => {
|
|
root.row-renamed(i, row, text);
|
|
}
|
|
rename-cancelled => {
|
|
root.rename-cancelled(i);
|
|
}
|
|
context-menu(row, x, y) => {
|
|
root.context-menu-requested(i, row, x, y);
|
|
}
|
|
}
|
|
}
|
|
|
|
PlayerBar {
|
|
data: root.player;
|
|
position: root.player-position;
|
|
toggle => {
|
|
root.player-toggle();
|
|
}
|
|
close => {
|
|
root.player-close();
|
|
}
|
|
seek(f) => {
|
|
root.player-seek(f);
|
|
}
|
|
step(d) => {
|
|
root.player-step(d);
|
|
}
|
|
volume(v) => {
|
|
root.player-volume(v);
|
|
}
|
|
mute => {
|
|
root.player-mute();
|
|
}
|
|
}
|
|
|
|
TrashBar {
|
|
shown: root.trash-shown;
|
|
text: root.trash-text;
|
|
empty => {
|
|
root.empty-trash();
|
|
}
|
|
}
|
|
|
|
StatusBar {
|
|
text: root.status;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// Focus back to the active pane (after the breadcrumb or a menu).
|
|
property <int> refocus;
|
|
function focus-pane() {
|
|
root.refocus += 1;
|
|
}
|
|
|
|
CompletionList {
|
|
x: toolbar.crumb-x;
|
|
y: toolbar.crumb-bottom + Theme.space-1;
|
|
width: toolbar.crumb-width;
|
|
visible: toolbar.editing && root.completions.length > 0;
|
|
completions: root.completions;
|
|
highlight: toolbar.highlight;
|
|
picked(text) => {
|
|
toolbar.pick(text);
|
|
}
|
|
}
|
|
|
|
sort-popup := Menu {
|
|
width: 100%;
|
|
height: 100%;
|
|
items: root.sort-menu;
|
|
leading-icons: true;
|
|
activated(index, sub) => {
|
|
root.sort-menu-activated(index, sub);
|
|
}
|
|
closed => {
|
|
root.focus-pane();
|
|
}
|
|
}
|
|
|
|
context-popup := Menu {
|
|
width: 100%;
|
|
height: 100%;
|
|
items: root.context-menu-items;
|
|
leading-icons: true;
|
|
activated(index, sub) => {
|
|
root.context-menu-activated(index, sub);
|
|
}
|
|
closed => {
|
|
root.focus-pane();
|
|
}
|
|
}
|
|
|
|
drop-popup := DropMenu {
|
|
width: 100%;
|
|
height: 100%;
|
|
activated(index, sub) => {
|
|
root.drop-chosen(index);
|
|
}
|
|
closed => {
|
|
root.focus-pane();
|
|
}
|
|
}
|
|
|
|
tab-popup := Menu {
|
|
width: 100%;
|
|
height: 100%;
|
|
items: root.tab-menu;
|
|
leading-icons: true;
|
|
activated(index, sub) => {
|
|
root.tab-menu-activated(index, sub);
|
|
}
|
|
closed => {
|
|
root.focus-pane();
|
|
}
|
|
}
|
|
|
|
place-popup := Menu {
|
|
width: 100%;
|
|
height: 100%;
|
|
items: root.place-menu;
|
|
leading-icons: true;
|
|
activated(index, sub) => {
|
|
root.place-menu-activated(index, sub);
|
|
}
|
|
}
|
|
|
|
rename-dialog := Dialog {
|
|
glyph: Icons.edit;
|
|
width: 100%;
|
|
height: 100%;
|
|
title: "Rename place";
|
|
body: "The folder itself keeps its name.";
|
|
content-focus: true;
|
|
actions: [{ text: "Cancel", kind: ButtonKind.text }, { text: "Rename", kind: ButtonKind.filled }];
|
|
default-action: 1;
|
|
cancel-action: 0;
|
|
focus-content => {
|
|
rename-field.focus();
|
|
}
|
|
action(i) => {
|
|
self.close();
|
|
if i == 1 {
|
|
root.place-renamed(rename-field.text);
|
|
}
|
|
}
|
|
|
|
rename-field := TextField {
|
|
label: "Name";
|
|
}
|
|
}
|
|
|
|
settings-dialog := SettingsDialog {
|
|
width: 100%;
|
|
height: 100%;
|
|
data <=> root.settings;
|
|
menu-contexts: root.menu-contexts;
|
|
menu-context: root.menu-context;
|
|
menu-rows: root.menu-rows;
|
|
menu-available: root.menu-available;
|
|
menu-can-reset: root.menu-can-reset;
|
|
changed(data) => {
|
|
root.settings-changed(data);
|
|
}
|
|
menu-context-selected(i) => {
|
|
root.menu-context-selected(i);
|
|
}
|
|
menu-moved(from, to) => {
|
|
root.menu-moved(from, to);
|
|
}
|
|
menu-removed(i) => {
|
|
root.menu-removed(i);
|
|
}
|
|
menu-added(i) => {
|
|
root.menu-added(i);
|
|
}
|
|
menu-separator-added => {
|
|
root.menu-separator-added();
|
|
}
|
|
menu-reset => {
|
|
root.menu-reset();
|
|
}
|
|
key-rows: root.key-rows;
|
|
key-recording: root.key-recording;
|
|
key-message: root.key-message;
|
|
key-conflict: root.key-conflict;
|
|
key-can-reset-all: root.key-can-reset-all;
|
|
key-search(text) => {
|
|
root.key-search(text);
|
|
}
|
|
key-record(i) => {
|
|
root.key-record(i);
|
|
}
|
|
key-pressed(text, ctrl, shift, alt, meta) => {
|
|
root.key-pressed(text, ctrl, shift, alt, meta);
|
|
}
|
|
key-replace => {
|
|
root.key-replace();
|
|
}
|
|
key-cancel => {
|
|
root.key-cancel();
|
|
}
|
|
key-reset(i) => {
|
|
root.key-reset(i);
|
|
}
|
|
key-reset-all => {
|
|
root.key-reset-all();
|
|
}
|
|
closed => {
|
|
root.focus-pane();
|
|
}
|
|
}
|
|
|
|
conflict-dialog := ConflictDialog {
|
|
width: 100%;
|
|
height: 100%;
|
|
info: root.conflict;
|
|
chosen(choice, all) => {
|
|
root.conflict-chosen(choice, all);
|
|
}
|
|
}
|
|
|
|
confirm-dialog := ConfirmDialog {
|
|
width: 100%;
|
|
height: 100%;
|
|
title: root.confirm-title;
|
|
body: root.confirm-body;
|
|
action-text: root.confirm-action;
|
|
answered(yes) => {
|
|
root.confirm-answered(yes);
|
|
}
|
|
}
|
|
|
|
properties-dialog := PropertiesDialog {
|
|
width: 100%;
|
|
height: 100%;
|
|
info: root.properties;
|
|
closed => {
|
|
root.properties-closed();
|
|
}
|
|
}
|
|
|
|
open-with-dialog := OpenWithDialog {
|
|
width: 100%;
|
|
height: 100%;
|
|
apps: root.open-with-apps;
|
|
mime: root.open-with-mime;
|
|
selected <=> root.open-with-selected;
|
|
as-default <=> root.open-with-as-default;
|
|
chosen(row, as-default) => {
|
|
root.open-with-chosen(row, as-default);
|
|
}
|
|
}
|
|
|
|
appearance-dialog := FolderAppearanceDialog {
|
|
width: 100%;
|
|
height: 100%;
|
|
icons: root.appearance-icons;
|
|
choice <=> root.appearance-choice;
|
|
name-text <=> root.appearance-name;
|
|
image-path <=> root.appearance-image;
|
|
browsed <=> root.appearance-browsed;
|
|
remember <=> root.appearance-remember;
|
|
placeholder: root.appearance-placeholder;
|
|
error: root.appearance-error;
|
|
can-elevate: root.appearance-can-elevate;
|
|
saved(elevate) => {
|
|
root.appearance-saved(elevate);
|
|
}
|
|
}
|
|
|
|
launcher-dialog := LauncherDialog {
|
|
width: 100%;
|
|
height: 100%;
|
|
data <=> root.launcher;
|
|
icons: root.launcher-icons;
|
|
saved => {
|
|
root.launcher-saved();
|
|
}
|
|
}
|
|
|
|
place-icon-dialog := PlaceIconDialog {
|
|
width: 100%;
|
|
height: 100%;
|
|
icons: root.place-icons;
|
|
choice <=> root.place-icon-choice;
|
|
image-path <=> root.place-icon-image;
|
|
browsed <=> root.place-icon-browsed;
|
|
error: root.place-icon-error;
|
|
saved => {
|
|
root.place-icon-saved();
|
|
}
|
|
}
|
|
|
|
tag-editor-dialog := TagEditorDialog {
|
|
width: 100%;
|
|
height: 100%;
|
|
data <=> root.tag-editor;
|
|
saved => {
|
|
root.tag-editor-saved();
|
|
}
|
|
lookup => {
|
|
root.tag-editor-lookup();
|
|
}
|
|
field-changed(i, text) => {
|
|
root.tag-field-changed(i, text);
|
|
}
|
|
cover-path-accepted(path) => {
|
|
root.tag-cover-path(path);
|
|
}
|
|
cover-dropped(data) => {
|
|
root.tag-cover-dropped(data);
|
|
}
|
|
cover-removed => {
|
|
root.tag-cover-removed();
|
|
}
|
|
cover-reset => {
|
|
root.tag-cover-reset();
|
|
}
|
|
}
|
|
|
|
tag-lookup-dialog := TagLookupDialog {
|
|
width: 100%;
|
|
height: 100%;
|
|
data <=> root.tag-lookup;
|
|
artist-edited(text) => {
|
|
root.tag-artist-edited(text);
|
|
}
|
|
album-edited(text) => {
|
|
root.tag-album-edited(text);
|
|
}
|
|
search => {
|
|
root.tag-search();
|
|
}
|
|
release-picked(i) => {
|
|
root.tag-release-picked(i);
|
|
}
|
|
next => {
|
|
root.tag-next();
|
|
}
|
|
back => {
|
|
root.tag-back();
|
|
}
|
|
cancelled => {
|
|
root.tag-lookup-cancelled();
|
|
}
|
|
map-step(row, delta) => {
|
|
root.tag-map-step(row, delta);
|
|
}
|
|
embed-toggled(on) => {
|
|
root.tag-embed-toggled(on);
|
|
}
|
|
apply => {
|
|
root.tag-apply();
|
|
}
|
|
}
|
|
|
|
errors-dialog := ErrorsDialog {
|
|
width: 100%;
|
|
height: 100%;
|
|
title: root.errors-title;
|
|
body: root.errors-body;
|
|
lines: root.errors-lines;
|
|
actions: root.errors-actions;
|
|
glyph: root.errors-glyph != "" ? root.errors-glyph : Icons.error;
|
|
default-action: root.errors-default;
|
|
cancel-action: root.errors-cancel;
|
|
answered(i) => {
|
|
root.errors-answered(i);
|
|
}
|
|
}
|
|
|
|
connection-dialog := ConnectionDialog {
|
|
width: 100%;
|
|
height: 100%;
|
|
data <=> root.connection;
|
|
saved(data) => {
|
|
return root.connection-saved(data);
|
|
}
|
|
host-edited(data) => {
|
|
return root.connection-host-edited(data);
|
|
}
|
|
removed => {
|
|
root.connection-removed();
|
|
}
|
|
}
|
|
|
|
host-key-dialog := HostKeyDialog {
|
|
width: 100%;
|
|
height: 100%;
|
|
data: root.host-key;
|
|
answered(i) => {
|
|
self.close();
|
|
root.host-key-answered(i);
|
|
}
|
|
}
|
|
|
|
secret-dialog := SecretPromptDialog {
|
|
width: 100%;
|
|
height: 100%;
|
|
data: root.secret-prompt;
|
|
answered(ok, text) => {
|
|
root.secret-answered(ok, text);
|
|
}
|
|
}
|
|
|
|
ToastStack {
|
|
width: 100%;
|
|
height: 100%;
|
|
toasts: root.toasts;
|
|
cancelled(i) => {
|
|
root.toast-cancelled(i);
|
|
}
|
|
removed(i) => {
|
|
root.toast-removed(i);
|
|
}
|
|
}
|
|
TooltipLayer {
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
}
|