commit 1129e1547d72e26207048696da218e4b40bcacc8
parent 36fda007b99552f9a5f2468d5fd03c15f67ae505
Author: Jacki <jacki@thejackimonster.de>
Date: Sat, 15 Jun 2024 02:28:33 +0200
Solve issues by only using notify signal of reveal-flap changes
Signed-off-by: Jacki <jacki@thejackimonster.de>
Diffstat:
1 file changed, 6 insertions(+), 24 deletions(-)
diff --git a/src/ui/chat.c b/src/ui/chat.c
@@ -45,14 +45,13 @@
#include "../ui.h"
static void
-handle_chat_details_switched(HdySwipeable* swipeable,
- guint index,
- gint64 duration,
- gpointer user_data)
+handle_chat_details_folded(GObject* object,
+ GParamSpec* pspec,
+ gpointer user_data)
{
- g_assert((swipeable) && (user_data));
+ g_assert((object) && (pspec) && (user_data));
- HdyFlap* flap = HDY_FLAP(swipeable);
+ HdyFlap* flap = HDY_FLAP(object);
UI_CHAT_Handle *handle = (UI_CHAT_Handle*) user_data;
UI_MESSENGER_Handle *messenger = &(handle->app->ui.messenger);
@@ -95,16 +94,6 @@ handle_chat_details_switched(HdySwipeable* swipeable,
g_value_unset(&value);
}
-static void
-handle_chat_details_folded(GObject* object,
- GParamSpec* pspec,
- gpointer user_data)
-{
- g_assert((object) && (pspec) && (user_data));
-
- printf("debug: %s\n", g_param_spec_get_name(pspec));
-}
-
static gboolean
_flap_chat_details_reveal_switch(gpointer user_data)
{
@@ -1237,14 +1226,7 @@ ui_chat_new(MESSENGER_Application *app,
g_signal_connect(
handle->flap_chat_details,
- "child-switched",
- G_CALLBACK(handle_chat_details_switched),
- handle
- );
-
- g_signal_connect(
- handle->flap_chat_details,
- "notify",
+ "notify::reveal-flap",
G_CALLBACK(handle_chat_details_folded),
handle
);