mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-26 11:47:25 +01:00
Add welcome page and improve generated code
This commit is contained in:
parent
379923e4ca
commit
f61482c329
11 changed files with 175 additions and 92 deletions
|
|
@ -3,6 +3,7 @@ gnome = import('gnome')
|
|||
|
||||
blueprints = custom_target('blueprints',
|
||||
input: files(
|
||||
'welcome_page.blp',
|
||||
'window.blp'
|
||||
),
|
||||
output: '.',
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<gresources>
|
||||
<gresource prefix="/de/johrpan/musicus">
|
||||
<file preprocess="xml-stripblanks">welcome_page.ui</file>
|
||||
<file preprocess="xml-stripblanks">window.ui</file>
|
||||
</gresource>
|
||||
</gresources>
|
||||
|
|
|
|||
39
data/res/welcome_page.blp
Normal file
39
data/res/welcome_page.blp
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
using Gtk 4.0;
|
||||
using Adw 1;
|
||||
|
||||
template $MusicusWelcomePage : Adw.NavigationPage {
|
||||
title: _("Welcome to Musicus");
|
||||
|
||||
Adw.ToolbarView {
|
||||
[top]
|
||||
Adw.HeaderBar header_bar {
|
||||
[end]
|
||||
MenuButton {
|
||||
icon-name: "open-menu-symbolic";
|
||||
menu-model: primary_menu;
|
||||
}
|
||||
}
|
||||
|
||||
Adw.StatusPage {
|
||||
icon-name: "de.johrpan.musicus";
|
||||
title: _("Welcome to Musicus");
|
||||
description: _("Get started by choosing where to store your music library. Is this your first time using Musicus? If so, create a new empty folder for your library. Musicus will use this location to manage your recordings. You can also select a folder that already contains a music library created by Musicus.");
|
||||
child: Gtk.Button choose_library_button {
|
||||
styles ["suggested-action", "pill"]
|
||||
halign: center;
|
||||
label: _("Choose library folder");
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
menu primary_menu {
|
||||
item {
|
||||
label: _("_Preferences");
|
||||
action: "app.preferences";
|
||||
}
|
||||
item {
|
||||
label: _("_About Musicus");
|
||||
action: "app.about";
|
||||
}
|
||||
}
|
||||
|
|
@ -2,35 +2,9 @@ using Gtk 4.0;
|
|||
using Adw 1;
|
||||
|
||||
template $MusicusWindow : Adw.ApplicationWindow {
|
||||
default-width: 600;
|
||||
default-height: 300;
|
||||
title: _("Musicus");
|
||||
default-width: 800;
|
||||
default-height: 600;
|
||||
|
||||
Box {
|
||||
orientation: vertical;
|
||||
|
||||
HeaderBar header_bar {
|
||||
[end]
|
||||
MenuButton {
|
||||
icon-name: "open-menu-symbolic";
|
||||
menu-model: primary_menu;
|
||||
}
|
||||
}
|
||||
|
||||
Label label {
|
||||
label: _("Hello, World!");
|
||||
vexpand: true;
|
||||
styles ["title-1"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
menu primary_menu {
|
||||
item {
|
||||
label: _("_Preferences");
|
||||
action: "app.preferences";
|
||||
}
|
||||
item {
|
||||
label: _("_About Musicus");
|
||||
action: "app.about";
|
||||
}
|
||||
Adw.NavigationView navigation_view {}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue