Skip to content

Commit

Permalink
Fix Windows build
Browse files Browse the repository at this point in the history
- Rename blink_item to tray_toggle_item
- Enable tray_toggle_item and tray_toggle_cb unconditionally
  • Loading branch information
konsolebox committed May 2, 2024
1 parent 7e5b073 commit 1a20650
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/fe-gtk/plugin-tray.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,19 +467,17 @@ tray_make_item (GtkWidget *menu, char *label, void *callback, void *userdata)
return item;
}

#ifndef WIN32
static void
tray_toggle_cb (GtkCheckMenuItem *item, unsigned int *setting)
{
*setting = gtk_check_menu_item_get_active (item);
}

static void
blink_item (unsigned int *setting, GtkWidget *menu, char *label)
tray_toggle_item (unsigned int *setting, GtkWidget *menu, char *label)
{
menu_toggle_item (label, menu, tray_toggle_cb, setting, *setting);
}
#endif

static void
tray_menu_destroy (GtkWidget **menu_p, gpointer userdata)
Expand Down Expand Up @@ -554,10 +552,10 @@ tray_menu_cb (GtkWidget *widget, guint button, guint time, gpointer userdata)

#ifndef WIN32 /* submenus are buggy on win32 */
submenu = mg_submenu (menu, _("_Blink on"));
blink_item (&prefs.hex_input_tray_chans, submenu, _("Channel Message"));
blink_item (&prefs.hex_input_tray_priv, submenu, _("Private Message"));
blink_item (&prefs.hex_input_tray_hilight, submenu, _("Highlighted Message"));
/*blink_item (BIT_FILEOFFER, submenu, _("File Offer"));*/
tray_toggle_item (&prefs.hex_input_tray_chans, submenu, _("Channel Message"));
tray_toggle_item (&prefs.hex_input_tray_priv, submenu, _("Private Message"));
tray_toggle_item (&prefs.hex_input_tray_hilight, submenu, _("Highlighted Message"));
/*tray_toggle_item (BIT_FILEOFFER, submenu, _("File Offer"));*/

submenu = mg_submenu (menu, _("_Change status"));
#else /* so show away/back in main tray menu */
Expand All @@ -572,8 +570,7 @@ tray_menu_cb (GtkWidget *widget, guint button, guint time, gpointer userdata)
if (away_status == 2)
gtk_widget_set_sensitive (item, FALSE);

menu_toggle_item (_("Show notifications"), menu, tray_toggle_cb, &prefs.hex_input_tray_show_alerts,
prefs.hex_input_tray_show_alerts);
tray_toggle_item (&prefs.hex_input_tray_show_alerts, menu, _("Show notifications"));

menu_add_plugin_items (menu, "\x5$TRAY", NULL);

Expand Down

0 comments on commit 1a20650

Please sign in to comment.