mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-10 07:50:19 +00:00
Updated the GTK3 Help menu icon constant so _Contents now uses help-contents instead of help-browser, which fixes the oversized icon appearance on Linux and keeps it consistent with other menu icons.
Updated menu_setting_foreach() to safely handle sessions where menu_item[id] is still NULL by storing it in a local pointer and only toggling check state when it exists. This avoids GTK/GLib criticals during layout/menu synchronization paths while preserving normal behavior for initialized menu items. Fixed the a few dialog box layout so the scrolled keybindings list expands to fill available vertical space in the window. It now packs the scroller into the parent GtkBox with expand/fill enabled (gtk_box_pack_start(..., TRUE, TRUE, 0)) instead of adding it as a generic container child. This allows the window height to be fully utilized.
This commit is contained in:
@@ -854,7 +854,7 @@ dcc_configure_cb (GtkWindow *win, GdkEventConfigure *event, gpointer data)
|
||||
int
|
||||
fe_dcc_open_recv_win (int passive)
|
||||
{
|
||||
GtkWidget *radio, *table, *vbox, *bbox, *view, *exp, *detailbox;
|
||||
GtkWidget *radio, *table, *vbox, *bbox, *view, *view_scrolled, *exp, *detailbox;
|
||||
GtkListStore *store;
|
||||
GSList *group;
|
||||
char buf[128];
|
||||
@@ -877,6 +877,11 @@ fe_dcc_open_recv_win (int passive)
|
||||
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
|
||||
G_TYPE_STRING, G_TYPE_POINTER, PALETTE_GDK_TYPE);
|
||||
view = gtkutil_treeview_new (vbox, GTK_TREE_MODEL (store), NULL, -1);
|
||||
view_scrolled = gtk_widget_get_parent (view);
|
||||
gtk_widget_set_hexpand (view_scrolled, TRUE);
|
||||
gtk_widget_set_vexpand (view_scrolled, TRUE);
|
||||
gtk_widget_set_hexpand (view, TRUE);
|
||||
gtk_widget_set_vexpand (view, TRUE);
|
||||
gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (view), TRUE);
|
||||
/* Up/Down Icon column */
|
||||
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (view), -1, NULL,
|
||||
@@ -1158,7 +1163,7 @@ dcc_chat_dclick_cb (GtkTreeView *view, GtkTreePath *path,
|
||||
int
|
||||
fe_dcc_open_chat_win (int passive)
|
||||
{
|
||||
GtkWidget *view, *vbox, *bbox;
|
||||
GtkWidget *view, *vbox, *bbox, *scroll;
|
||||
GtkListStore *store;
|
||||
char buf[128];
|
||||
|
||||
@@ -1178,9 +1183,11 @@ fe_dcc_open_chat_win (int passive)
|
||||
gtk_box_set_spacing (GTK_BOX (vbox), 3);
|
||||
|
||||
store = gtk_list_store_new (CN_COLUMNS, G_TYPE_STRING, G_TYPE_STRING,
|
||||
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
|
||||
G_TYPE_POINTER, PALETTE_GDK_TYPE);
|
||||
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
|
||||
G_TYPE_POINTER, PALETTE_GDK_TYPE);
|
||||
view = gtkutil_treeview_new (vbox, GTK_TREE_MODEL (store), NULL, -1);
|
||||
scroll = gtk_widget_get_parent (view);
|
||||
gtk_box_set_child_packing (GTK_BOX (vbox), scroll, TRUE, TRUE, 0, GTK_PACK_START);
|
||||
|
||||
dcc_add_column (view, CCOL_STATUS, CCOL_COLOR, _("Status"), FALSE);
|
||||
dcc_add_column (view, CCOL_NICK, CCOL_COLOR, _("Nick"), FALSE);
|
||||
|
||||
@@ -329,7 +329,7 @@ editlist_treeview_new (GtkWidget *box, char *title1, char *title2)
|
||||
gtk_tree_view_column_set_min_width (col, 100);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (scroll), view);
|
||||
gtk_container_add (GTK_CONTAINER (box), scroll);
|
||||
gtk_box_pack_start (GTK_BOX (box), scroll, TRUE, TRUE, 0);
|
||||
gtk_widget_show_all (box);
|
||||
|
||||
return view;
|
||||
|
||||
@@ -798,7 +798,7 @@ key_dialog_treeview_new (GtkWidget *box)
|
||||
gtk_tree_view_column_set_resizable (col, TRUE);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (scroll), view);
|
||||
gtk_container_add (GTK_CONTAINER (box), scroll);
|
||||
gtk_box_pack_start (GTK_BOX (box), scroll, TRUE, TRUE, 0);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
@@ -1153,8 +1153,15 @@ gtkutil_treeview_new (GtkWidget *box, GtkTreeModel *model,
|
||||
|
||||
win = gtk_scrolled_window_new (0, 0);
|
||||
gtk_container_add (GTK_CONTAINER (box), win);
|
||||
if (GTK_IS_BOX (box))
|
||||
{
|
||||
gtk_box_set_child_packing (GTK_BOX (box), win, TRUE, TRUE, 0,
|
||||
GTK_PACK_START);
|
||||
}
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (win),
|
||||
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
|
||||
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
|
||||
gtk_widget_set_vexpand (win, TRUE);
|
||||
gtk_widget_set_hexpand (win, TRUE);
|
||||
gtk_widget_show (win);
|
||||
|
||||
view = gtk_tree_view_new_with_model (model);
|
||||
|
||||
@@ -919,11 +919,18 @@ menu_setting_foreach (void (*callback) (session *), int id, guint state)
|
||||
if (sess->gui->is_tab)
|
||||
maindone = TRUE;
|
||||
if (id != -1)
|
||||
{
|
||||
GtkWidget *menu_item = sess->gui->menu_item[id];
|
||||
|
||||
if (menu_item != NULL)
|
||||
{
|
||||
#if HAVE_GTK3
|
||||
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (sess->gui->menu_item[id]), state);
|
||||
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_item), state);
|
||||
#else
|
||||
GTK_CHECK_MENU_ITEM (sess->gui->menu_item[id])->active = state;
|
||||
GTK_CHECK_MENU_ITEM (menu_item)->active = state;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
if (callback)
|
||||
callback (sess);
|
||||
}
|
||||
@@ -1958,7 +1965,7 @@ menu_about (GtkWidget *wid, gpointer sess)
|
||||
#define ICON_SAVE "document-save"
|
||||
#define ICON_SEARCH "edit-find"
|
||||
#define ICON_FIND "edit-find"
|
||||
#define ICON_HELP "help-browser"
|
||||
#define ICON_HELP "help-contents"
|
||||
#define ICON_ABOUT "help-about"
|
||||
#endif
|
||||
#if !HAVE_GTK3
|
||||
|
||||
@@ -145,6 +145,7 @@ notify_treeview_new (GtkWidget *box)
|
||||
{
|
||||
GtkListStore *store;
|
||||
GtkWidget *view;
|
||||
GtkWidget *scroll;
|
||||
GtkTreeViewColumn *col;
|
||||
int col_id;
|
||||
|
||||
@@ -164,6 +165,8 @@ notify_treeview_new (GtkWidget *box)
|
||||
STATUS_COLUMN, _("Status"),
|
||||
SERVER_COLUMN, _("Network"),
|
||||
SEEN_COLUMN, _("Last Seen"), -1);
|
||||
scroll = gtk_widget_get_parent (view);
|
||||
gtk_box_set_child_packing (GTK_BOX (box), scroll, TRUE, TRUE, 0, GTK_PACK_START);
|
||||
gtk_tree_view_column_set_expand (gtk_tree_view_get_column (GTK_TREE_VIEW (view), 0), TRUE);
|
||||
|
||||
for (col_id=0; (col = gtk_tree_view_get_column (GTK_TREE_VIEW (view), col_id));
|
||||
|
||||
@@ -98,13 +98,16 @@ static GtkWidget *
|
||||
url_treeview_new (GtkWidget *box)
|
||||
{
|
||||
GtkListStore *store;
|
||||
GtkWidget *view;
|
||||
GtkWidget *scroll, *view;
|
||||
|
||||
store = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING);
|
||||
g_return_val_if_fail (store != NULL, NULL);
|
||||
|
||||
view = gtkutil_treeview_new (box, GTK_TREE_MODEL (store), NULL,
|
||||
URL_COLUMN, _("URL"), -1);
|
||||
scroll = gtk_widget_get_parent (view);
|
||||
gtk_widget_set_hexpand (scroll, TRUE);
|
||||
gtk_widget_set_vexpand (scroll, TRUE);
|
||||
g_signal_connect (G_OBJECT (view), "button_press_event",
|
||||
G_CALLBACK (url_treeview_url_clicked_cb), NULL);
|
||||
/* don't want column headers */
|
||||
|
||||
Reference in New Issue
Block a user