# HG changeset patch
# Node ID a576b2a1c951
# Parent  d00bcebf0f90
diff --git a/ChangeLog.API b/ChangeLog.API
--- a/ChangeLog.API
+++ b/ChangeLog.API
@@ -874,6 +874,9 @@ version 3.0.0 (??/??/????):
 		* pidgin_buddy_icon_chooser_new
 		* PidginBuddyList.connection_errors
 		* PidginButtonStyle
+		* PidginCellRendererExpander
+		* PIDGIN_TYPE_CELL_RENDERER_EXPANDER
+		* pidgin_cell_renderer_expander_new
 		* pidgin_check_if_dir
 		* pidgin_clear_cursor
 		* PidginConversation.sg
diff --git a/pidgin/gtkblist.c b/pidgin/gtkblist.c
--- a/pidgin/gtkblist.c
+++ b/pidgin/gtkblist.c
@@ -41,7 +41,6 @@
 #include "pidgin/pidginaccountstore.h"
 #include "pidgin/pidginactiongroup.h"
 #include "pidgin/pidginaddbuddydialog.h"
-#include "pidgin/pidgincellrendererexpander.h"
 #include "pidgin/pidgincontactlistwindow.h"
 #include "pidgin/pidgincore.h"
 #include "pidgin/pidgindebug.h"
@@ -90,10 +89,6 @@ enum {
 	NAME_COLUMN,
 	BUDDY_ICON_COLUMN,
 	NODE_COLUMN,
-	GROUP_EXPANDER_COLUMN,
-	GROUP_EXPANDER_VISIBLE_COLUMN,
-	CONTACT_EXPANDER_COLUMN,
-	CONTACT_EXPANDER_VISIBLE_COLUMN,
 	EMBLEM_COLUMN,
 	EMBLEM_VISIBLE_COLUMN,
 	PROTOCOL_ICON_COLUMN,
@@ -3041,24 +3036,6 @@ pidgin_blist_build_layout(PurpleBuddyLis
 
 	gtk_tree_view_column_clear(column);
 
-	/* group */
-	rend = pidgin_cell_renderer_expander_new();
-	gtk_tree_view_column_pack_start(column, rend, FALSE);
-	gtk_tree_view_column_set_attributes(column, rend,
-					    "visible", GROUP_EXPANDER_VISIBLE_COLUMN,
-					    "is-expanded", GROUP_EXPANDER_COLUMN,
-					    "sensitive", GROUP_EXPANDER_COLUMN,
-					    NULL);
-
-	/* contact */
-	rend = pidgin_cell_renderer_expander_new();
-	gtk_tree_view_column_pack_start(column, rend, FALSE);
-	gtk_tree_view_column_set_attributes(column, rend,
-					    "visible", CONTACT_EXPANDER_VISIBLE_COLUMN,
-					    "is-expanded", CONTACT_EXPANDER_COLUMN,
-					    "sensitive", CONTACT_EXPANDER_COLUMN,
-					    NULL);
-
 	/* status icons */
 	rend = gtk_cell_renderer_pixbuf_new();
 	gtk_tree_view_column_pack_start(column, rend, FALSE);
@@ -3191,7 +3168,6 @@ static void pidgin_blist_show(PurpleBudd
 {
 	GSimpleActionGroup *action_group = NULL;
 	void *handle;
-	GtkTreeViewColumn *column;
 	GtkWidget *sep;
 	GtkEventController *key_controller = NULL;
 	GtkTreeSelection *selection;
@@ -3254,12 +3230,6 @@ static void pidgin_blist_show(PurpleBudd
 
 	gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(gtkblist->treeview), FALSE);
 
-	/* expander columns */
-	column = gtk_tree_view_column_new();
-	gtk_tree_view_append_column(GTK_TREE_VIEW(gtkblist->treeview), column);
-	gtk_tree_view_column_set_visible(column, FALSE);
-	gtk_tree_view_set_expander_column(GTK_TREE_VIEW(gtkblist->treeview), column);
-
 	/* everything else column */
 	gtkblist->text_column = gtk_tree_view_column_new ();
 	gtk_tree_view_append_column(GTK_TREE_VIEW(gtkblist->treeview), gtkblist->text_column);
@@ -3565,9 +3535,6 @@ static void pidgin_blist_update_group(Pu
 				   STATUS_ICON_COLUMN, NULL,
 				   NAME_COLUMN, title,
 				   NODE_COLUMN, gnode,
-				   GROUP_EXPANDER_COLUMN, TRUE,
-				   GROUP_EXPANDER_VISIBLE_COLUMN, TRUE,
-				   CONTACT_EXPANDER_VISIBLE_COLUMN, FALSE,
 				   BUDDY_ICON_COLUMN, avatar,
 				   EMBLEM_VISIBLE_COLUMN, FALSE,
 				   -1);
@@ -3613,7 +3580,6 @@ static char *pidgin_get_group_title(Purp
 static void buddy_node(PurpleBuddy *buddy, GtkTreeIter *iter, PurpleBlistNode *node)
 {
 	PurplePresence *presence = purple_buddy_get_presence(buddy);
-	PidginBlistNode *pidgin_node = NULL;
 	GdkPixbuf *status, *avatar, *emblem, *protocol_icon;
 	char *mark;
 	char *idle = NULL;
@@ -3623,8 +3589,6 @@ static void buddy_node(PurpleBuddy *budd
 		return;
 	}
 
-	pidgin_node = g_object_get_data(G_OBJECT(node->parent), UI_DATA);
-
 	status = pidgin_blist_get_status_icon(PURPLE_BLIST_NODE(buddy),
 	                                      PIDGIN_STATUS_ICON_LARGE);
 	avatar = pidgin_blist_get_buddy_icon(PURPLE_BLIST_NODE(buddy), TRUE, TRUE);
@@ -3648,9 +3612,6 @@ static void buddy_node(PurpleBuddy *budd
 			   EMBLEM_COLUMN, emblem,
 			   EMBLEM_VISIBLE_COLUMN, (emblem != NULL),
 			   PROTOCOL_ICON_COLUMN, protocol_icon,
-			   CONTACT_EXPANDER_COLUMN, NULL,
-			   CONTACT_EXPANDER_VISIBLE_COLUMN, pidgin_node->contact_expanded,
-			   GROUP_EXPANDER_VISIBLE_COLUMN, FALSE,
 			-1);
 
 	g_free(mark);
@@ -3716,9 +3677,6 @@ static void pidgin_blist_update_contact(
 					   STATUS_ICON_VISIBLE_COLUMN, TRUE,
 					   NAME_COLUMN, mark,
 					   BUDDY_ICON_COLUMN, NULL,
-					   CONTACT_EXPANDER_COLUMN, TRUE,
-					   CONTACT_EXPANDER_VISIBLE_COLUMN, TRUE,
-				  	   GROUP_EXPANDER_VISIBLE_COLUMN, FALSE,
 					-1);
 			g_free(mark);
 			if(status)
@@ -3817,7 +3775,6 @@ static void pidgin_blist_update_chat(Pur
 				EMBLEM_VISIBLE_COLUMN, emblem != NULL,
 				PROTOCOL_ICON_COLUMN, protocol_icon,
 				NAME_COLUMN, mark,
-				GROUP_EXPANDER_VISIBLE_COLUMN, FALSE,
 				-1);
 
 		g_free(mark);
diff --git a/pidgin/meson.build b/pidgin/meson.build
--- a/pidgin/meson.build
+++ b/pidgin/meson.build
@@ -31,7 +31,6 @@ libpidgin_SOURCES = [
 	'pidginapplication.c',
 	'pidginattachment.c',
 	'pidginavatar.c',
-	'pidgincellrendererexpander.c',
 	'pidgincolor.c',
 	'pidgincommands.c',
 	'pidginconversationwindow.c',
@@ -103,7 +102,6 @@ libpidgin_headers = [
 	'pidginapplication.h',
 	'pidginattachment.h',
 	'pidginavatar.h',
-	'pidgincellrendererexpander.h',
 	'pidgincolor.h',
 	'pidginconversationwindow.h',
 	'pidgincontactlistwindow.h',
diff --git a/pidgin/pidgincellrendererexpander.h b/pidgin/pidgincellrendererexpander.h
deleted file mode 100644
--- a/pidgin/pidgincellrendererexpander.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Pidgin - Internet Messenger
- * Copyright (C) Pidgin Developers <devel@pidgin.im>
- *
- * Pidgin is the legal property of its developers, whose names are too numerous
- * to list here.  Please refer to the COPYRIGHT file distributed with this
- * source distribution.
- *
- * This program 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 program 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 program; if not, see <https://www.gnu.org/licenses/>.
- */
-
-#if !defined(PIDGIN_GLOBAL_HEADER_INSIDE) && !defined(PIDGIN_COMPILATION)
-# error "only <pidgin.h> may be included directly"
-#endif
-
-#ifndef PIDGIN_CELL_RENDERER_EXPANDER_H
-#define PIDGIN_CELL_RENDERER_EXPANDER_H
-
-#include <gtk/gtk.h>
-
-/**
- * PidginCellRendererExpander:
- *
- * A #GtkCellRenderer that can hide its children.
- */
-
-#define PIDGIN_TYPE_CELL_RENDERER_EXPANDER (pidgin_cell_renderer_expander_get_type())
-G_DECLARE_FINAL_TYPE(PidginCellRendererExpander, pidgin_cell_renderer_expander,
-                     PIDGIN, CELL_RENDERER_EXPANDER, GtkCellRenderer)
-
-G_BEGIN_DECLS
-
-/**
- * pidgin_cell_renderer_expander_new:
- *
- * Creates a new #PidginCellRendererExpander.
- *
- * Returns: (transfer full): The new cell renderer.
- */
-GtkCellRenderer *pidgin_cell_renderer_expander_new(void);
-
-G_END_DECLS
-
-#endif /* PIDGIN_CELL_RENDERER_EXPANDER_H */
diff --git a/pidgin/pidgincellrendererexpander.c b/pidgin/pidgincellrendererexpander.c
deleted file mode 100644
--- a/pidgin/pidgincellrendererexpander.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Pidgin - Internet Messenger
- * Copyright (C) Pidgin Developers <devel@pidgin.im>
- *
- * Pidgin is the legal property of its developers, whose names are too numerous
- * to list here.  Please refer to the COPYRIGHT file distributed with this
- * source distribution.
- *
- * This program 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 program 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 program; if not, see <https://www.gnu.org/licenses/>.
- */
-
-#include "pidgin/pidgincellrendererexpander.h"
-
-struct _PidginCellRendererExpander {
-	GtkCellRenderer parent;
-};
-
-G_DEFINE_TYPE(PidginCellRendererExpander, pidgin_cell_renderer_expander,
-              GTK_TYPE_CELL_RENDERER)
-
-/******************************************************************************
- * GtkCellRenderer Implementation
- *****************************************************************************/
-static void
-pidgin_cell_renderer_expander_get_size(GtkCellRenderer *renderer,
-                                       GtkWidget *widget,
-                                       const GdkRectangle *cell_area,
-                                       gint *x_offset, gint *y_offset,
-                                       gint *width, gint *height)
-{
-	gint calc_width = 0, calc_height = 0;
-	gint xpad = 0, ypad = 0;
-	gint expander_size = 0;
-
-	gtk_widget_style_get(widget, "expander-size", &expander_size, NULL);
-
-	gtk_cell_renderer_get_padding(renderer, &xpad, &ypad);
-	calc_width = (xpad * 2) + expander_size;
-	calc_height = (ypad * 2) + expander_size;
-
-	if(width) {
-		*width = calc_width;
-	}
-
-	if(height) {
-		*height = calc_height;
-	}
-
-	if(cell_area) {
-		gfloat xalign = 0.0f, yalign = 0.0f;
-
-		gtk_cell_renderer_get_alignment(renderer, &xalign, &yalign);
-
-		if(x_offset) {
-			*x_offset = (gint)(xalign * (cell_area->width - calc_width));
-			*x_offset = MAX (*x_offset, 0);
-		}
-
-		if(y_offset) {
-			*y_offset = (gint)(yalign * (cell_area->height - calc_height));
-			*y_offset = MAX (*y_offset, 0);
-		}
-	}
-}
-
-static void
-pidgin_cell_renderer_expander_render(GtkCellRenderer *renderer, cairo_t *cr,
-                                     GtkWidget *widget,
-                                     const GdkRectangle *background_area,
-                                     const GdkRectangle *cell_area,
-                                     GtkCellRendererState flags)
-{
-	GtkStateFlags state;
-	GtkStyleContext *context = NULL;
-	gboolean is_expanded = FALSE, is_expander = FALSE;
-	gint xpad = 0, ypad = 0;
-	gint width = cell_area->width, height = cell_area->height;
-
-	/* if the row doesn't have children, bail out. */
-	g_object_get(G_OBJECT(renderer), "is-expander", &is_expander, NULL);
-	if(!is_expander) {
-		return;
-	}
-
-	/* Figure out the state of the renderer. */
-	if(!gtk_widget_get_sensitive(widget)) {
-		state = GTK_STATE_FLAG_INSENSITIVE;
-	} else if(flags & GTK_CELL_RENDERER_PRELIT) {
-		state = GTK_STATE_FLAG_PRELIGHT;
-	} else if(gtk_widget_has_focus(widget) && flags & GTK_CELL_RENDERER_SELECTED) {
-		state = GTK_STATE_FLAG_ACTIVE;
-	} else {
-		state = GTK_STATE_FLAG_NORMAL;
-	}
-
-	g_object_get(G_OBJECT(renderer), "is-expanded", &is_expanded, NULL);
-	if(is_expanded) {
-		state |= GTK_STATE_FLAG_CHECKED;
-	} else {
-		state &= ~GTK_STATE_FLAG_CHECKED;
-	}
-
-	/* Build our style context */
-	context = gtk_widget_get_style_context(widget);
-	gtk_style_context_add_class(context, GTK_STYLE_CLASS_VIEW);
-	gtk_style_context_add_class(context, GTK_STYLE_CLASS_EXPANDER);
-	gtk_style_context_set_state(context, state);
-
-	/* Adjust the width and height according to the padding. */
-	gtk_cell_renderer_get_padding(renderer, &xpad, &ypad);
-	width -= xpad * 2;
-	height -= ypad * 2;
-
-	/* Render the arrow. */
-	gtk_render_expander(context, cr,
-	                    cell_area->x + xpad, cell_area->y + ypad,
-	                    width, height);
-}
-
-static gboolean
-pidgin_cell_renderer_expander_activate(GtkCellRenderer *r, GdkEvent *event,
-                                       GtkWidget *widget, const gchar *p,
-                                       const GdkRectangle *bg,
-                                       const GdkRectangle *cell,
-                                       GtkCellRendererState flags)
-{
-	GtkTreePath *path = gtk_tree_path_new_from_string(p);
-
-	if(gtk_tree_view_row_expanded(GTK_TREE_VIEW(widget), path)) {
-		gtk_tree_view_collapse_row(GTK_TREE_VIEW(widget), path);
-	} else {
-		gtk_tree_view_expand_row(GTK_TREE_VIEW(widget),path,FALSE);
-	}
-
-	gtk_tree_path_free(path);
-
-	return FALSE;
-}
-
-/******************************************************************************
- * GObject Implementation
- *****************************************************************************/
-static void
-pidgin_cell_renderer_expander_init (PidginCellRendererExpander *renderer) {
-	/* there's no accessor for setting the mode, so we have to set the property
-	 * explicitly.
-	 */
-	g_object_set(G_OBJECT(renderer), "mode",
-	             GTK_CELL_RENDERER_MODE_ACTIVATABLE, NULL);
-
-	gtk_cell_renderer_set_padding(GTK_CELL_RENDERER(renderer), 0, 2);
-}
-
-static void
-pidgin_cell_renderer_expander_class_init(PidginCellRendererExpanderClass *klass)
-{
-	GtkCellRendererClass *renderer_class = GTK_CELL_RENDERER_CLASS(klass);
-
-	renderer_class->get_size = pidgin_cell_renderer_expander_get_size;
-	renderer_class->render = pidgin_cell_renderer_expander_render;
-	renderer_class->activate = pidgin_cell_renderer_expander_activate;
-}
-
-/******************************************************************************
- * Public API
- *****************************************************************************/
-GtkCellRenderer *
-pidgin_cell_renderer_expander_new(void) {
-	return g_object_new(PIDGIN_TYPE_CELL_RENDERER_EXPANDER, NULL);
-}
diff --git a/po/POTFILES.in b/po/POTFILES.in
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -348,7 +348,6 @@ pidgin/pidginapplication.c
 pidgin/pidginattachment.c
 pidgin/pidginavatar.c
 pidgin/pidgin.c
-pidgin/pidgincellrendererexpander.c
 pidgin/pidgincolor.c
 pidgin/pidgincommands.c
 pidgin/pidgincontactlistwindow.c
