# HG changeset patch # User Gary Kramlich # Date 1730442669 18000 # Node ID ea212a081e9c80eeb312f0d90f05e2ed494a056b # Parent 30a19ec025e9d915716e9830787cd17751130343 Make the text in the infopanes selectable This also removes the tooltip and instead expands the widget out while hovering the cursor over the label. Testing Done: Joined a channel on a local ergo server that had a long topic with links. Link behavior works in all cases except when text is selected which is fine. If you click some where in the label to clear the selection links work again. Also verified the hover behavior. I'm not a fan of using 10 lines as a magic number, but it should be fine for now. Bugs closed: PIDGIN-2582 Reviewed at https://reviews.imfreedom.org/r/3610/ diff -r 30a19ec025e9 -r ea212a081e9c pidgin/pidgininfopane.c --- a/pidgin/pidgininfopane.c Fri Nov 01 01:13:23 2024 -0500 +++ b/pidgin/pidgininfopane.c Fri Nov 01 01:31:09 2024 -0500 @@ -59,6 +59,30 @@ return ret; } +static void +pidgin_info_pane_subtitle_enter_cb(GtkEventControllerMotion *self, + G_GNUC_UNUSED gdouble x, + G_GNUC_UNUSED gdouble y, + G_GNUC_UNUSED gpointer data) +{ + GtkWidget *label = NULL; + + label = gtk_event_controller_get_widget(GTK_EVENT_CONTROLLER(self)); + gtk_label_set_lines(GTK_LABEL(label), 10); +} + +static void +pidgin_info_pane_subtitle_leave_cb(GtkEventControllerMotion *self, + G_GNUC_UNUSED gdouble x, + G_GNUC_UNUSED gdouble y, + G_GNUC_UNUSED gpointer data) +{ + GtkWidget *label = NULL; + + label = gtk_event_controller_get_widget(GTK_EVENT_CONTROLLER(self)); + gtk_label_set_lines(GTK_LABEL(label), 2); +} + /****************************************************************************** * GObject Implementation *****************************************************************************/ @@ -176,6 +200,10 @@ gtk_widget_class_bind_template_callback(widget_class, pidgin_info_pane_linkify_text_cb); + gtk_widget_class_bind_template_callback(widget_class, + pidgin_info_pane_subtitle_enter_cb); + gtk_widget_class_bind_template_callback(widget_class, + pidgin_info_pane_subtitle_leave_cb); } /****************************************************************************** diff -r 30a19ec025e9 -r ea212a081e9c pidgin/resources/Conversations/conversation.ui --- a/pidgin/resources/Conversations/conversation.ui Fri Nov 01 01:13:23 2024 -0500 +++ b/pidgin/resources/Conversations/conversation.ui Fri Nov 01 01:31:09 2024 -0500 @@ -43,16 +43,10 @@ - - - - PidginConversation - - - horizontal + start view-dual-symbolic diff -r 30a19ec025e9 -r ea212a081e9c pidgin/resources/infopane.ui --- a/pidgin/resources/infopane.ui Fri Nov 01 01:13:23 2024 -0500 +++ b/pidgin/resources/infopane.ui Fri Nov 01 01:31:09 2024 -0500 @@ -37,6 +37,7 @@ center + true PidginInfoPane @@ -48,6 +49,7 @@ + true PidginInfoPane @@ -59,6 +61,12 @@ yes word-char 0 + + + + + +