mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-25 20:37:24 +02:00
Expose AlbumEditor in primary menu
This commit is contained in:
parent
c50ef90e9b
commit
45338c1bf9
3 changed files with 67 additions and 35 deletions
|
|
@ -50,23 +50,32 @@ template $MusicusEmptyPage: Adw.NavigationPage {
|
|||
}
|
||||
|
||||
menu primary_menu {
|
||||
item {
|
||||
label: _("_Import music");
|
||||
action: "win.import";
|
||||
section {
|
||||
item {
|
||||
label: _("_Import music");
|
||||
action: "win.import";
|
||||
}
|
||||
|
||||
item {
|
||||
label: _("_Create album");
|
||||
action: "win.create-album";
|
||||
}
|
||||
|
||||
item {
|
||||
label: _("_Library manager");
|
||||
action: "win.library";
|
||||
}
|
||||
}
|
||||
|
||||
item {
|
||||
label: _("_Library manager");
|
||||
action: "win.library";
|
||||
}
|
||||
section {
|
||||
item {
|
||||
label: _("_Preferences");
|
||||
action: "win.preferences";
|
||||
}
|
||||
|
||||
item {
|
||||
label: _("_Preferences");
|
||||
action: "win.preferences";
|
||||
}
|
||||
|
||||
item {
|
||||
label: _("_About Musicus");
|
||||
action: "app.about";
|
||||
item {
|
||||
label: _("_About Musicus");
|
||||
action: "app.about";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,14 +73,14 @@ template $MusicusSearchPage: Adw.NavigationPage {
|
|||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Gtk.SearchEntry search_entry {
|
||||
placeholder-text: _("Enter composers, performers, works…");
|
||||
margin-top: 24;
|
||||
activate => $select() swapped;
|
||||
|
||||
styles [
|
||||
"rounded-entry"
|
||||
"rounded-entry",
|
||||
]
|
||||
}
|
||||
|
||||
|
|
@ -264,24 +264,33 @@ template $MusicusSearchPage: Adw.NavigationPage {
|
|||
}
|
||||
|
||||
menu primary_menu {
|
||||
item {
|
||||
label: _("_Import music");
|
||||
action: "win.import";
|
||||
section {
|
||||
item {
|
||||
label: _("_Import music");
|
||||
action: "win.import";
|
||||
}
|
||||
|
||||
item {
|
||||
label: _("_Create album");
|
||||
action: "win.create-album";
|
||||
}
|
||||
|
||||
item {
|
||||
label: _("_Library manager");
|
||||
action: "win.library";
|
||||
}
|
||||
}
|
||||
|
||||
item {
|
||||
label: _("_Library manager");
|
||||
action: "win.library";
|
||||
}
|
||||
section {
|
||||
item {
|
||||
label: _("_Preferences");
|
||||
action: "win.preferences";
|
||||
}
|
||||
|
||||
item {
|
||||
label: _("_Preferences");
|
||||
action: "win.preferences";
|
||||
}
|
||||
|
||||
item {
|
||||
label: _("_About Musicus");
|
||||
action: "app.about";
|
||||
item {
|
||||
label: _("_About Musicus");
|
||||
action: "app.about";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ use gtk::{gio, glib, glib::clone};
|
|||
use crate::{
|
||||
album_page::AlbumPage,
|
||||
config,
|
||||
editor::tracks::TracksEditor,
|
||||
editor::{album::AlbumEditor, tracks::TracksEditor},
|
||||
empty_page::EmptyPage,
|
||||
library::{Library, LibraryQuery},
|
||||
library_manager::LibraryManager,
|
||||
|
|
@ -88,6 +88,16 @@ mod imp {
|
|||
})
|
||||
.build();
|
||||
|
||||
let obj = self.obj().to_owned();
|
||||
let create_album_action = gio::ActionEntry::builder("create-album")
|
||||
.activate(move |_, _, _| {
|
||||
if let Some(library) = &*obj.imp().library.borrow() {
|
||||
let editor = AlbumEditor::new(&obj.imp().navigation_view, library, None);
|
||||
obj.imp().navigation_view.push(&editor);
|
||||
}
|
||||
})
|
||||
.build();
|
||||
|
||||
let obj = self.obj().to_owned();
|
||||
let library_action = gio::ActionEntry::builder("library")
|
||||
.activate(move |_, _, _| {
|
||||
|
|
@ -109,8 +119,12 @@ mod imp {
|
|||
})
|
||||
.build();
|
||||
|
||||
self.obj()
|
||||
.add_action_entries([import_action, library_action, preferences_action]);
|
||||
self.obj().add_action_entries([
|
||||
import_action,
|
||||
create_album_action,
|
||||
library_action,
|
||||
preferences_action,
|
||||
]);
|
||||
|
||||
let player_bar = PlayerBar::new(&self.player);
|
||||
self.player_bar_revealer.set_child(Some(&player_bar));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue