mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-26 11:47:25 +01:00
Add widgets for translating data
This commit is contained in:
parent
3c8f5b8c31
commit
783d548bc2
10 changed files with 350 additions and 4 deletions
15
data/ui/person_editor.blp
Normal file
15
data/ui/person_editor.blp
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
using Gtk 4.0;
|
||||
using Adw 1;
|
||||
|
||||
template $MusicusPersonEditor : Adw.NavigationPage {
|
||||
title: _("Person");
|
||||
|
||||
Adw.ToolbarView {
|
||||
[top]
|
||||
Adw.HeaderBar header_bar {}
|
||||
|
||||
Adw.Clamp {
|
||||
$MusicusTranslationSection name_section {}
|
||||
}
|
||||
}
|
||||
}
|
||||
59
data/ui/translation_entry.blp
Normal file
59
data/ui/translation_entry.blp
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
using Gtk 4.0;
|
||||
using Adw 1;
|
||||
|
||||
template $MusicusTranslationEntry : Adw.EntryRow {
|
||||
title: _("Translated name");
|
||||
|
||||
Gtk.Button {
|
||||
icon-name: "edit-delete-symbolic";
|
||||
valign: center;
|
||||
clicked => $remove() swapped;
|
||||
styles ["flat"]
|
||||
}
|
||||
|
||||
Gtk.Button {
|
||||
valign: center;
|
||||
clicked => $open_lang_popover() swapped;
|
||||
|
||||
Gtk.Box {
|
||||
spacing: 6;
|
||||
|
||||
Gtk.Label {
|
||||
label: bind lang_entry.text;
|
||||
}
|
||||
|
||||
Gtk.Image {
|
||||
icon-name: "pan-down-symbolic";
|
||||
}
|
||||
|
||||
Gtk.Popover lang_popover {
|
||||
Gtk.Box {
|
||||
orientation: vertical;
|
||||
spacing: 6;
|
||||
margin-start: 6;
|
||||
margin-end: 6;
|
||||
margin-top: 6;
|
||||
margin-bottom: 6;
|
||||
|
||||
Gtk.Label {
|
||||
label: _("Language code");
|
||||
halign: start;
|
||||
styles ["heading"]
|
||||
}
|
||||
|
||||
Gtk.Label {
|
||||
width-request: 200;
|
||||
label: _("Enter an <a href=\"https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes\">ISO 639</a> two-letter language code identifying the language this translation uses.");
|
||||
use-markup: true;
|
||||
wrap: true;
|
||||
max-width-chars: 40;
|
||||
halign: start;
|
||||
styles ["dim-label"]
|
||||
}
|
||||
|
||||
Gtk.Entry lang_entry {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
19
data/ui/translation_section.blp
Normal file
19
data/ui/translation_section.blp
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
using Gtk 4.0;
|
||||
using Adw 1;
|
||||
|
||||
template $MusicusTranslationSection : Adw.PreferencesGroup {
|
||||
title: _("Name");
|
||||
header-suffix: Gtk.Button add_button {
|
||||
styles ["flat"]
|
||||
clicked => $add_translation() swapped;
|
||||
|
||||
Adw.ButtonContent {
|
||||
icon-name: "list-add-symbolic";
|
||||
label: _("Translate");
|
||||
}
|
||||
};
|
||||
|
||||
Adw.EntryRow entry_row {
|
||||
title: _("Name");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue