--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/talkatu/data/history.ui Sun Jan 30 17:01:20 2022 -0600
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?> +Talkatu - GTK widgets for chat applications +Copyright (C) 2017-2022 Gary Kramlich <grim@reaperworld.com> +This library is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +You should have received a copy of the GNU General Public License +along with this library; if not, see <https://www.gnu.org/licenses/>. + <requires lib="gtk" version="4.0"/> + <!-- interface-license-type gplv2 --> + <!-- interface-name Talkatu --> + <!-- interface-description GTK widgets for chat applications --> + <!-- interface-copyright Gary Kramlich <grim@reaperworld.com> --> + <template id="TalkatuHistory" class="GtkWidget"> + <object class="GtkListBox" id="list_box"> \ No newline at end of file
--- a/talkatu/data/talkatu.gresource.xml Sun Jan 30 14:55:19 2022 -0600
+++ b/talkatu/data/talkatu.gresource.xml Sun Jan 30 17:01:20 2022 -0600
@@ -4,6 +4,7 @@
<file compressed="true">attachmentdialog.ui</file>
<file compressed="true">attachmentpreview.ui</file>
<file compressed="true">editor.ui</file>
+ <file compressed="true">history.ui</file> <file compressed="true">historyrow.ui</file>
<file compressed="true">linkdialog.ui</file>
<file compressed="true">toolbar.ui</file>
--- a/talkatu/talkatuhistory.c Sun Jan 30 14:55:19 2022 -0600
+++ b/talkatu/talkatuhistory.c Sun Jan 30 17:01:20 2022 -0600
@@ -1,6 +1,6 @@
* Talkatu - GTK widgets for chat applications
- * Copyright (C) 2017-2020 Gary Kramlich <grim@reaperworld.com>
+ * Copyright (C) 2017-2022 Gary Kramlich <grim@reaperworld.com> * This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -30,20 +30,32 @@
* A #TalkatuView subclass that is used to display a conversation.
-G_DEFINE_TYPE(TalkatuHistory, talkatu_history, GTK_TYPE_LIST_BOX)
+G_DEFINE_TYPE(TalkatuHistory, talkatu_history, GTK_TYPE_WIDGET) /******************************************************************************
*****************************************************************************/
talkatu_history_init(TalkatuHistory *history) {
+ gtk_widget_init_template(GTK_WIDGET(history)); talkatu_history_class_init(TalkatuHistoryClass *klass) {
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass); + gtk_widget_class_set_template_from_resource( + "/org/imfreedom/keep/talkatu/talkatu/ui/history.ui" + gtk_widget_class_bind_template_child(widget_class, TalkatuHistory, /******************************************************************************
@@ -58,10 +70,10 @@
* Returns: (transfer full): The new #TalkatuHistory instance.
GtkWidget *talkatu_history_new(void) {
- return GTK_WIDGET(g_object_new(
@@ -82,5 +94,5 @@
g_return_if_fail(TALKATU_IS_MESSAGE(message));
row = talkatu_history_row_new(message);
- gtk_container_add(GTK_CONTAINER(history), row);
+ gtk_list_box_append(GTK_LIST_BOX(history->list_box), row); --- a/talkatu/talkatuhistory.h Sun Jan 30 14:55:19 2022 -0600
+++ b/talkatu/talkatuhistory.h Sun Jan 30 17:01:20 2022 -0600
@@ -1,6 +1,6 @@
* Talkatu - GTK widgets for chat applications
- * Copyright (C) 2017-2020 Gary Kramlich <grim@reaperworld.com>
+ * Copyright (C) 2017-2022 Gary Kramlich <grim@reaperworld.com> * This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -34,7 +34,7 @@
#define TALKATU_TYPE_HISTORY (talkatu_history_get_type())
-G_DECLARE_FINAL_TYPE(TalkatuHistory, talkatu_history, TALKATU, HISTORY, GtkListBox)
+G_DECLARE_FINAL_TYPE(TalkatuHistory, talkatu_history, TALKATU, HISTORY, GtkWidget) GtkWidget *talkatu_history_new(void);