summaryrefslogtreecommitdiffstats
path: root/gtk/src/main.c
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2019-07-29 10:02:02 -0700
committerJohn Stebbins <[email protected]>2019-07-29 10:02:02 -0700
commit31e7ddd4f1517eee701d77d176e8113285598138 (patch)
tree48f3a2168eef557bfacd8062b206648b089e44aa /gtk/src/main.c
parenta848a396fd3beb1fe8f0610baff8f5dfe838fe4f (diff)
LinGui: disable gtk4 key-press handling for chapter list
gtk4 makes it very difficult to handle key-press in a GtkCellRenderer I will need to rewrite the capter list as a GtkListBox instead of a GtkTreeView to re-enable this. key-press handling is used here to automatically move to the next chapter when finished editing the current
Diffstat (limited to 'gtk/src/main.c')
-rw-r--r--gtk/src/main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gtk/src/main.c b/gtk/src/main.c
index ba51b6546..1acdc4da1 100644
--- a/gtk/src/main.c
+++ b/gtk/src/main.c
@@ -217,7 +217,11 @@ bind_chapter_tree_model(signal_user_data_t *ud)
treestore = gtk_list_store_new(5, G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN);
gtk_tree_view_set_model(treeview, GTK_TREE_MODEL(treestore));
+#if GTK_CHECK_VERSION(3, 90, 0)
+ cell = gtk_cell_renderer_text_new();
+#else
cell = ghb_cell_renderer_text_new();
+#endif
column = gtk_tree_view_column_new_with_attributes(
_("Index"), cell, "text", 0, NULL);
gtk_tree_view_append_column(treeview, GTK_TREE_VIEW_COLUMN(column));
@@ -237,7 +241,10 @@ bind_chapter_tree_model(signal_user_data_t *ud)
_("Title"), cell, "text", 3, "editable", 4, NULL);
gtk_tree_view_append_column(treeview, GTK_TREE_VIEW_COLUMN(column));
+#if GTK_CHECK_VERSION(3, 90, 0)
+#else
g_signal_connect(cell, "key-press-event", chapter_keypress_cb, ud);
+#endif
g_signal_connect(cell, "edited", chapter_edited_cb, ud);
g_debug("Done\n");
}