Basic loading of blueprints and schema

This commit is contained in:
2023-10-21 00:53:15 -07:00
parent 0bc7d717f6
commit ce765e30cf
18 changed files with 1825 additions and 26 deletions

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<schemalist>
<schema id="im.zander.SimpleLogin" path="/im/zander/SimpleLogin/">
<key name="api-key" type="s">
<default>""</default>
<summary>Api key</summary>
<description>The api key for the current user</description>
</key>
<key name="window-size" type="(ii)">
<default>(-1,-1)</default>
</key>
</schema>
</schemalist>

View File

@ -0,0 +1,240 @@
using Gtk 4.0;
Popover device_entry_popover {
child: Label {
accessible-role: tooltip;
label: "This is the human readable name that will show up in the API key section of the SimpleLogin website.";
max-width-chars: 30;
wrap: true;
}
;
}
template $LoginWindow : ApplicationWindow {
title: "SimpleLogin";
Box {
orientation: vertical;
Overlay forms_overlay {
child: forms_wrapper;
valign: end;
vexpand: true;
Box forms_wrapper {
valign: end;
vexpand: true;
Grid {
halign: end;
hexpand: true;
margin-bottom: 10;
margin-end: 10;
margin-start: 10;
margin-top: 10;
valign: center;
Label {
hexpand: true;
label: "Login:";
margin-bottom: 5;
vexpand: true;
styles [
"login-title-label",
]
layout {
column: "0";
column-span: "2";
row: "0";
}
}
Label error_label {
label: "ERROR";
margin-top: 5;
styles [
"error-message-label",
]
layout {
column: "0";
column-span: "2";
row: "4";
}
}
Entry device_entry {
margin-start: 6;
placeholder-text: "My Awesome Computer";
secondary-icon-name: "dialog-question-symbolic";
truncate-multiline: true;
width-chars: 18;
layout {
column: "1";
row: "3";
}
}
Label {
label: "Device:";
xalign: 0.0;
layout {
column: "0";
row: "3";
}
}
Label {
label: "Email:";
xalign: 0.0;
layout {
column: "0";
row: "1";
}
}
Label {
label: "Password:";
xalign: 0.0;
layout {
column: "0";
row: "2";
}
}
Entry email_entry {
hexpand: true;
input-purpose: email;
margin-start: 6;
receives-default: true;
truncate-multiline: true;
styles [
]
layout {
column: "1";
row: "1";
}
}
PasswordEntry password_entry {
hexpand: true;
margin-start: 6;
show-peek-icon: true;
layout {
column: "1";
row: "2";
}
}
Button login_button {
halign: center;
label: "Login";
margin-top: 5;
sensitive: false;
valign: center;
layout {
column: "0";
column-span: "2";
row: "5";
}
}
styles [
"login-form-warpper",
]
}
Label {
halign: center;
justify: center;
label: "- or -";
}
Box {
halign: start;
hexpand: true;
margin-bottom: 10;
margin-end: 10;
margin-start: 10;
margin-top: 10;
orientation: vertical;
valign: center;
Label {
hexpand: true;
label: "Set API Key:";
margin-bottom: 5;
styles [
"login-title-label",
]
}
PasswordEntry api_key_entry {
hexpand: true;
margin-end: 3;
margin-start: 8;
show-peek-icon: true;
width-chars: 27;
}
Button api_key_button {
halign: center;
label: "Accept";
margin-top: 5;
sensitive: false;
}
}
}
}
Label {
label: "Don\'t have an account? You can register <a href=\"https://app.simplelogin.io/auth/register\">here</a>.";
margin-bottom: 10;
use-markup: true;
valign: start;
vexpand: true;
yalign: 0.0;
}
}
}
Box loading_overlay {
orientation: vertical;
Spinner {
spinning: true;
valign: end;
vexpand: true;
styles [
"loading-label",
]
}
Label {
label: "Loading...";
valign: start;
vexpand: true;
styles [
"loading-label",
]
}
styles [
"loading-label",
]
}

View File

@ -0,0 +1,121 @@
using Gtk 4.0;
template $TotpWindow : Window {
modal: true;
title: "TOTP Entry";
Overlay overlay {
child: form_wrapper;
halign: center;
hexpand: true;
valign: center;
vexpand: true;
Grid form_wrapper {
column-spacing: 5;
halign: center;
hexpand: true;
margin-bottom: 10;
margin-end: 10;
margin-start: 10;
margin-top: 10;
row-spacing: 5;
valign: center;
vexpand: true;
Box {
halign: center;
hexpand: true;
Image {
halign: center;
icon-name: "dialog-password-symbolic";
}
Label {
label: "TOTP";
styles [
"login-title-label",
]
}
layout {
column: "0";
column-span: "2";
row: "0";
}
}
Button accept_button {
label: "Accept";
layout {
column: "1";
row: "3";
}
}
Button cancel_button {
label: "Cancel";
layout {
column: "0";
row: "3";
}
}
Entry code_entry {
placeholder-text: "TOTP Code";
layout {
column: "0";
column-span: "2";
row: "1";
}
}
Label error_label {
label: "ERROR";
styles [
"error-message-label",
]
layout {
column: "0";
column-span: "2";
row: "2";
}
}
}
}
}
Box loading_overlay {
orientation: vertical;
Spinner {
spinning: true;
valign: end;
vexpand: true;
styles [
"loading-label",
]
}
Label {
label: "Loading...";
valign: start;
vexpand: true;
styles [
"loading-label",
]
}
styles [
"loading-label",
]
}