editor: Fix popover parents

This commit is contained in:
Elias Projahn 2025-03-01 11:13:29 +01:00
parent 5956b7ff15
commit 757022393f
6 changed files with 88 additions and 74 deletions

View file

@ -18,7 +18,7 @@ template $MusicusAlbumEditor: Adw.NavigationPage {
margin-top: 24; margin-top: 24;
styles [ styles [
"heading" "heading",
] ]
} }
@ -32,17 +32,19 @@ template $MusicusAlbumEditor: Adw.NavigationPage {
margin-top: 24; margin-top: 24;
styles [ styles [
"heading" "heading",
] ]
} }
Gtk.Box recordings_box {
Gtk.ListBox recordings_list { Gtk.ListBox recordings_list {
selection-mode: none; selection-mode: none;
margin-top: 12; margin-top: 12;
margin-bottom: 24; margin-bottom: 24;
hexpand: true;
styles [ styles [
"boxed-list" "boxed-list",
] ]
Adw.ButtonRow { Adw.ButtonRow {
@ -52,13 +54,14 @@ template $MusicusAlbumEditor: Adw.NavigationPage {
activated => $select_recording() swapped; activated => $select_recording() swapped;
} }
} }
}
Gtk.ListBox { Gtk.ListBox {
selection-mode: none; selection-mode: none;
margin-top: 24; margin-top: 24;
styles [ styles [
"boxed-list" "boxed-list",
] ]
Adw.ButtonRow save_row { Adw.ButtonRow save_row {

View file

@ -72,9 +72,11 @@ template $MusicusRecordingEditor: Adw.NavigationPage {
] ]
} }
Gtk.Box performers_box {
Gtk.ListBox performer_list { Gtk.ListBox performer_list {
selection-mode: none; selection-mode: none;
margin-top: 12; margin-top: 12;
hexpand: true;
styles [ styles [
"boxed-list", "boxed-list",
@ -87,6 +89,7 @@ template $MusicusRecordingEditor: Adw.NavigationPage {
activated => $select_person() swapped; activated => $select_person() swapped;
} }
} }
}
Gtk.Label { Gtk.Label {
label: _("Ensembles"); label: _("Ensembles");
@ -98,9 +101,11 @@ template $MusicusRecordingEditor: Adw.NavigationPage {
] ]
} }
Gtk.Box ensembles_box {
Gtk.ListBox ensemble_list { Gtk.ListBox ensemble_list {
selection-mode: none; selection-mode: none;
margin-top: 12; margin-top: 12;
hexpand: true;
styles [ styles [
"boxed-list", "boxed-list",
@ -113,6 +118,7 @@ template $MusicusRecordingEditor: Adw.NavigationPage {
activated => $select_ensemble() swapped; activated => $select_ensemble() swapped;
} }
} }
}
Gtk.ListBox { Gtk.ListBox {
selection-mode: none; selection-mode: none;

View file

@ -40,9 +40,11 @@ template $MusicusWorkEditor: Adw.NavigationPage {
] ]
} }
Gtk.Box composers_box {
Gtk.ListBox composer_list { Gtk.ListBox composer_list {
selection-mode: none; selection-mode: none;
margin-top: 12; margin-top: 12;
hexpand: true;
styles [ styles [
"boxed-list", "boxed-list",
@ -55,6 +57,7 @@ template $MusicusWorkEditor: Adw.NavigationPage {
activated => $add_person() swapped; activated => $add_person() swapped;
} }
} }
}
Gtk.Label { Gtk.Label {
label: _("Structure"); label: _("Structure");
@ -92,10 +95,11 @@ template $MusicusWorkEditor: Adw.NavigationPage {
] ]
} }
Gtk.Box instruments_box {
Gtk.ListBox instrument_list { Gtk.ListBox instrument_list {
selection-mode: none; selection-mode: none;
margin-top: 12; margin-top: 12;
margin-bottom: 24; hexpand: true;
styles [ styles [
"boxed-list", "boxed-list",
@ -108,6 +112,7 @@ template $MusicusWorkEditor: Adw.NavigationPage {
activated => $add_instrument() swapped; activated => $add_instrument() swapped;
} }
} }
}
Gtk.ListBox { Gtk.ListBox {
selection-mode: none; selection-mode: none;

View file

@ -32,9 +32,9 @@ mod imp {
#[template_child] #[template_child]
pub name_editor: TemplateChild<TranslationEditor>, pub name_editor: TemplateChild<TranslationEditor>,
#[template_child] #[template_child]
pub recordings_list: TemplateChild<gtk::ListBox>, pub recordings_box: TemplateChild<gtk::Box>,
#[template_child] #[template_child]
pub select_recording_box: TemplateChild<gtk::Box>, pub recordings_list: TemplateChild<gtk::ListBox>,
#[template_child] #[template_child]
pub save_row: TemplateChild<adw::ButtonRow>, pub save_row: TemplateChild<adw::ButtonRow>,
} }
@ -93,7 +93,7 @@ mod imp {
obj.navigation().push(&editor); obj.navigation().push(&editor);
}); });
self.select_recording_box.append(&recordings_popover); self.recordings_box.append(&recordings_popover);
self.recordings_popover.set(recordings_popover).unwrap(); self.recordings_popover.set(recordings_popover).unwrap();
} }
} }

