diff --git a/docs/main.typ b/docs/main.typ index 6a72c61..1c0ddaf 100644 --- a/docs/main.typ +++ b/docs/main.typ @@ -13,55 +13,40 @@ ) = Einleitung -#lorem(100) #pagebreak() = Konzept & Tools -#lorem(100) == SQLite -#lorem(100) == GTK4 -#lorem(100) == Libadwaita -#lorem(100) == Blueprint -#lorem(100) #pagebreak() = Implementierung -#lorem(100) == Datenbank -#lorem(100) == UI -#lorem(100) +=== Layout == Logik -#lorem(100) #pagebreak() = Buildsystem -#lorem(100) #pagebreak() = Flatpak -#lorem(100) #pagebreak() = CI / CD -#lorem(100) == Flatpak -#lorem(100) == Dokumentation -#lorem(100) #pagebreak() = Fazit & Ausblick -#lorem(100) \ No newline at end of file diff --git a/docs/template.typ b/docs/template.typ index c7c69f1..1598c78 100644 --- a/docs/template.typ +++ b/docs/template.typ @@ -1,4 +1,4 @@ -#import "@preview/hydra:0.6.0": hydra +#import "@preview/hydra:0.6.1": hydra #let project(title: "", subtitle: "", authors: (), profs: (), logo: none, body) = { // Basic properties diff --git a/po/de.po b/po/de.po index 655985a..261f1b0 100644 --- a/po/de.po +++ b/po/de.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: flashcards\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-04-04 09:50+0200\n" +"POT-Creation-Date: 2025-07-03 14:15+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -12,7 +12,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: resources/ui/window.blp:5 resources/ui/window.blp:60 -#: resources/ui/window.blp:81 resources/li.sopht.Flashcards.desktop.in:3 +#: resources/ui/window.blp:81 resources/li.sopht.Flashcards.desktop.in:2 #: resources/li.sopht.Flashcards.metainfo.xml.in:7 msgid "Flashcards" msgstr "Karteikarten" @@ -89,18 +89,6 @@ msgstr "Neue Karteikarte erstellen" msgid "Answer" msgstr "Antwort" -#: resources/li.sopht.Flashcards.desktop.in:9 -msgid "GTK;" -msgstr "" - #: resources/li.sopht.Flashcards.metainfo.xml.in:8 msgid "Learn categories with flashcards!" msgstr "Lerne Kategorien mit Karteikarten!" - -#: resources/li.sopht.Flashcards.metainfo.xml.in:10 -msgid "No description" -msgstr "" - -#: resources/li.sopht.Flashcards.metainfo.xml.in:44 -msgid "A caption" -msgstr "" diff --git a/po/flashcards.pot b/po/flashcards.pot index 6132e67..d43d7ba 100644 --- a/po/flashcards.pot +++ b/po/flashcards.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: flashcards\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-04-04 09:50+0200\n" +"POT-Creation-Date: 2025-07-03 14:15+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,7 +18,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: resources/ui/window.blp:5 resources/ui/window.blp:60 -#: resources/ui/window.blp:81 resources/li.sopht.Flashcards.desktop.in:3 +#: resources/ui/window.blp:81 resources/li.sopht.Flashcards.desktop.in:2 #: resources/li.sopht.Flashcards.metainfo.xml.in:7 msgid "Flashcards" msgstr "" @@ -95,18 +95,6 @@ msgstr "" msgid "Answer" msgstr "" -#: resources/li.sopht.Flashcards.desktop.in:9 -msgid "GTK;" -msgstr "" - #: resources/li.sopht.Flashcards.metainfo.xml.in:8 msgid "Learn categories with flashcards!" msgstr "" - -#: resources/li.sopht.Flashcards.metainfo.xml.in:10 -msgid "No description" -msgstr "" - -#: resources/li.sopht.Flashcards.metainfo.xml.in:44 -msgid "A caption" -msgstr "" diff --git a/resources/flashcards.gresource.xml b/resources/flashcards.gresource.xml index 11819f5..44acd81 100644 --- a/resources/flashcards.gresource.xml +++ b/resources/flashcards.gresource.xml @@ -7,6 +7,8 @@ li.sopht.Flashcards.metainfo.xml - icons/hicolor/scalable/actions/add-card-symbolic.svg + icons/hicolor/scalable/actions/add-symbolic.svg + icons/hicolor/scalable/actions/delete-symbolic.svg + icons/hicolor/scalable/actions/category-symbolic.svg \ No newline at end of file diff --git a/resources/icons/hicolor/scalable/actions/add-card-symbolic.svg b/resources/icons/hicolor/scalable/actions/add-card-symbolic.svg deleted file mode 100644 index e87b95d..0000000 --- a/resources/icons/hicolor/scalable/actions/add-card-symbolic.svg +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/resources/icons/hicolor/scalable/actions/add-symbolic.svg b/resources/icons/hicolor/scalable/actions/add-symbolic.svg new file mode 100644 index 0000000..61849b1 --- /dev/null +++ b/resources/icons/hicolor/scalable/actions/add-symbolic.svg @@ -0,0 +1,2 @@ + + diff --git a/resources/icons/hicolor/scalable/actions/category-symbolic.svg b/resources/icons/hicolor/scalable/actions/category-symbolic.svg new file mode 100644 index 0000000..3221159 --- /dev/null +++ b/resources/icons/hicolor/scalable/actions/category-symbolic.svg @@ -0,0 +1,2 @@ + + diff --git a/resources/icons/hicolor/scalable/actions/delete-symbolic.svg b/resources/icons/hicolor/scalable/actions/delete-symbolic.svg new file mode 100644 index 0000000..b6f8bd1 --- /dev/null +++ b/resources/icons/hicolor/scalable/actions/delete-symbolic.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/resources/icons/meson.build b/resources/icons/meson.build index 3202482..c53abd4 100644 --- a/resources/icons/meson.build +++ b/resources/icons/meson.build @@ -14,7 +14,9 @@ install_data( action_dir = 'hicolor' / 'scalable' / 'actions' action_icons = [ - action_dir / 'add-card-symbolic.svg', + action_dir / 'add-symbolic.svg', + action_dir / 'delete-symbolic.svg', + action_dir / 'category-symbolic.svg', ] install_data( action_icons, diff --git a/resources/li.sopht.Flashcards.desktop.in b/resources/li.sopht.Flashcards.desktop.in index 86e593c..742271c 100644 --- a/resources/li.sopht.Flashcards.desktop.in +++ b/resources/li.sopht.Flashcards.desktop.in @@ -4,6 +4,5 @@ Exec=flashcards Icon=li.sopht.Flashcards Terminal=false Type=Application -Categories=Utility; -Keywords=GTK; +Categories=Utility StartupNotify=true diff --git a/resources/li.sopht.Flashcards.metainfo.xml.in b/resources/li.sopht.Flashcards.metainfo.xml.in index 12be03c..703615b 100644 --- a/resources/li.sopht.Flashcards.metainfo.xml.in +++ b/resources/li.sopht.Flashcards.metainfo.xml.in @@ -6,9 +6,6 @@ Flashcards Learn categories with flashcards! - -

No description

-
Sophie Krause @@ -38,13 +35,6 @@ #993d3d - - - https://example.org/example1.png - A caption - - - diff --git a/resources/ui/window.blp b/resources/ui/window.blp index f1e0a05..6e8993c 100644 --- a/resources/ui/window.blp +++ b/resources/ui/window.blp @@ -24,7 +24,7 @@ template $FlashcardsAppWindow : Adw.ApplicationWindow { Adw.HeaderBar { [start] Gtk.Button { - icon-name: "list-add-symbolic"; + icon-name: "add-symbolic"; clicked => $on_add_category(); tooltip-text: _("Create category"); } @@ -64,14 +64,14 @@ template $FlashcardsAppWindow : Adw.ApplicationWindow { Adw.HeaderBar { [start] Gtk.Button add_card_button { - icon-name: "add-card-symbolic"; + icon-name: "add-symbolic"; clicked => $on_add_card(); tooltip-text: _("Add flashcard"); visible: false; } [start] Gtk.Button delete_card_button { - icon-name: "user-trash-symbolic"; + icon-name: "delete-symbolic"; clicked => $on_delete_card(); tooltip-text: _("Delete flashcard"); visible: false; @@ -86,14 +86,14 @@ template $FlashcardsAppWindow : Adw.ApplicationWindow { Adw.ViewStackPage { child: Adw.StatusPage placeholder_category { title: _("Select a category"); - icon-name: "edit-find-symbolic"; + icon-name: "category-symbolic"; }; } Adw.ViewStackPage { child: Adw.StatusPage placeholder_card { title: _("Add a flashcard"); - icon-name: "list-add-symbolic"; + icon-name: "add-symbolic"; }; } @@ -121,7 +121,7 @@ template $FlashcardsAppWindow : Adw.ApplicationWindow { margin-end: 48; hexpand: true; justify: center; - label: "Wie viele Bäume sind in einem Wald?"; + label: ""; wrap: true; wrap-mode: word_char; } diff --git a/src/flashcardsappwin.c b/src/flashcardsappwin.c index 2bd6387..2ea98e4 100644 --- a/src/flashcardsappwin.c +++ b/src/flashcardsappwin.c @@ -71,10 +71,12 @@ next_card (FlashcardsAppWindow *win) if (win->cards->length <= 0) { adw_view_stack_set_visible_child (win->main_view, win->placeholder_card); + gtk_widget_set_visible (GTK_WIDGET (win->delete_card_button), FALSE); return; } win->current_card = g_queue_pop_head (win->cards); gtk_label_set_label (win->card_title, win->current_card->title); + gtk_widget_set_visible (GTK_WIDGET (win->delete_card_button), TRUE); } static void @@ -82,14 +84,14 @@ load_cards (FlashcardsAppWindow *win, category c) { GArray *card_array = database_load_cards (win->db, c.id); + adw_view_stack_set_visible_child (win->main_view, win->flashcard); + win->cards = g_queue_new (); for (guint i = 0; i < card_array->len; i++) { g_queue_push_tail (win->cards, &g_array_index (card_array, card, i)); - ; } - printf ("Flashcards: %d\n", win->cards->length); next_card (win); } @@ -112,7 +114,6 @@ on_select_category (__attribute__ ((unused)) GtkListBox *box, adw_view_stack_set_visible_child (win->main_view, win->flashcard); gtk_widget_set_visible (GTK_WIDGET (win->add_card_button), TRUE); - gtk_widget_set_visible (GTK_WIDGET (win->delete_card_button), TRUE); gtk_widget_set_visible (GTK_WIDGET (win->delete_category_button), TRUE); load_cards (win, c); @@ -202,7 +203,7 @@ flashcards_app_window_add_card (FlashcardsAppWindow *win, const gchar *title, const gchar *answer) { database_save_card (win->db, win->current_category.id, title, answer); - printf ("Added card\n"); + load_cards (win, win->current_category); } void @@ -217,7 +218,6 @@ static void on_flashcards_app_window_show (GtkWidget *self, gpointer user_data) { FlashcardsAppWindow *win = user_data; - printf ("Show\n"); load_categories (win); gtk_list_box_unselect_all (win->topics);