place ui code in own directory

This commit is contained in:
Erica Z 2024-10-13 09:41:01 +00:00
parent 94107f9e60
commit 4256778e95
9 changed files with 21 additions and 21 deletions

View file

@ -21,7 +21,7 @@ public class Application : Adw.Application {
public override void activate () {
base.activate ();
// if this.active_window not null, this isnt the primary instance
var win = this.active_window ?? new Window (this);
var win = this.active_window ?? new Ui.Window (this);
win.present ();
}

View file

@ -3,8 +3,8 @@
<gresource prefix="/eu/callcc/audrey">
<file>audrey.css</file>
<file preprocess="xml-stripblanks">gtk/help-overlay.ui</file>
<file preprocess="xml-stripblanks">play_queue.ui</file>
<file preprocess="xml-stripblanks">setup.ui</file>
<file preprocess="xml-stripblanks">window.ui</file>
<file preprocess="xml-stripblanks">ui/play_queue.ui</file>
<file preprocess="xml-stripblanks">ui/setup.ui</file>
<file preprocess="xml-stripblanks">ui/window.ui</file>
</gresource>
</gresources>

View file

@ -3,10 +3,10 @@ audrey_sources = [
'application.vala',
'main.vala',
'mpris.vala',
'play_queue.vala',
'playbin.vala',
'setup.vala',
'window.vala',
'ui/play_queue.vala',
'ui/setup.vala',
'ui/window.vala',
]
audrey_deps = [
@ -22,9 +22,9 @@ audrey_deps = [
blueprints = custom_target('blueprints',
input: files(
'play_queue.blp',
'setup.blp',
'window.blp',
'ui/play_queue.blp',
'ui/setup.blp',
'ui/window.blp',
),
output: [
'play_queue.ui',

View file

@ -1,7 +1,7 @@
using Gtk 4.0;
using Adw 1;
template $PlayQueue: Adw.NavigationPage {
template $UiPlayQueue: Adw.NavigationPage {
title: _("Play queue");
Adw.ToolbarView {

View file

@ -1,5 +1,5 @@
[GtkTemplate (ui = "/eu/callcc/audrey/play_queue.ui")]
public class PlayQueue : Adw.NavigationPage {
[GtkTemplate (ui = "/eu/callcc/audrey/ui/play_queue.ui")]
public class Ui.PlayQueue : Adw.NavigationPage {
public ListStore songs { get; private set; }
public uint selected_index { get; set; }

View file

@ -1,7 +1,7 @@
using Gtk 4.0;
using Adw 1;
template $Setup: Adw.PreferencesDialog {
template $UiSetup: Adw.PreferencesDialog {
title: _("Setup");
Adw.ToolbarView {

View file

@ -1,8 +1,8 @@
[CCode (cname = "sqlite3_randomness")]
public extern void randomness (int N, void *P);
[GtkTemplate (ui = "/eu/callcc/audrey/setup.ui")]
public class Setup : Adw.PreferencesDialog {
[GtkTemplate (ui = "/eu/callcc/audrey/ui/setup.ui")]
public class Ui.Setup : Adw.PreferencesDialog {
public string status { get; private set; default = _("Not connected"); }
public bool authn_can_edit { get; private set; default = true; }

View file

@ -1,7 +1,7 @@
using Gtk 4.0;
using Adw 1;
template $Window: Adw.ApplicationWindow {
template $UiWindow: Adw.ApplicationWindow {
title: _("audrey");
default-width: 800;
default-height: 600;
@ -81,7 +81,7 @@ paintable: bind template.playing_cover_art;
name: "play_queue";
title: _("Play queue");
child: $PlayQueue play_queue {};
child: $UiPlayQueue play_queue {};
}
}
}

View file

@ -1,10 +1,10 @@
[GtkTemplate (ui = "/eu/callcc/audrey/window.ui")]
class Window : Adw.ApplicationWindow {
[GtkTemplate (ui = "/eu/callcc/audrey/ui/window.ui")]
class Ui.Window : Adw.ApplicationWindow {
[GtkChild] private unowned Gtk.ListBox sidebar;
[GtkChild] private unowned Gtk.ListBoxRow sidebar_play_queue;
[GtkChild] private unowned Gtk.Stack stack;
[GtkChild] public unowned PlayQueue play_queue;
[GtkChild] public unowned Ui.PlayQueue play_queue;
[GtkChild] public unowned Adw.ButtonRow shuffle_all_tracks;
private Setup setup;