View file

@ -49,14 +49,14 @@ mod imp {
#[template_child] #[template_child]
pub year_row: TemplateChild<adw::SpinRow>, pub year_row: TemplateChild<adw::SpinRow>,
#[template_child] #[template_child]
pub performers_box: TemplateChild<gtk::Box>,
#[template_child]
pub performer_list: TemplateChild<gtk::ListBox>, pub performer_list: TemplateChild<gtk::ListBox>,
#[template_child] #[template_child]
pub select_person_box: TemplateChild<gtk::Box>, pub ensembles_box: TemplateChild<gtk::Box>,
#[template_child] #[template_child]
pub ensemble_list: TemplateChild<gtk::ListBox>, pub ensemble_list: TemplateChild<gtk::ListBox>,
#[template_child] #[template_child]
pub select_ensemble_box: TemplateChild<gtk::Box>,
#[template_child]
pub save_row: TemplateChild<adw::ButtonRow>, pub save_row: TemplateChild<adw::ButtonRow>,
} }
@ -140,7 +140,7 @@ mod imp {
obj.navigation().push(&editor); obj.navigation().push(&editor);
}); });
self.select_person_box.append(&persons_popover); self.performers_box.append(&persons_popover);
self.persons_popover.set(persons_popover).unwrap(); self.persons_popover.set(persons_popover).unwrap();
let ensembles_popover = EnsembleSelectorPopover::new(self.library.get().unwrap()); let ensembles_popover = EnsembleSelectorPopover::new(self.library.get().unwrap());
@ -165,7 +165,7 @@ mod imp {
obj.navigation().push(&editor); obj.navigation().push(&editor);
}); });
self.select_ensemble_box.append(&ensembles_popover); self.ensembles_box.append(&ensembles_popover);
self.ensembles_popover.set(ensembles_popover).unwrap(); self.ensembles_popover.set(ensembles_popover).unwrap();
} }
} }

View file

@ -50,15 +50,15 @@ mod imp {
#[template_child] #[template_child]
pub name_editor: TemplateChild<TranslationEditor>, pub name_editor: TemplateChild<TranslationEditor>,
#[template_child] #[template_child]
pub composer_list: TemplateChild<gtk::ListBox>, pub composers_box: TemplateChild<gtk::Box>,
#[template_child] #[template_child]
pub select_person_box: TemplateChild<gtk::Box>, pub composer_list: TemplateChild<gtk::ListBox>,
#[template_child] #[template_child]
pub part_list: TemplateChild<gtk::ListBox>, pub part_list: TemplateChild<gtk::ListBox>,
#[template_child] #[template_child]
pub instrument_list: TemplateChild<gtk::ListBox>, pub instruments_box: TemplateChild<gtk::Box>,
#[template_child] #[template_child]
pub select_instrument_box: TemplateChild<gtk::Box>, pub instrument_list: TemplateChild<gtk::ListBox>,
#[template_child] #[template_child]
pub save_row: TemplateChild<adw::ButtonRow>, pub save_row: TemplateChild<adw::ButtonRow>,
} }
@ -117,7 +117,7 @@ mod imp {
obj.navigation().push(&editor); obj.navigation().push(&editor);
}); });
self.select_person_box.append(&persons_popover); self.composers_box.append(&persons_popover);
self.persons_popover.set(persons_popover).unwrap(); self.persons_popover.set(persons_popover).unwrap();
let instruments_popover = InstrumentSelectorPopover::new(self.library.get().unwrap()); let instruments_popover = InstrumentSelectorPopover::new(self.library.get().unwrap());
@ -142,7 +142,7 @@ mod imp {
obj.navigation().push(&editor); obj.navigation().push(&editor);
}); });
self.select_instrument_box.append(&instruments_popover); self.instruments_box.append(&instruments_popover);
self.instruments_popover.set(instruments_popover).unwrap(); self.instruments_popover.set(instruments_popover).unwrap();
} }
} }