pidgin.next.minor: f07e2367: Add pidgin_make_scrollable and use it. ...
rekkanoryo at pidgin.im
rekkanoryo at pidgin.im
Fri Jan 7 22:55:31 EST 2011
----------------------------------------------------------------------
Revision: f07e2367652cc664834b1968911b2455b6b0640e
Parent: 93815ced6f2a902161c3c02bc0bc115f461be559
Author: nix at go-nix.ca
Date: 01/07/11 22:45:42
Branch: im.pidgin.pidgin.next.minor
URL: http://d.pidgin.im/viewmtn/revision/info/f07e2367652cc664834b1968911b2455b6b0640e
Changelog:
Add pidgin_make_scrollable and use it. Cleans up a bunch of duplicate code. Net code loss of 180 lines. Fixes #13073.
Changes against parent 93815ced6f2a902161c3c02bc0bc115f461be559
patched pidgin/gtkaccount.c
patched pidgin/gtkblist.c
patched pidgin/gtkcertmgr.c
patched pidgin/gtkconv.c
patched pidgin/gtkft.c
patched pidgin/gtkimhtmltoolbar.c
patched pidgin/gtklog.c
patched pidgin/gtknotify.c
patched pidgin/gtkplugin.c
patched pidgin/gtkpounce.c
patched pidgin/gtkprefs.c
patched pidgin/gtkprivacy.c
patched pidgin/gtkrequest.c
patched pidgin/gtkroomlist.c
patched pidgin/gtksavedstatuses.c
patched pidgin/gtksmiley.c
patched pidgin/gtkstatusbox.c
patched pidgin/gtkutils.c
patched pidgin/gtkutils.h
patched pidgin/plugins/disco/gtkdisco.c
patched pidgin/plugins/gevolution/add_buddy_dialog.c
patched pidgin/plugins/gevolution/assoc-buddy.c
patched pidgin/plugins/gevolution/gevolution.c
patched pidgin/plugins/spellchk.c
patched pidgin/plugins/xmppconsole.c
-------------- next part --------------
============================================================
--- pidgin/plugins/spellchk.c 783eab9ec8163c237498b0a786e395f1ea5c8a02
+++ pidgin/plugins/spellchk.c 7764f0e3d8bab991f84ac31de86fb2eaf87d8dc0
@@ -2156,7 +2156,7 @@ get_config_frame(PurplePlugin *plugin)
static GtkWidget *
get_config_frame(PurplePlugin *plugin)
{
- GtkWidget *ret, *vbox, *win;
+ GtkWidget *ret, *vbox;
GtkWidget *hbox;
GtkWidget *button;
GtkSizeGroup *sg;
@@ -2173,15 +2173,6 @@ get_config_frame(PurplePlugin *plugin)
gtk_container_set_border_width(GTK_CONTAINER(vbox), 4);
gtk_widget_show(vbox);
- win = gtk_scrolled_window_new(0, 0);
- gtk_box_pack_start(GTK_BOX(vbox), win, TRUE, TRUE, 0);
- gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(win),
- GTK_SHADOW_IN);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(win),
- GTK_POLICY_NEVER,
- GTK_POLICY_ALWAYS);
- gtk_widget_show(win);
-
tree = gtk_tree_view_new_with_model(GTK_TREE_MODEL(model));
gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(tree), TRUE);
gtk_widget_set_size_request(tree, -1, 200);
@@ -2240,7 +2231,9 @@ get_config_frame(PurplePlugin *plugin)
gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(tree)),
GTK_SELECTION_MULTIPLE);
- gtk_container_add(GTK_CONTAINER(win), tree);
+ gtk_box_pack_start(GTK_BOX(vbox),
+ pidgin_make_scrollable(tree, GTK_POLICY_NEVER, GTK_POLICY_ALWAYS, GTK_SHADOW_IN, -1, -1),
+ TRUE, TRUE, 0);
gtk_widget_show(tree);
hbox = gtk_hbutton_box_new();
============================================================
--- pidgin/gtkconv.c 0aa1483461a2917c9fba3b8f4d16d084aa18d136
+++ pidgin/gtkconv.c d416d59a069728caac914125e25a0a933c3b8ca9
@@ -4695,7 +4695,7 @@ setup_chat_userlist(PidginConversation *
setup_chat_userlist(PidginConversation *gtkconv, GtkWidget *hpaned)
{
PidginChatPane *gtkchat = gtkconv->u.chat;
- GtkWidget *lbox, *sw, *list;
+ GtkWidget *lbox, *list;
GtkListStore *ls;
GtkCellRenderer *rend;
GtkTreeViewColumn *col;
@@ -4715,12 +4715,6 @@ setup_chat_userlist(PidginConversation *
gtk_widget_show(gtkchat->count);
/* Setup the list of users. */
- sw = gtk_scrolled_window_new(NULL, NULL);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN);
- gtk_box_pack_start(GTK_BOX(lbox), sw, TRUE, TRUE, 0);
- gtk_widget_show(sw);
ls = gtk_list_store_new(CHAT_USERS_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING,
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT,
@@ -4790,7 +4784,9 @@ setup_chat_userlist(PidginConversation *
gtkchat->list = list;
- gtk_container_add(GTK_CONTAINER(sw), list);
+ gtk_box_pack_start(GTK_BOX(lbox),
+ pidgin_make_scrollable(list, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, GTK_SHADOW_IN, -1, -1),
+ TRUE, TRUE, 0);
}
static gboolean
@@ -5014,10 +5010,7 @@ setup_common_pane(PidginConversation *gt
gtk_imhtml_show_comments(GTK_IMHTML(gtkconv->imhtml),TRUE);
g_object_set_data(G_OBJECT(gtkconv->imhtml), "gtkconv", gtkconv);
- gtk_scrolled_window_get_policy(GTK_SCROLLED_WINDOW(imhtml_sw),
- &imhtml_sw_hscroll, NULL);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(imhtml_sw),
- imhtml_sw_hscroll, GTK_POLICY_ALWAYS);
+ g_object_set(G_OBJECT(imhtml_sw), "vscrollbar-policy", GTK_POLICY_ALWAYS, NULL);
g_signal_connect_after(G_OBJECT(gtkconv->imhtml), "button_press_event",
G_CALLBACK(entry_stop_rclick_cb), NULL);
============================================================
--- pidgin/gtkutils.c 5537edee3cffeb641b749752fefd6c80a4ef183a
+++ pidgin/gtkutils.c 1d9154cee2ee94d38f043634ea4edada395796f6
@@ -245,12 +245,6 @@ pidgin_create_imhtml(gboolean editable,
gtk_widget_show(sep);
}
- sw = gtk_scrolled_window_new(NULL, NULL);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0);
- gtk_widget_show(sw);
-
imhtml = gtk_imhtml_new(NULL, NULL);
gtk_imhtml_set_editable(GTK_IMHTML(imhtml), editable);
gtk_imhtml_set_format_functions(GTK_IMHTML(imhtml), GTK_IMHTML_ALL ^ GTK_IMHTML_IMAGE);
@@ -267,7 +261,8 @@ pidgin_create_imhtml(gboolean editable,
}
pidgin_setup_imhtml(imhtml);
- gtk_container_add(GTK_CONTAINER(sw), imhtml);
+ sw = pidgin_make_scrollable(imhtml, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, GTK_SHADOW_NONE, -1, -1);
+ gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0);
if (imhtml_ret != NULL)
*imhtml_ret = imhtml;
@@ -3492,6 +3487,29 @@ winpidgin_register_win32_url_handlers(vo
}
#endif
+GtkWidget *
+pidgin_make_scrollable(GtkWidget *child, GtkPolicyType hscrollbar_policy, GtkPolicyType vscrollbar_policy, GtkShadowType shadow_type, int width, int height)
+{
+ GtkWidget *sw = gtk_scrolled_window_new(NULL, NULL);
+
+ if (G_LIKELY(sw)) {
+ gtk_widget_show(sw);
+ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), hscrollbar_policy, vscrollbar_policy);
+ gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), shadow_type);
+ if (width != -1 || height != -1)
+ gtk_widget_set_size_request(sw, width, height);
+ if (child) {
+ if (GTK_WIDGET_GET_CLASS(child)->set_scroll_adjustments_signal)
+ gtk_container_add(GTK_CONTAINER(sw), child);
+ else
+ gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw), child);
+ }
+ return sw;
+ }
+
+ return child;
+}
+
void pidgin_utils_init(void)
{
gtk_imhtml_class_register_protocol("http://", url_clicked_cb, link_context_menu);
============================================================
--- pidgin/gtkutils.h 83e8ea602157babeea28834a46519875ef12b276
+++ pidgin/gtkutils.h c8deecccaa12788a3d85183330df316cef146b8d
@@ -845,6 +845,19 @@ GdkPixbuf *pidgin_pixbuf_from_imgstore(P
GdkPixbuf *pidgin_pixbuf_from_imgstore(PurpleStoredImage *image);
/**
+ * Add scrollbars to a widget
+ * @param widget The child widget
+ * @hscrollbar_policy Horizontal scrolling policy
+ * @vscrollbar_policy Vertical scrolling policy
+ * @shadow Shadow type
+ * @width Desired widget width, or -1 for default
+ * @height Desired widget height, or -1 for default
+ *
+ * @since 2.8.0
+ */
+GtkWidget *pidgin_make_scrollable(GtkWidget *child, GtkPolicyType hscrollbar_policy, GtkPolicyType vscrollbar_policy, GtkShadowType shadow_type, int width, int height);
+
+/**
* Initialize some utility functions.
*
* @since 2.6.0
============================================================
--- pidgin/gtkft.c 167f182e5ad9347536e480909e5b966ab0aab5d2
+++ pidgin/gtkft.c 8018e061cb4b35cd24f81afd64aaebd60dac6e34
@@ -557,22 +557,12 @@ setup_tree(PidginXferDialog *dialog)
static GtkWidget *
setup_tree(PidginXferDialog *dialog)
{
- GtkWidget *sw;
GtkWidget *tree;
GtkListStore *model;
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
GtkTreeSelection *selection;
- /* Create the scrolled window. */
- sw = gtk_scrolled_window_new(0, 0);
- gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
- GTK_SHADOW_IN);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_AUTOMATIC);
- gtk_widget_show(sw);
-
/* Build the tree model */
/* Transfer type, Progress Bar, Filename, Size, Remaining */
model = gtk_list_store_new(NUM_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_INT,
@@ -636,10 +626,9 @@ setup_tree(PidginXferDialog *dialog)
gtk_tree_view_columns_autosize(GTK_TREE_VIEW(tree));
- gtk_container_add(GTK_CONTAINER(sw), tree);
gtk_widget_show(tree);
- return sw;
+ return tree;
}
static GtkWidget *
@@ -713,7 +702,6 @@ pidgin_xfer_dialog_new(void)
PidginXferDialog *dialog;
GtkWidget *window;
GtkWidget *vbox1, *vbox2;
- GtkWidget *sw;
GtkWidget *expander;
GtkWidget *alignment;
GtkWidget *table;
@@ -744,9 +732,9 @@ pidgin_xfer_dialog_new(void)
gtk_widget_show(vbox2);
/* Setup the listbox */
- sw = setup_tree(dialog);
- gtk_box_pack_start(GTK_BOX(vbox2), sw, TRUE, TRUE, 0);
- gtk_widget_set_size_request(sw,-1, 140);
+ gtk_box_pack_start(GTK_BOX(vbox2),
+ pidgin_make_scrollable(setup_tree(dialog), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, GTK_SHADOW_IN, -1, 140),
+ TRUE, TRUE, 0);
/* "Close this window when all transfers finish" */
checkbox = gtk_check_button_new_with_mnemonic(
============================================================
--- pidgin/gtkpounce.c 1f197cddf4e2ac49b697f8d52e3269d0f56757ee
+++ pidgin/gtkpounce.c c0872ce72e73913d5a44840f2000cb27c9b71a33
@@ -1221,21 +1221,11 @@ create_pounces_list(PouncesManager *dial
static GtkWidget *
create_pounces_list(PouncesManager *dialog)
{
- GtkWidget *sw;
GtkWidget *treeview;
GtkTreeSelection *sel;
GtkTreeViewColumn *column;
GtkCellRenderer *renderer;
- /* Create the scrolled window */
- sw = gtk_scrolled_window_new(0, 0);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
- GTK_SHADOW_IN);
- gtk_widget_show(sw);
-
/* Create the list model */
dialog->model = gtk_list_store_new(POUNCES_MANAGER_NUM_COLUMNS,
G_TYPE_POINTER,
@@ -1259,7 +1249,6 @@ create_pounces_list(PouncesManager *dial
/* Handle double-clicking */
g_signal_connect(G_OBJECT(treeview), "button_press_event",
G_CALLBACK(pounce_double_click_cb), dialog);
- gtk_container_add(GTK_CONTAINER(sw), treeview);
gtk_widget_show(treeview);
/* Pouncee Column */
@@ -1319,7 +1308,7 @@ create_pounces_list(PouncesManager *dial
/* Populate list */
populate_pounces_list(dialog);
- return sw;
+ return pidgin_make_scrollable(treeview, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, GTK_SHADOW_IN, -1, -1);
}
void
============================================================
--- pidgin/gtkplugin.c 66d4b71fa7275d371c89dbf2c2421a096ce1c0c4
+++ pidgin/gtkplugin.c 7c52fc39e8673533d60094e8f1b8dafee8cf916e
@@ -706,7 +706,6 @@ void pidgin_plugin_dialog_show()
void pidgin_plugin_dialog_show()
{
- GtkWidget *sw;
GtkWidget *event_view;
GtkListStore *ls;
GtkCellRenderer *rend, *rendt;
@@ -729,12 +728,6 @@ void pidgin_plugin_dialog_show()
gtk_widget_set_sensitive(pref_button, FALSE);
gtk_window_set_role(GTK_WINDOW(plugin_dialog), "plugins");
- sw = gtk_scrolled_window_new(NULL,NULL);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN);
-
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(plugin_dialog)->vbox), sw, TRUE, TRUE, 0);
-
ls = gtk_list_store_new(4, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_BOOLEAN);
gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(ls),
1, GTK_SORT_ASCENDING);
@@ -779,7 +772,9 @@ void pidgin_plugin_dialog_show()
gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col);
gtk_tree_view_column_set_sort_column_id(col, 1);
g_object_unref(G_OBJECT(ls));
- gtk_container_add(GTK_CONTAINER(sw), event_view);
+ gtk_box_pack_start(GTK_BOX(GTK_DIALOG(plugin_dialog)->vbox),
+ pidgin_make_scrollable(event_view, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, GTK_SHADOW_IN, -1, -1),
+ TRUE, TRUE, 0);
gtk_tree_view_set_search_column(GTK_TREE_VIEW(event_view), 1);
gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(event_view),
pidgin_tree_view_search_equal_func, NULL, NULL);
============================================================
--- pidgin/gtkblist.c 6af89ce91a9b8d525df534bc6742642bb64fd1a4
+++ pidgin/gtkblist.c 2094b0e61d2ff97c40070ca2b30f6c526a797102
@@ -5731,7 +5731,6 @@ static void pidgin_blist_show(PurpleBudd
GtkTreeViewColumn *column;
GtkWidget *menu;
GtkWidget *ebox;
- GtkWidget *sw;
GtkWidget *sep;
GtkWidget *label;
GtkWidget *close;
@@ -5882,11 +5881,6 @@ static void pidgin_blist_show(PurpleBudd
g_signal_connect(G_OBJECT(ebox), "button-press-event", G_CALLBACK(headline_box_press_cb), gtkblist);
/****************************** GtkTreeView **********************************/
- sw = gtk_scrolled_window_new(NULL,NULL);
- gtk_widget_show(sw);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
-
gtkblist->treemodel = gtk_tree_store_new(BLIST_COLUMNS,
GDK_TYPE_PIXBUF, /* Status icon */
G_TYPE_BOOLEAN, /* Status icon visible */
@@ -5966,8 +5960,9 @@ static void pidgin_blist_show(PurpleBudd
gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(gtkblist->treeview),
pidgin_blist_search_equal_func, NULL, NULL);
- gtk_box_pack_start(GTK_BOX(gtkblist->vbox), sw, TRUE, TRUE, 0);
- gtk_container_add(GTK_CONTAINER(sw), gtkblist->treeview);
+ gtk_box_pack_start(GTK_BOX(gtkblist->vbox),
+ pidgin_make_scrollable(gtkblist->treeview, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, GTK_SHADOW_NONE, -1, -1),
+ TRUE, TRUE, 0);
sep = gtk_hseparator_new();
gtk_box_pack_start(GTK_BOX(gtkblist->vbox), sep, FALSE, FALSE, 0);
============================================================
--- pidgin/gtknotify.c bcb46456ab2251ad473829a09101f0a73deecfc6
+++ pidgin/gtknotify.c abae8802e1faa325cf388cca82f6f6c23db16c67
@@ -956,7 +956,6 @@ pidgin_notify_searchresults(PurpleConnec
GtkWidget *vbox;
GtkWidget *label;
- GtkWidget *sw;
PidginNotifySearchResultsData *data;
char *label_text;
char *primary_esc, *secondary_esc;
@@ -1012,15 +1011,6 @@ pidgin_notify_searchresults(PurpleConnec
model = gtk_list_store_newv(col_num, col_types);
g_free(col_types);
- /* Setup the scrolled window containing the treeview */
- sw = gtk_scrolled_window_new(NULL, NULL);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
- gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
- GTK_SHADOW_IN);
- gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0);
- gtk_widget_show(sw);
-
/* Setup the treeview */
treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(model));
g_object_unref(G_OBJECT(model));
@@ -1029,7 +1019,9 @@ pidgin_notify_searchresults(PurpleConnec
gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)),
GTK_SELECTION_SINGLE);
gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(treeview), TRUE);
- gtk_container_add(GTK_CONTAINER(sw), treeview);
+ gtk_box_pack_start(GTK_BOX(vbox),
+ pidgin_make_scrollable(treeview, GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS, GTK_SHADOW_IN, -1, -1),
+ TRUE, TRUE, 0);
gtk_widget_show(treeview);
renderer = gtk_cell_renderer_pixbuf_new();
@@ -1488,7 +1480,6 @@ pidgin_create_notification_dialog(Pidgin
GtkTreeStore *model = NULL;
GtkWidget *dialog = NULL;
GtkWidget *label = NULL;
- GtkWidget *sw;
GtkCellRenderer *rend;
GtkTreeViewColumn *column;
GtkWidget *button = NULL;
@@ -1526,10 +1517,6 @@ pidgin_create_notification_dialog(Pidgin
/* Golden ratio it up! */
gtk_widget_set_size_request(dialog, 550, 400);
- sw = gtk_scrolled_window_new(NULL, NULL);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
-
spec_dialog = g_new0(PidginNotifyDialog, 1);
spec_dialog->dialog = dialog;
@@ -1538,7 +1525,6 @@ pidgin_create_notification_dialog(Pidgin
g_object_unref(G_OBJECT(model));
gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(spec_dialog->treeview), TRUE);
- gtk_container_add(GTK_CONTAINER(sw), spec_dialog->treeview);
if (type == PIDGIN_NOTIFY_MAIL) {
gtk_window_set_title(GTK_WINDOW(dialog), _("New Mail"));
@@ -1653,7 +1639,9 @@ pidgin_create_notification_dialog(Pidgin
gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
- gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 2);
+ gtk_box_pack_start(GTK_BOX(vbox),
+ pidgin_make_scrollable(spec_dialog->treeview, GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS, GTK_SHADOW_IN, -1, -1),
+ TRUE, TRUE, 2);
return spec_dialog;
}
============================================================
--- pidgin/gtkprefs.c f141f1c60f45904da1401916e3a4442e9a452cee
+++ pidgin/gtkprefs.c 0c5c84d96b4716aeb51f83beabbf3cca2baeba48
@@ -2513,12 +2513,6 @@ sound_page(void)
vbox->parent->parent, TRUE, TRUE, 0, GTK_PACK_START);
/* SOUND SELECTION */
- sw = gtk_scrolled_window_new(NULL,NULL);
- gtk_widget_set_size_request(sw, -1, 100);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN);
-
- gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0);
event_store = gtk_list_store_new (4, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT);
for (j=0; j < PURPLE_NUM_SOUNDS; j++) {
@@ -2567,7 +2561,9 @@ sound_page(void)
NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col);
g_object_unref(G_OBJECT(event_store));
- gtk_container_add(GTK_CONTAINER(sw), event_view);
+ gtk_box_pack_start(GTK_BOX(vbox),
+ pidgin_make_scrollable(event_view, GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC, GTK_SHADOW_IN, -1, 100),
+ TRUE, TRUE, 0);
hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
============================================================
--- pidgin/gtkrequest.c 945e7982e0ecd0b4bcc431598e7ce36084f1b369
+++ pidgin/gtkrequest.c f46dc657d74c03f72a5b4ed2a8efa4f1f17984f9
@@ -419,16 +419,6 @@ pidgin_request_input(const char *title,
}
else {
if (multiline) {
- GtkWidget *sw;
-
- sw = gtk_scrolled_window_new(NULL, NULL);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
- GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
- gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
- GTK_SHADOW_IN);
-
- gtk_widget_set_size_request(sw, 320, 130);
-
/* GtkTextView */
entry = gtk_text_view_new();
gtk_text_view_set_editable(GTK_TEXT_VIEW(entry), TRUE);
@@ -442,12 +432,12 @@ pidgin_request_input(const char *title,
gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(entry), GTK_WRAP_WORD_CHAR);
- gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0);
-
if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/spellcheck"))
pidgin_setup_gtkspell(GTK_TEXT_VIEW(entry));
- gtk_container_add(GTK_CONTAINER(sw), entry);
+ gtk_box_pack_start(GTK_BOX(vbox),
+ pidgin_make_scrollable(entry, GTK_POLICY_NEVER, GTK_POLICY_ALWAYS, GTK_SHADOW_IN, 320, 130),
+ TRUE, TRUE, 0);
}
else {
entry = gtk_entry_new();
@@ -852,12 +842,6 @@ create_string_field(PurpleRequestField *
{
GtkWidget *textview;
- widget = gtk_scrolled_window_new(NULL, NULL);
- gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(widget),
- GTK_SHADOW_IN);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(widget),
- GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
-
textview = gtk_text_view_new();
gtk_text_view_set_editable(GTK_TEXT_VIEW(textview),
TRUE);
@@ -867,11 +851,8 @@ create_string_field(PurpleRequestField *
if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/spellcheck"))
pidgin_setup_gtkspell(GTK_TEXT_VIEW(textview));
- gtk_container_add(GTK_CONTAINER(widget), textview);
gtk_widget_show(textview);
- gtk_widget_set_size_request(widget, -1, 75);
-
if (value != NULL)
{
GtkTextBuffer *buffer;
@@ -893,6 +874,8 @@ create_string_field(PurpleRequestField *
g_signal_connect(G_OBJECT(buffer), "changed",
G_CALLBACK(req_entry_field_changed_cb), field);
}
+
+ widget = pidgin_make_scrollable(textview, GTK_POLICY_NEVER, GTK_POLICY_ALWAYS, GTK_SHADOW_IN, -1, 75);
}
else
{
@@ -1093,7 +1076,6 @@ create_list_field(PurpleRequestField *fi
static GtkWidget *
create_list_field(PurpleRequestField *field)
{
- GtkWidget *sw;
GtkWidget *treeview;
GtkListStore *store;
GtkCellRenderer *renderer;
@@ -1105,14 +1087,6 @@ create_list_field(PurpleRequestField *fi
icons = purple_request_field_list_get_icons(field);
- /* Create the scrolled window */
- sw = gtk_scrolled_window_new(NULL, NULL);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
- GTK_SHADOW_IN);
- gtk_widget_show(sw);
/* Create the list store */
if (icons)
@@ -1188,10 +1162,9 @@ create_list_field(PurpleRequestField *fi
g_signal_connect(G_OBJECT(sel), "changed",
G_CALLBACK(list_field_select_changed_cb), field);
- gtk_container_add(GTK_CONTAINER(sw), treeview);
gtk_widget_show(treeview);
- return sw;
+ return pidgin_make_scrollable(treeview, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, GTK_SHADOW_IN, -1, -1);
}
static void *
@@ -1297,18 +1270,10 @@ pidgin_request_fields(const char *title,
if(total_fields > 9) {
GtkWidget *hbox_for_spacing, *vbox_for_spacing;
- sw = gtk_scrolled_window_new(NULL, NULL);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
- GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
- GTK_SHADOW_NONE);
- gtk_widget_set_size_request(sw, -1, 200);
- gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0);
- gtk_widget_show(sw);
-
hbox_for_spacing = gtk_hbox_new(FALSE, PIDGIN_HIG_BORDER);
- gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw),
- hbox_for_spacing);
+ gtk_box_pack_start(GTK_BOX(vbox),
+ pidgin_make_scrollable(hbox_for_spacing, GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC, GTK_SHADOW_NONE, -1, 200),
+ TRUE, TRUE, 0);
gtk_widget_show(hbox_for_spacing);
vbox_for_spacing = gtk_vbox_new(FALSE, PIDGIN_HIG_BORDER);
============================================================
--- pidgin/gtkaccount.c d0eabdf276bd851ed12fd31de7c9cdcc9cb27456
+++ pidgin/gtkaccount.c 4fac17132bd66961f22e59410c2a77cfe81bf49d
@@ -2141,7 +2141,6 @@ create_accounts_list(AccountsWindow *dia
create_accounts_list(AccountsWindow *dialog)
{
GtkWidget *frame;
- GtkWidget *sw;
GtkWidget *label;
GtkWidget *treeview;
GtkTreeSelection *sel;
@@ -2181,16 +2180,6 @@ create_accounts_list(AccountsWindow *dia
gtk_misc_set_alignment(GTK_MISC(label), 0.5, 0.5);
gtk_notebook_append_page(GTK_NOTEBOOK(accounts_window->notebook), label, NULL);
- /* Create the scrolled window. */
- sw = gtk_scrolled_window_new(0, 0);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
- GTK_SHADOW_NONE);
- gtk_notebook_append_page(GTK_NOTEBOOK(accounts_window->notebook), sw, NULL);
- gtk_widget_show(sw);
-
/* Create the list model. */
dialog->model = gtk_list_store_new(NUM_COLUMNS,
GDK_TYPE_PIXBUF, /* COLUMN_ICON */
@@ -2216,7 +2205,9 @@ create_accounts_list(AccountsWindow *dia
g_signal_connect(G_OBJECT(treeview), "button_press_event",
G_CALLBACK(account_treeview_double_click_cb), dialog);
- gtk_container_add(GTK_CONTAINER(sw), treeview);
+ gtk_notebook_append_page(GTK_NOTEBOOK(accounts_window->notebook),
+ pidgin_make_scrollable(treeview, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, GTK_SHADOW_NONE, -1, -1),
+ NULL);
add_columns(treeview, dialog);
gtk_tree_view_columns_autosize(GTK_TREE_VIEW(treeview));
============================================================
--- pidgin/gtkprivacy.c 18fdd26c09ac0b5c3e27b5d68dfa195c7a853bac
+++ pidgin/gtkprivacy.c 35ede01236778088df25073ff624a7147be823c9
@@ -133,12 +133,6 @@ build_list(PidginPrivacyDialog *dialog,
GtkTreeViewColumn *column;
GtkTreeSelection *sel;
- sw = gtk_scrolled_window_new(NULL, NULL);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN);
-
treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(model));
*ret_treeview = treeview;
@@ -150,7 +144,7 @@ build_list(PidginPrivacyDialog *dialog,
gtk_tree_view_column_set_clickable(GTK_TREE_VIEW_COLUMN(column), TRUE);
gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);
gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(treeview), FALSE);
- gtk_container_add(GTK_CONTAINER(sw), treeview);
+ sw = pidgin_make_scrollable(treeview, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, GTK_SHADOW_IN, -1, 200);
gtk_widget_show(treeview);
@@ -159,8 +153,6 @@ build_list(PidginPrivacyDialog *dialog,
g_signal_connect(G_OBJECT(sel), "changed",
G_CALLBACK(user_selected_cb), dialog);
- gtk_widget_set_size_request(sw, -1, 200);
-
return sw;
}
============================================================
--- pidgin/gtklog.c f9d82fe3e8fab18648c330dbfffb92f146b5062f
+++ pidgin/gtklog.c 6274585d9565b78a49affb6647109032b2103828
@@ -531,7 +531,6 @@ static PidginLogViewer *display_log_view
GtkWidget *title_box;
char *text;
GtkWidget *pane;
- GtkWidget *sw;
GtkCellRenderer *rend;
GtkTreeViewColumn *col;
GtkTreeSelection *sel;
@@ -614,10 +613,6 @@ static PidginLogViewer *display_log_view
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(lv->window)->vbox), pane, TRUE, TRUE, 0);
/* List *************/
- sw = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), GTK_SHADOW_IN);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
- gtk_paned_add1(GTK_PANED(pane), sw);
lv->treestore = gtk_tree_store_new (2, G_TYPE_STRING, G_TYPE_POINTER);
lv->treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL (lv->treestore));
g_object_unref(G_OBJECT(lv->treestore));
@@ -625,7 +620,8 @@ static PidginLogViewer *display_log_view
col = gtk_tree_view_column_new_with_attributes ("time", rend, "markup", 0, NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW(lv->treeview), col);
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (lv->treeview), FALSE);
- gtk_container_add (GTK_CONTAINER (sw), lv->treeview);
+ gtk_paned_add1(GTK_PANED(pane),
+ pidgin_make_scrollable(lv->treeview, GTK_POLICY_NEVER, GTK_POLICY_ALWAYS, GTK_SHADOW_IN, -1, -1));
populate_log_tree(lv);
============================================================
--- pidgin/gtkroomlist.c f846769e0268f5388753bb7b70c891f368daf247
+++ pidgin/gtkroomlist.c f8ac4c12c977283487864cf8a5259b9fa504a696
@@ -548,15 +548,8 @@ pidgin_roomlist_dialog_new_with_account(
pidgin_add_widget_to_vbox(GTK_BOX(vbox2), _("_Account:"), NULL, dialog->account_widget, TRUE, NULL);
/* scrolled window */
- dialog->sw = gtk_scrolled_window_new(NULL, NULL);
- gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(dialog->sw),
- GTK_SHADOW_IN);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(dialog->sw),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_AUTOMATIC);
+ dialog->sw = pidgin_make_scrollable(NULL, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, GTK_SHADOW_IN, -1, 250);
gtk_box_pack_start(GTK_BOX(vbox2), dialog->sw, TRUE, TRUE, 0);
- gtk_widget_set_size_request(dialog->sw, -1, 250);
- gtk_widget_show(dialog->sw);
/* progress bar */
dialog->progress = gtk_progress_bar_new();
============================================================
--- pidgin/gtkimhtmltoolbar.c c3c7078c5a2582604ac8716a8450b76458e6ea8a
+++ pidgin/gtkimhtmltoolbar.c ce1bba421fc917e85fb2149252c224ea5ccf9ffb
@@ -858,14 +858,9 @@ insert_smiley_cb(GtkWidget *smiley, GtkI
g_signal_connect(G_OBJECT(dialog), "button-press-event", (GCallback)smiley_dialog_input_cb, toolbar);
}
- scrolled = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW (scrolled), GTK_SHADOW_NONE);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (scrolled),
- GTK_POLICY_NEVER, GTK_POLICY_NEVER);
+
+ scrolled = pidgin_make_scrollable(smiley_table, GTK_POLICY_NEVER, GTK_POLICY_NEVER, GTK_SHADOW_NONE, -1, -1);
gtk_box_pack_start(GTK_BOX(vbox), scrolled, TRUE, TRUE, 0);
- gtk_widget_show(scrolled);
-
- gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled), smiley_table);
gtk_widget_show(smiley_table);
viewport = gtk_widget_get_parent(smiley_table);
@@ -890,8 +885,10 @@ insert_smiley_cb(GtkWidget *smiley, GtkI
* makes one or both scrollbars visible (sometimes).
* I too think this hack is gross. But I couldn't find a better way -- sadrul */
gtk_window_set_resizable(GTK_WINDOW(dialog), TRUE);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (scrolled),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ g_object_set(G_OBJECT(scrolled),
+ "hscrollbar-policy", GTK_POLICY_AUTOMATIC,
+ "vscrollbar-policy", GTK_POLICY_AUTOMATIC,
+ NULL);
#ifdef _WIN32
winpidgin_ensure_onscreen(dialog);
============================================================
--- pidgin/gtksavedstatuses.c baf9702ed3a86eeed8467628a74c8e6219362f9d
+++ pidgin/gtksavedstatuses.c 141ac008e46b318c9b9943cbe757b8203b5154b5
@@ -438,20 +438,11 @@ create_saved_status_list(StatusWindow *d
static GtkWidget *
create_saved_status_list(StatusWindow *dialog)
{
- GtkWidget *sw;
GtkWidget *treeview;
GtkTreeSelection *sel;
GtkTreeViewColumn *column;
GtkCellRenderer *renderer;
- /* Create the scrolled window */
- sw = gtk_scrolled_window_new(0, 0);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_ALWAYS);
- gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
- GTK_SHADOW_IN);
-
/* Create the list model */
dialog->model = gtk_list_store_new(STATUS_WINDOW_NUM_COLUMNS,
G_TYPE_STRING,
@@ -472,8 +463,6 @@ create_saved_status_list(StatusWindow *d
g_signal_connect(G_OBJECT(sel), "changed",
G_CALLBACK(status_selected_cb), dialog);
- gtk_container_add(GTK_CONTAINER(sw), treeview);
-
/* Add columns */
column = gtk_tree_view_column_new();
gtk_tree_view_column_set_title(column, _("Title"));
@@ -527,9 +516,9 @@ create_saved_status_list(StatusWindow *d
/* Populate list */
populate_saved_status_list(dialog);
- gtk_widget_show_all(sw);
+ gtk_widget_show_all(treeview);
- return sw;
+ return pidgin_make_scrollable(treeview, GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS, GTK_SHADOW_IN, -1, -1);
}
static gboolean
@@ -1092,7 +1081,6 @@ pidgin_status_editor_show(gboolean edit,
GtkWidget *entry;
GtkWidget *frame;
GtkWidget *hbox;
- GtkWidget *sw;
GtkWidget *text;
GtkWidget *toolbar;
GtkWidget *vbox;
@@ -1181,14 +1169,6 @@ pidgin_status_editor_show(gboolean edit,
dbox = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
gtk_container_add(GTK_CONTAINER(expander), dbox);
- /* Different status message treeview */
- sw = gtk_scrolled_window_new(NULL, NULL);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
- gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
- GTK_SHADOW_IN);
- gtk_box_pack_start(GTK_BOX(dbox), sw, TRUE, TRUE, 0);
-
/* Create the list model */
dialog->model = gtk_list_store_new(STATUS_EDITOR_NUM_COLUMNS,
G_TYPE_POINTER,
@@ -1205,7 +1185,9 @@ pidgin_status_editor_show(gboolean edit,
dialog->treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(dialog->model));
gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(dialog->treeview), TRUE);
gtk_widget_set_size_request(dialog->treeview, -1, 150);
- gtk_container_add(GTK_CONTAINER(sw), dialog->treeview);
+ gtk_box_pack_start(GTK_BOX(dbox),
+ pidgin_make_scrollable(dialog->treeview, GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS, GTK_SHADOW_IN, -1, -1),
+ TRUE, TRUE, 0);
/* Add columns */
status_editor_add_columns(dialog);
============================================================
--- pidgin/gtkstatusbox.c f13b3aa1c8ca925ee8ab22d6b374c1f5565ef2d1
+++ pidgin/gtkstatusbox.c 72c8d57eae71c4a0660bab63eee2cf76f71e30fc
@@ -1308,15 +1308,19 @@ pidgin_status_box_list_position (PidginS
*width = GTK_WIDGET(status_box)->allocation.width;
hpolicy = vpolicy = GTK_POLICY_NEVER;
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (status_box->scrolled_window),
- hpolicy, vpolicy);
+ g_object_set(G_OBJECT(status_box->scrolled_window),
+ "hscrollbar-policy", hpolicy,
+ "vscrollbar-policy", vpolicy,
+ NULL);
gtk_widget_size_request (status_box->popup_frame, &popup_req);
if (popup_req.width > *width)
{
hpolicy = GTK_POLICY_ALWAYS;
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (status_box->scrolled_window),
- hpolicy, vpolicy);
+ g_object_set(G_OBJECT(status_box->scrolled_window),
+ "hscrollbar-policy", hpolicy,
+ "vscrollbar-policy", vpolicy,
+ NULL);
gtk_widget_size_request (status_box->popup_frame, &popup_req);
}
@@ -1351,8 +1355,10 @@ pidgin_status_box_list_position (PidginS
{
vpolicy = GTK_POLICY_ALWAYS;
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (status_box->scrolled_window),
- hpolicy, vpolicy);
+ g_object_set(G_OBJECT(status_box->scrolled_window),
+ "hscrollbar-policy", hpolicy,
+ "vscrollbar-policy", vpolicy,
+ NULL);
}
}
@@ -1795,19 +1801,6 @@ pidgin_status_box_init (PidginStatusBox
gtk_widget_show (status_box->popup_frame);
- status_box->scrolled_window = gtk_scrolled_window_new (NULL, NULL);
-
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (status_box->scrolled_window),
- GTK_POLICY_NEVER,
- GTK_POLICY_NEVER);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (status_box->scrolled_window),
- GTK_SHADOW_NONE);
-
- gtk_widget_show (status_box->scrolled_window);
-
- gtk_container_add (GTK_CONTAINER (status_box->popup_frame),
- status_box->scrolled_window);
-
status_box->tree_view = gtk_tree_view_new ();
sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (status_box->tree_view));
gtk_tree_selection_set_mode (sel, GTK_SELECTION_BROWSE);
@@ -1826,7 +1819,11 @@ pidgin_status_box_init (PidginStatusBox
gtk_tree_view_column_set_attributes(status_box->column, icon_rend, "stock-id", ICON_STOCK_COLUMN, NULL);
gtk_tree_view_column_set_attributes(status_box->column, text_rend, "markup", TEXT_COLUMN, NULL);
gtk_tree_view_column_set_attributes(status_box->column, emblem_rend, "stock-id", EMBLEM_COLUMN, "visible", EMBLEM_VISIBLE_COLUMN, NULL);
- gtk_container_add(GTK_CONTAINER(status_box->scrolled_window), status_box->tree_view);
+
+ status_box->scrolled_window = pidgin_make_scrollable(status_box->tree_view, GTK_POLICY_NEVER, GTK_POLICY_NEVER, GTK_SHADOW_NONE, -1, -1);
+ gtk_container_add (GTK_CONTAINER (status_box->popup_frame),
+ status_box->scrolled_window);
+
gtk_widget_show(status_box->tree_view);
gtk_tree_view_set_search_column(GTK_TREE_VIEW(status_box->tree_view), TEXT_COLUMN);
gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(status_box->tree_view),
============================================================
--- pidgin/plugins/xmppconsole.c f93483d776358849885f54366f68035dd30aa22e
+++ pidgin/plugins/xmppconsole.c 9e25d1eeabf0da6f6a01a3228263b86449daa299
@@ -744,7 +744,6 @@ create_console(PurplePluginAction *actio
create_console(PurplePluginAction *action)
{
GtkWidget *vbox = gtk_vbox_new(FALSE, 6);
- GtkWidget *sw = gtk_scrolled_window_new(NULL, NULL);
GtkWidget *label;
GtkTextBuffer *buffer;
GtkWidget *toolbar;
@@ -784,16 +783,13 @@ create_console(PurplePluginAction *actio
gtk_box_pack_start(GTK_BOX(console->hbox), console->dropdown, TRUE, TRUE, 0);
g_signal_connect(G_OBJECT(console->dropdown), "changed", G_CALLBACK(dropdown_changed_cb), NULL);
- gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_ETCHED_IN);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
-
console->imhtml = gtk_imhtml_new(NULL, NULL);
- gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0);
if (console->count == 0)
gtk_imhtml_append_text(GTK_IMHTML(console->imhtml),
_("<font color='#777777'>Not connected to XMPP</font>"), 0);
- gtk_container_add(GTK_CONTAINER(sw), console->imhtml);
+ gtk_box_pack_start(GTK_BOX(vbox),
+ pidgin_make_scrollable(console->imhtml, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, GTK_SHADOW_ETCHED_IN, -1, -1),
+ TRUE, TRUE, 0);
toolbar = gtk_toolbar_new();
button = gtk_tool_button_new(NULL, "<iq/>");
@@ -810,21 +806,16 @@ create_console(PurplePluginAction *actio
gtk_box_pack_start(GTK_BOX(vbox), toolbar, FALSE, FALSE, 0);
- sw = gtk_scrolled_window_new(NULL, NULL);
- gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_ETCHED_IN);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
-
console->entry = gtk_imhtml_new(NULL, NULL);
gtk_imhtml_set_whole_buffer_formatting_only(GTK_IMHTML(console->entry), TRUE);
g_signal_connect(G_OBJECT(console->entry),"message_send", G_CALLBACK(message_send_cb), console);
- gtk_box_pack_start(GTK_BOX(vbox), sw, FALSE, FALSE, 0);
- gtk_container_add(GTK_CONTAINER(sw), console->entry);
+ console->sw = pidgin_make_scrollable(console->entry, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, GTK_SHADOW_ETCHED_IN, -1, -1);
+ gtk_box_pack_start(GTK_BOX(vbox), console->sw, FALSE, FALSE, 0);
gtk_imhtml_set_editable(GTK_IMHTML(console->entry), TRUE);
buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(console->entry));
g_signal_connect(G_OBJECT(buffer), "changed", G_CALLBACK(entry_changed_cb), NULL);
- console->sw = sw;
+
entry_changed_cb(buffer, NULL);
gtk_widget_show_all(console->window);
============================================================
--- pidgin/gtkcertmgr.c 9bc0babab03962ca023733767603d5753008612d
+++ pidgin/gtkcertmgr.c 0a08c137d05cd3780097071dd53a38089b7b5718
@@ -390,7 +390,6 @@ tls_peers_mgmt_build(void)
{
GtkWidget *bbox;
GtkListStore *store;
- GtkWidget *sw;
/* This block of variables will end up in tpm_dat */
GtkTreeView *listview;
@@ -417,16 +416,6 @@ tls_peers_mgmt_build(void)
g_signal_connect(G_OBJECT(mgmt_widget), "destroy",
G_CALLBACK(tls_peers_mgmt_destroy), NULL);
- /* Scrolled window */
- sw = gtk_scrolled_window_new(NULL,NULL);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
- gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN);
- gtk_box_pack_start(GTK_BOX(mgmt_widget), GTK_WIDGET(sw),
- TRUE, TRUE, /* Take up lots of space */
- 0);
- gtk_widget_show(GTK_WIDGET(sw));
-
/* List view */
store = gtk_list_store_new(TPM_N_COLUMNS, G_TYPE_STRING);
@@ -463,7 +452,10 @@ tls_peers_mgmt_build(void)
g_signal_connect(G_OBJECT(select), "changed",
G_CALLBACK(tls_peers_mgmt_select_chg_cb), NULL);
- gtk_container_add(GTK_CONTAINER(sw), GTK_WIDGET(listview));
+ gtk_box_pack_start(GTK_BOX(mgmt_widget),
+ pidgin_make_scrollable(listview, GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS, GTK_SHADOW_IN, -1, -1),
+ TRUE, TRUE, /* Take up lots of space */
+ 0);
gtk_widget_show(GTK_WIDGET(listview));
/* Fill the list for the first time */
============================================================
--- pidgin/plugins/gevolution/add_buddy_dialog.c cd855a4aa8094ec55c3480bcc0b7893f1593beff
+++ pidgin/plugins/gevolution/add_buddy_dialog.c d71eed910e29152ad031c254fdbacdde37de1827
@@ -430,7 +430,6 @@ gevo_add_buddy_dialog_show(PurpleAccount
{
GevoAddBuddyDialog *dialog;
GtkWidget *button;
- GtkWidget *sw;
GtkWidget *label;
GtkWidget *vbox;
GtkWidget *hbox;
@@ -510,16 +509,6 @@ gevo_add_buddy_dialog_show(PurpleAccount
g_signal_connect(G_OBJECT(button), "clicked",
G_CALLBACK(clear_cb), dialog);
- /* Scrolled Window */
- sw = gtk_scrolled_window_new(0, 0);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_ALWAYS);
- gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
- GTK_SHADOW_IN);
- gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0);
- gtk_widget_show(sw);
-
/* Create the list model for the treeview. */
dialog->model = gtk_list_store_new(NUM_COLUMNS,
G_TYPE_STRING, GDK_TYPE_PIXBUF,
@@ -529,7 +518,9 @@ gevo_add_buddy_dialog_show(PurpleAccount
dialog->treeview =
gtk_tree_view_new_with_model(GTK_TREE_MODEL(dialog->model));
gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(dialog->treeview), TRUE);
- gtk_container_add(GTK_CONTAINER(sw), dialog->treeview);
+ gtk_box_pack_start(GTK_BOX(vbox),
+ pidgin_make_scrollable(dialog->treeview, GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS, GTK_SHADOW_IN, -1, -1),
+ TRUE, TRUE, 0);
gtk_widget_show(dialog->treeview);
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->treeview));
============================================================
--- pidgin/plugins/gevolution/assoc-buddy.c 16df7816ce3280658213da2120aa97abcf83e442
+++ pidgin/plugins/gevolution/assoc-buddy.c b5ab4f833bbd64ce28dbd776ae755c0aaed995ff
@@ -314,7 +314,6 @@ gevo_associate_buddy_dialog_new(PurpleBu
{
GevoAssociateBuddyDialog *dialog;
GtkWidget *button;
- GtkWidget *sw;
GtkWidget *label;
GtkWidget *vbox;
GtkWidget *hbox;
@@ -389,16 +388,6 @@ gevo_associate_buddy_dialog_new(PurpleBu
g_signal_connect(G_OBJECT(button), "clicked",
G_CALLBACK(clear_cb), dialog);
- /* Scrolled Window */
- sw = gtk_scrolled_window_new(0, 0);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_ALWAYS);
- gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
- GTK_SHADOW_IN);
- gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0);
- gtk_widget_show(sw);
-
/* Create the list model for the treeview. */
dialog->model = gtk_list_store_new(NUM_COLUMNS,
G_TYPE_STRING, G_TYPE_POINTER);
@@ -407,7 +396,9 @@ gevo_associate_buddy_dialog_new(PurpleBu
dialog->treeview = gtk_tree_view_new_with_model(
GTK_TREE_MODEL(dialog->model));
gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(dialog->treeview), TRUE);
- gtk_container_add(GTK_CONTAINER(sw), dialog->treeview);
+ gtk_box_pack_start(GTK_BOX(vbox),
+ pidgin_make_scrollable(dialog->treeview, GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS, GTK_SHADOW_IN, -1, -1),
+ TRUE, TRUE, 0);
gtk_widget_show(dialog->treeview);
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->treeview));
@@ -437,19 +428,10 @@ gevo_associate_buddy_dialog_new(PurpleBu
* User details
*/
- /* Scrolled Window */
- sw = gtk_scrolled_window_new(0, 0);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
- GTK_POLICY_NEVER,
- GTK_POLICY_ALWAYS);
- gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
- GTK_SHADOW_IN);
- gtk_container_add(GTK_CONTAINER(expander), sw);
- gtk_widget_show(sw);
-
/* Textview */
dialog->imhtml = gtk_imhtml_new(NULL, NULL);
- gtk_container_add(GTK_CONTAINER(sw), dialog->imhtml);
+ gtk_container_add(GTK_CONTAINER(expander),
+ pidgin_make_scrollable(dialog->imhtml, GTK_POLICY_NEVER, GTK_POLICY_ALWAYS, GTK_SHADOW_IN, -1, -1));
gtk_widget_show(dialog->imhtml);
/* Separator. */
============================================================
--- pidgin/plugins/gevolution/gevolution.c 0e9c8439a1254c470087bb6bcf2321525c5b774d
+++ pidgin/plugins/gevolution/gevolution.c e82d07077f62e85a1e318e1f77fb093b2502e1a2
@@ -417,7 +417,6 @@ get_config_frame(PurplePlugin *plugin)
GtkWidget *ret;
GtkWidget *vbox;
GtkWidget *label;
- GtkWidget *sw;
GtkWidget *treeview;
GtkTreeViewColumn *column;
GtkCellRenderer *renderer;
@@ -439,17 +438,6 @@ get_config_frame(PurplePlugin *plugin)
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
gtk_widget_show(label);
- /* Scrolled window */
- sw = gtk_scrolled_window_new(0, 0);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_ALWAYS);
- gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
- GTK_SHADOW_IN);
- gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0);
- gtk_widget_set_size_request(sw, 300, 300);
- gtk_widget_show(sw);
-
/* Create the list model for the treeview. */
model = gtk_list_store_new(NUM_COLUMNS,
G_TYPE_BOOLEAN, GDK_TYPE_PIXBUF,
@@ -458,7 +446,9 @@ get_config_frame(PurplePlugin *plugin)
/* Setup the treeview */
treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(model));
gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(treeview), TRUE);
- gtk_container_add(GTK_CONTAINER(sw), treeview);
+ gtk_box_pack_start(GTK_BOX(vbox),
+ pidgin_make_scrollable(treeview, GTK_POLICY_AUTO, GTK_POLICY_ALWAYS, GTK_SHADOW_IN, 300, 300),
+ TRUE, TRUE, 0);
gtk_widget_show(treeview);
/* Setup the column */
============================================================
--- pidgin/gtksmiley.c fee12e52708f755bfcf70b9641094162b4b5dee3
+++ pidgin/gtksmiley.c 6d46183c5d632080616458ba17af366c8c7947e6
@@ -774,7 +774,6 @@ static GtkWidget *smiley_list_create(Smi
static GtkWidget *smiley_list_create(SmileyManager *dialog)
{
- GtkWidget *sw;
GtkWidget *treeview;
GtkTreeSelection *sel;
GtkTargetEntry te[3] = {
@@ -783,14 +782,6 @@ static GtkWidget *smiley_list_create(Smi
{"STRING", 0, 2}
};
- sw = gtk_scrolled_window_new(NULL, NULL);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
- GTK_SHADOW_IN);
- gtk_widget_show(sw);
-
/* Create the list model */
dialog->model = gtk_list_store_new(N_COL,
GDK_TYPE_PIXBUF, /* ICON */
@@ -807,7 +798,6 @@ static GtkWidget *smiley_list_create(Smi
sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview));
gtk_tree_selection_set_mode(sel, GTK_SELECTION_MULTIPLE);
- gtk_container_add(GTK_CONTAINER(sw), treeview);
g_signal_connect(G_OBJECT(sel), "changed", G_CALLBACK(smile_selected_cb), dialog);
g_signal_connect(G_OBJECT(treeview), "row_activated", G_CALLBACK(smiley_edit_cb), dialog);
@@ -822,7 +812,7 @@ static GtkWidget *smiley_list_create(Smi
add_columns(treeview, dialog);
populate_smiley_list(dialog);
- return sw;
+ return pidgin_make_scrollable(treeview, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, GTK_SHADOW_IN, -1, -1);
}
static void refresh_list()
============================================================
--- pidgin/plugins/disco/gtkdisco.c b31dab5b2ef8b0a1647f6964af85b514f99dcd5a
+++ pidgin/plugins/disco/gtkdisco.c fc4d7d8bcbf24fa130fc87cd95bdd36f8256ea78
@@ -651,15 +651,8 @@ PidginDiscoDialog *pidgin_disco_dialog_n
pidgin_add_widget_to_vbox(GTK_BOX(vbox2), _("_Account:"), NULL, dialog->account_widget, TRUE, NULL);
/* scrolled window */
- dialog->sw = gtk_scrolled_window_new(NULL, NULL);
- gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(dialog->sw),
- GTK_SHADOW_IN);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(dialog->sw),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_AUTOMATIC);
+ dialog->sw = pidgin_make_scrollable(NULL, GTK_POLICY_ALWAYS, GTK_POLICY_ALWAYS, GTK_SHADOW_IN, -1, 250);
gtk_box_pack_start(GTK_BOX(vbox2), dialog->sw, TRUE, TRUE, 0);
- gtk_widget_set_size_request(dialog->sw, -1, 250);
- gtk_widget_show(dialog->sw);
/* progress bar */
dialog->progress = gtk_progress_bar_new();
More information about the Commits
mailing list