mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-26 03:47:23 +01:00
editor: Use AdwButtonRow
This commit is contained in:
parent
510061b3b0
commit
7d2356c8f2
13 changed files with 61 additions and 50 deletions
|
|
@ -118,11 +118,4 @@
|
|||
.selector-list>row {
|
||||
padding: 6px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
button.save {
|
||||
min-height: 48px;
|
||||
font-weight: 700;
|
||||
font-size: 11pt;
|
||||
color: var(--accent-color);
|
||||
}
|
||||
|
|
@ -26,15 +26,18 @@ template $MusicusEnsembleEditor: Adw.NavigationPage {
|
|||
margin-top: 12;
|
||||
}
|
||||
|
||||
Gtk.Button save_button {
|
||||
Gtk.ListBox {
|
||||
selection-mode: none;
|
||||
margin-top: 24;
|
||||
label: _("Create ensemble");
|
||||
clicked => $save() swapped;
|
||||
|
||||
styles [
|
||||
"card",
|
||||
"save"
|
||||
"boxed-list"
|
||||
]
|
||||
|
||||
Adw.ButtonRow save_row {
|
||||
title: _("Create ensemble");
|
||||
activated => $save() swapped;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,15 +26,18 @@ template $MusicusInstrumentEditor: Adw.NavigationPage {
|
|||
margin-top: 12;
|
||||
}
|
||||
|
||||
Gtk.Button save_button {
|
||||
Gtk.ListBox {
|
||||
selection-mode: none;
|
||||
margin-top: 24;
|
||||
label: _("Create instrument");
|
||||
clicked => $save() swapped;
|
||||
|
||||
styles [
|
||||
"card",
|
||||
"save"
|
||||
"boxed-list"
|
||||
]
|
||||
|
||||
Adw.ButtonRow save_row {
|
||||
title: _("Create instrument");
|
||||
activated => $save() swapped;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,15 +26,18 @@ template $MusicusPersonEditor: Adw.NavigationPage {
|
|||
margin-top: 12;
|
||||
}
|
||||
|
||||
Gtk.Button save_button {
|
||||
Gtk.ListBox {
|
||||
selection-mode: none;
|
||||
margin-top: 24;
|
||||
label: _("Create person");
|
||||
clicked => $save() swapped;
|
||||
|
||||
styles [
|
||||
"card",
|
||||
"save"
|
||||
"boxed-list"
|
||||
]
|
||||
|
||||
Adw.ButtonRow save_row {
|
||||
title: _("Create person");
|
||||
activated => $save() swapped;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,15 +124,18 @@ template $MusicusRecordingEditor: Adw.NavigationPage {
|
|||
}
|
||||
}
|
||||
|
||||
Gtk.Button save_button {
|
||||
Gtk.ListBox {
|
||||
selection-mode: none;
|
||||
margin-top: 24;
|
||||
label: _("Create recording");
|
||||
clicked => $save() swapped;
|
||||
|
||||
styles [
|
||||
"card",
|
||||
"save"
|
||||
"boxed-list"
|
||||
]
|
||||
|
||||
Adw.ButtonRow save_row {
|
||||
title: _("Create recording");
|
||||
activated => $save() swapped;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,15 +26,18 @@ template $MusicusRoleEditor: Adw.NavigationPage {
|
|||
margin-top: 12;
|
||||
}
|
||||
|
||||
Gtk.Button save_button {
|
||||
Gtk.ListBox {
|
||||
selection-mode: none;
|
||||
margin-top: 24;
|
||||
label: _("Create role");
|
||||
clicked => $save() swapped;
|
||||
|
||||
styles [
|
||||
"card",
|
||||
"save"
|
||||
"boxed-list"
|
||||
]
|
||||
|
||||
Adw.ButtonRow save_row {
|
||||
title: _("Create role");
|
||||
activated => $save() swapped;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,15 +125,18 @@ template $MusicusWorkEditor: Adw.NavigationPage {
|
|||
}
|
||||
}
|
||||
|
||||
Gtk.Button save_button {
|
||||
Gtk.ListBox {
|
||||
selection-mode: none;
|
||||
margin-top: 24;
|
||||
label: _("Create work");
|
||||
clicked => $save() swapped;
|
||||
|
||||
styles [
|
||||
"card",
|
||||
"save"
|
||||
"boxed-list"
|
||||
]
|
||||
|
||||
Adw.ButtonRow save_row {
|
||||
title: _("Create work");
|
||||
activated => $save() swapped;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ mod imp {
|
|||
#[template_child]
|
||||
pub name_editor: TemplateChild<MusicusTranslationEditor>,
|
||||
#[template_child]
|
||||
pub save_button: TemplateChild<gtk::Button>,
|
||||
pub save_row: TemplateChild<adw::ButtonRow>,
|
||||
}
|
||||
|
||||
#[glib::object_subclass]
|
||||
|
|
@ -78,7 +78,7 @@ impl MusicusEnsembleEditor {
|
|||
obj.imp().library.set(library.to_owned()).unwrap();
|
||||
|
||||
if let Some(ensemble) = ensemble {
|
||||
obj.imp().save_button.set_label(&gettext("Save changes"));
|
||||
obj.imp().save_row.set_title(&gettext("Save changes"));
|
||||
obj.imp().ensemble_id.set(ensemble.ensemble_id.clone()).unwrap();
|
||||
obj.imp().name_editor.set_translation(&ensemble.name);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ mod imp {
|
|||
#[template_child]
|
||||
pub name_editor: TemplateChild<MusicusTranslationEditor>,
|
||||
#[template_child]
|
||||
pub save_button: TemplateChild<gtk::Button>,
|
||||
pub save_row: TemplateChild<adw::ButtonRow>,
|
||||
}
|
||||
|
||||
#[glib::object_subclass]
|
||||
|
|
@ -78,7 +78,7 @@ impl MusicusInstrumentEditor {
|
|||
obj.imp().library.set(library.to_owned()).unwrap();
|
||||
|
||||
if let Some(instrument) = instrument {
|
||||
obj.imp().save_button.set_label(&gettext("Save changes"));
|
||||
obj.imp().save_row.set_title(&gettext("Save changes"));
|
||||
obj.imp().instrument_id.set(instrument.instrument_id.clone()).unwrap();
|
||||
obj.imp().name_editor.set_translation(&instrument.name);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ mod imp {
|
|||
#[template_child]
|
||||
pub name_editor: TemplateChild<MusicusTranslationEditor>,
|
||||
#[template_child]
|
||||
pub save_button: TemplateChild<gtk::Button>,
|
||||
pub save_row: TemplateChild<adw::ButtonRow>,
|
||||
}
|
||||
|
||||
#[glib::object_subclass]
|
||||
|
|
@ -78,7 +78,7 @@ impl MusicusPersonEditor {
|
|||
obj.imp().library.set(library.to_owned()).unwrap();
|
||||
|
||||
if let Some(person) = person {
|
||||
obj.imp().save_button.set_label(&gettext("Save changes"));
|
||||
obj.imp().save_row.set_title(&gettext("Save changes"));
|
||||
obj.imp().person_id.set(person.person_id.clone()).unwrap();
|
||||
obj.imp().name_editor.set_translation(&person.name);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ mod imp {
|
|||
#[template_child]
|
||||
pub select_ensemble_box: TemplateChild<gtk::Box>,
|
||||
#[template_child]
|
||||
pub save_button: TemplateChild<gtk::Button>,
|
||||
pub save_row: TemplateChild<adw::ButtonRow>,
|
||||
}
|
||||
|
||||
#[glib::object_subclass]
|
||||
|
|
@ -195,7 +195,7 @@ impl MusicusRecordingEditor {
|
|||
.build();
|
||||
|
||||
if let Some(recording) = recording {
|
||||
obj.imp().save_button.set_label(&gettext("Save changes"));
|
||||
obj.imp().save_row.set_title(&gettext("Save changes"));
|
||||
obj.imp()
|
||||
.recording_id
|
||||
.set(recording.recording_id.clone())
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ mod imp {
|
|||
#[template_child]
|
||||
pub name_editor: TemplateChild<MusicusTranslationEditor>,
|
||||
#[template_child]
|
||||
pub save_button: TemplateChild<gtk::Button>,
|
||||
pub save_row: TemplateChild<adw::ButtonRow>,
|
||||
}
|
||||
|
||||
#[glib::object_subclass]
|
||||
|
|
@ -76,7 +76,7 @@ impl MusicusRoleEditor {
|
|||
obj.imp().library.set(library.to_owned()).unwrap();
|
||||
|
||||
if let Some(role) = role {
|
||||
obj.imp().save_button.set_label(&gettext("Save changes"));
|
||||
obj.imp().save_row.set_title(&gettext("Save changes"));
|
||||
obj.imp().role_id.set(role.role_id.clone()).unwrap();
|
||||
obj.imp().name_editor.set_translation(&role.name);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ mod imp {
|
|||
#[template_child]
|
||||
pub select_instrument_box: TemplateChild<gtk::Box>,
|
||||
#[template_child]
|
||||
pub save_button: TemplateChild<gtk::Button>,
|
||||
pub save_row: TemplateChild<adw::ButtonRow>,
|
||||
}
|
||||
|
||||
#[glib::object_subclass]
|
||||
|
|
@ -176,12 +176,12 @@ impl MusicusWorkEditor {
|
|||
|
||||
if is_part_editor {
|
||||
obj.set_title(&gettext("Work part"));
|
||||
obj.imp().save_button.set_label(&gettext("Add work part"));
|
||||
obj.imp().save_row.set_title(&gettext("Add work part"));
|
||||
obj.imp().is_part_editor.set(true);
|
||||
}
|
||||
|
||||
if let Some(work) = work {
|
||||
obj.imp().save_button.set_label(&gettext("Save changes"));
|
||||
obj.imp().save_row.set_title(&gettext("Save changes"));
|
||||
obj.imp().work_id.set(work.work_id.clone()).unwrap();
|
||||
|
||||
obj.imp().name_editor.set_translation(&work.name);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue