mirror of
https://gitlab.cvh-server.de/skrause/flashcards.git
synced 2025-12-12 09:01:37 +01:00
remove en, update ui, some minor changes
This commit is contained in:
@@ -23,7 +23,7 @@ flashcards_create_category_dialog_init(FlashcardsCreateCategoryDialog *self)
|
||||
}
|
||||
|
||||
static void
|
||||
on_response(AdwAlertDialog *dialog,
|
||||
on_response(__attribute__((unused)) AdwAlertDialog *dialog,
|
||||
gchar *response,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
||||
@@ -17,6 +17,7 @@ struct _FlashcardsAppWindow
|
||||
|
||||
GArray *categories;
|
||||
|
||||
AdwWindowTitle *title;
|
||||
AdwNavigationSplitView *split_view;
|
||||
AdwNavigationPage *sidebar;
|
||||
AdwNavigationPage *content;
|
||||
@@ -29,7 +30,7 @@ struct _FlashcardsAppWindow
|
||||
G_DEFINE_TYPE(FlashcardsAppWindow, flashcards_app_window, ADW_TYPE_APPLICATION_WINDOW);
|
||||
|
||||
static void
|
||||
on_category_selected(GtkListBox *box, GtkListBoxRow *row, gpointer user_data)
|
||||
on_category_selected(__attribute__((unused)) GtkListBox *box, GtkListBoxRow *row, gpointer user_data)
|
||||
{
|
||||
FlashcardsAppWindow *win;
|
||||
int id;
|
||||
@@ -38,16 +39,19 @@ on_category_selected(GtkListBox *box, GtkListBoxRow *row, gpointer user_data)
|
||||
{
|
||||
return;
|
||||
}
|
||||
printf("Test\n");
|
||||
win = user_data;
|
||||
adw_navigation_split_view_set_show_content(ADW_NAVIGATION_SPLIT_VIEW(win->split_view), TRUE);
|
||||
|
||||
id = gtk_list_box_row_get_index(gtk_list_box_get_selected_row(win->topics));
|
||||
printf("%d\n", id);
|
||||
|
||||
char test[2];
|
||||
sprintf(test, "%d", id);
|
||||
adw_window_title_set_subtitle(ADW_WINDOW_TITLE(win->title), test);
|
||||
}
|
||||
|
||||
static void
|
||||
on_add_category(GtkButton *self,
|
||||
on_add_category(__attribute__((unused)) GtkButton *self,
|
||||
gpointer user_data)
|
||||
{
|
||||
FlashcardsCreateCategoryDialog *dialog;
|
||||
@@ -56,6 +60,15 @@ on_add_category(GtkButton *self,
|
||||
adw_dialog_present(ADW_DIALOG(dialog), GTK_WIDGET(user_data));
|
||||
}
|
||||
|
||||
static void
|
||||
on_delete_category(__attribute__((unused)) GtkButton *self,
|
||||
gpointer user_data)
|
||||
{
|
||||
FlashcardsAppWindow *win = user_data;
|
||||
|
||||
printf("Delete category\n");
|
||||
}
|
||||
|
||||
void flashcards_app_window_test(FlashcardsAppWindow *win, const gchar *test)
|
||||
{
|
||||
GtkWidget *child;
|
||||
@@ -81,7 +94,7 @@ flashcards_app_window_init(FlashcardsAppWindow *win)
|
||||
|
||||
categories = win->categories;
|
||||
|
||||
for (int i = 0; i < categories->len; i++)
|
||||
for (guint i = 0; i < categories->len; i++)
|
||||
{
|
||||
GtkWidget *child;
|
||||
category c;
|
||||
@@ -101,6 +114,7 @@ flashcards_app_window_class_init(FlashcardsAppWindowClass *class)
|
||||
{
|
||||
gtk_widget_class_set_template_from_resource(GTK_WIDGET_CLASS(class), "/li/sopht/flashcards/window.ui");
|
||||
|
||||
gtk_widget_class_bind_template_child(GTK_WIDGET_CLASS(class), FlashcardsAppWindow, title);
|
||||
gtk_widget_class_bind_template_child(GTK_WIDGET_CLASS(class), FlashcardsAppWindow, split_view);
|
||||
gtk_widget_class_bind_template_child(GTK_WIDGET_CLASS(class), FlashcardsAppWindow, sidebar);
|
||||
gtk_widget_class_bind_template_child(GTK_WIDGET_CLASS(class), FlashcardsAppWindow, content);
|
||||
@@ -109,6 +123,7 @@ flashcards_app_window_class_init(FlashcardsAppWindowClass *class)
|
||||
|
||||
gtk_widget_class_bind_template_callback(GTK_WIDGET_CLASS(class), on_category_selected);
|
||||
gtk_widget_class_bind_template_callback(GTK_WIDGET_CLASS(class), on_add_category);
|
||||
gtk_widget_class_bind_template_callback(GTK_WIDGET_CLASS(class), on_delete_category);
|
||||
}
|
||||
|
||||
FlashcardsAppWindow *
|
||||
|
||||
Reference in New Issue
Block a user