Private
Public Access
1
0

gtk: add split view navigation stack support

This commit is contained in:
2025-12-14 18:49:38 -08:00
parent fc69c387c5
commit be2e3ea9d9
2 changed files with 19 additions and 2 deletions

View File

@@ -14,6 +14,7 @@ public class ConversationListView : Adw.Bin
private string? selected_conversation_guid = null;
private bool selection_update_queued = false;
private bool suppress_row_selected = false;
public ConversationListView () {
container = new Adw.ToolbarView ();
@@ -29,6 +30,10 @@ public class ConversationListView : Adw.Bin
scrolled_window.set_child (list_box);
list_box.row_selected.connect ((row) => {
if (suppress_row_selected) {
return;
}
var conversation_row = (ConversationRow?) row;
if (conversation_row != null) {
selected_conversation_guid = conversation_row.conversation.guid;
@@ -112,7 +117,9 @@ public class ConversationListView : Adw.Bin
if (conversation.guid == selected_conversation_guid) {
var row = list_box.get_row_at_index((int)i);
if (row != null) {
suppress_row_selected = true;
list_box.select_row(row);
suppress_row_selected = false;
}
}
}
@@ -123,4 +130,4 @@ public class ConversationListView : Adw.Bin
Conversation conversation = (Conversation) item;
return new ConversationRow (conversation);
}
}
}