1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
|
using Gtk 4.0;
using Adw 1;
using Gio 2.0;
Gio.Settings settings {
schema-id: "org.gnome.Papers";
changed::night-mode => $night_mode_changed() swapped;
}
Gio.Settings default_settings {
schema-id: "org.gnome.Papers.Default";
}
template $PpsWindow: Adw.ApplicationWindow {
default-width: 600;
default-height: 600;
width-request: 360;
height-request: 360;
notify::fullscreened => $window_fullscreened() swapped;
content: Adw.ToastOverlay toast_overlay {
child: Adw.ViewStack stack {
hhomogeneous: false;
vhomogeneous: false;
Adw.ViewStackPage {
name: "start";
child: Adw.ToolbarView {
[top]
Adw.HeaderBar {
[end]
MenuButton {
icon-name: "open-menu-symbolic";
tooltip-text: _("Main Menu");
menu-model: app_menu;
primary: true;
}
}
content: Adw.StatusPage {
icon-name: "x-office-document-symbolic";
title: _("Open a Document");
description: _("Drag and drop documents here");
child: Button open_button {
halign: center;
action-name: "win.open";
label: _("_Open…");
use-underline: true;
tooltip-text: _("Open a Document");
styles [
"suggested-action",
"pill",
]
};
};
};
}
Adw.ViewStackPage {
name: "error";
child: Adw.ToolbarView {
[top]
Adw.HeaderBar {}
content: Adw.StatusPage error_page {
icon-name: "dialog-error-symbolic";
title: _("Unable to Open Document");
child: Button {
halign: center;
action-name: "win.open";
label: _("_Open Other File…");
use-underline: true;
styles [
"suggested-action",
"pill",
]
};
};
};
}
Adw.ViewStackPage {
name: "password";
child: $PpsPasswordView password_view {
unlock => $password_view_unlock() swapped;
cancelled => $password_view_cancelled() swapped;
};
}
Adw.ViewStackPage {
name: "loader";
child: $PpsLoaderView loader_view {
cancel => $loader_view_cancelled() swapped;
};
}
Adw.ViewStackPage {
name: "document";
child: $PpsDocumentView document_view {};
}
Adw.ViewStackPage {
name: "presentation";
child: $PpsViewPresentation presentation {
finished => $presentation_finished() swapped;
external-link => $external_link_clicked() swapped;
ShortcutController {
Shortcut {
trigger: "Escape";
action: "action(win.escape)";
}
}
};
}
};
};
DropTarget {
formats: "GdkFileList";
actions: copy;
drop => $drag_data_received() swapped;
}
}
Adw.AlertDialog error_alert {
responses [
close: _("_Close"),
]
}
menu app_menu {
section {
item {
label: _("_Keyboard Shortcuts");
action: "app.shortcuts";
}
item {
label: _("_Help");
action: "app.help";
}
item {
label: _("_About Document Viewer");
action: "app.about";
}
}
}
|