1
0
mirror of https://gitlab.cvh-server.de/skrause/flashcards.git synced 2025-12-12 10:01:37 +01:00

replace deprecated classes, update code, fix errors, add missing stuff

This commit is contained in:
2025-02-05 20:52:07 +01:00
parent 81e353b449
commit b4d8f9d096
31 changed files with 767 additions and 183 deletions

View File

@@ -0,0 +1,20 @@
using Gtk 4.0;
using Adw 1;
template $FlashcardsCreateCategoryDialog : Adw.AlertDialog {
heading: "Create a new category";
default-response: "add";
close-response: "cancel";
responses [
cancel: _("Cancel"),
add: _("Add") suggested,
]
response => $on_response();
Adw.EntryRow entry {
title: "Category name";
styles [
"card",
]
}
}

8
resources/ui/meson.build Normal file
View File

@@ -0,0 +1,8 @@
blueprints = custom_target('blueprints',
input: files(
'window.blp',
'create-category.blp'
),
output: '.',
command: [find_program('blueprint-compiler'), 'batch-compile', '@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@'],
)

100
resources/ui/window.blp Normal file
View File

@@ -0,0 +1,100 @@
using Gtk 4.0;
using Adw 1;
template $FlashcardsAppWindow : Adw.ApplicationWindow {
title: _("Flashcards");
Adw.Breakpoint {
condition ( "max-width: 400sp" )
setters {
split_view.collapsed: true;
}
}
Adw.NavigationSplitView split_view {
[sidebar]
Adw.NavigationPage sidebar{
title: _("Categories");
Box {
orientation: vertical;
hexpand: true;
width-request: 360;
Adw.HeaderBar {
[end]
Gtk.Button {
icon-name: "list-add-symbolic";
clicked => $on_add_category();
}
}
Adw.Clamp {
hexpand: true;
ListBox topics {
hexpand: true;
selection-mode: single;
margin-top: 12;
margin-bottom: 12;
margin-start: 12;
margin-end: 12;
row-selected => $on_category_selected();
styles [
"boxed-list",
]
}
}
}
}
[content]
Adw.NavigationPage content {
title: _("Flashcards");
Box {
orientation: vertical;
hexpand: true;
Adw.HeaderBar {
[end]
Gtk.MenuButton {
icon-name: "open-menu-symbolic";
menu-model: primary_menu;
}
}
Adw.Clamp {
hexpand: true;
child: Adw.Bin {
margin-top: 12;
margin-bottom: 12;
margin-start: 12;
margin-end: 12;
styles [
"card",
]
child: Label {
margin-top: 24;
margin-bottom: 24;
margin-start: 24;
margin-end: 24;
wrap: true;
label: "Wie viel Grad hat ein Kreis?";
};
};
}
}
}
}
}
menu primary_menu {
section {
item {
label: _("About Flashcards");
action: "app.about";
}
}
}