Skip to content

Commit

Permalink
Change ‘notification area’ references to ‘system tray’
Browse files Browse the repository at this point in the history
This changes references to ‘notification area’ to ‘system tray’, as the terminology used in Windows changed in Windows 11.
  • Loading branch information
reupen committed Dec 17, 2024
1 parent dad4073 commit 0b31831
Show file tree
Hide file tree
Showing 20 changed files with 78 additions and 76 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@
(The confirmation dialogue box can be bypassed by holding down Shift while
clicking the button.)

- References to ‘notification area’ were changed to ‘system tray’ to align with
the current Windows terminology.
[[#1035](https://github.com/reupen/columns_ui/pull/1035)]

- Some diagnostic logging to the foobar2000 console was added when unexpected
errors occur. [[#916](https://github.com/reupen/columns_ui/pull/916)]

Expand Down
2 changes: 1 addition & 1 deletion foo_ui_columns/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ static PreferencesTab* g_tabs[] = {
g_get_tab_main(),
g_get_tab_status_bar(),
g_get_tab_status_pane(),
g_get_tab_sys(),
g_get_tab_system_tray(),
g_get_tab_artwork(),
};

Expand Down
2 changes: 1 addition & 1 deletion foo_ui_columns/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ PreferencesTab* g_get_tab_layout();
PreferencesTab* g_get_tab_artwork();
PreferencesTab* g_get_tab_display2();
PreferencesTab* g_get_tab_pview_artwork();
PreferencesTab* g_get_tab_sys();
PreferencesTab* g_get_tab_system_tray();
PreferencesTab* g_get_tab_playlist_switcher();
PreferencesTab* g_get_tab_playlist_tabs();
PreferencesTab* g_get_tab_playlist_dd();
Expand Down
8 changes: 4 additions & 4 deletions foo_ui_columns/config_items.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const char* default_status_bar_script
"$if(%ispaused%,Paused,Playing) | %codec% | %bitrate% kbps | %samplerate% Hz"
" | $caps(%channels%) | %playback_time%[ / %length%]";

const char* default_notification_icon_script
= "//This is the default script for the content of the notification area icon tooltip "
const char* default_system_tray_icon_script
= "//This is the default script for the content of the system tray icon tooltip "
"during playback.\r\n\r\n"
"[%title%]$crlf()[%artist%][$crlf()%album%]";

Expand All @@ -31,9 +31,9 @@ fbh::ConfigString config_status_bar_script(
GUID{0xb5ca645b, 0xa5e0, 0x4c70, {0xa5, 0x98, 0xcd, 0x62, 0x5c, 0xf3, 0xcc, 0x37}}, default_status_bar_script,
[](auto&&) { cui::status_bar::regenerate_text(); });

fbh::ConfigString config_notification_icon_script(
fbh::ConfigString config_system_tray_icon_script(
GUID{0x85d128cf, 0x8b01, 0x4ae9, {0xb8, 0x1c, 0x6b, 0xc4, 0xbe, 0x67, 0x59, 0x9f}},
default_notification_icon_script);
default_system_tray_icon_script);

fbh::ConfigString config_main_window_title_script(
GUID{0x28b799fb, 0xbc22, 0x4e1c, {0xb9, 0x99, 0xf1, 0xe6, 0xb1, 0xf2, 0x60, 0x40}},
Expand Down
2 changes: 1 addition & 1 deletion foo_ui_columns/config_items.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace main_window {
extern fbh::ConfigString config_status_bar_script;
extern fbh::ConfigString config_notification_icon_script;
extern fbh::ConfigString config_system_tray_icon_script;
extern fbh::ConfigString config_main_window_title_script;

enum MetafieldEditingMode {
Expand Down
18 changes: 9 additions & 9 deletions foo_ui_columns/config_vars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ namespace cui::config {
advconfig_branch_factory advconfig_branch_columns_ui(
"Columns UI", advconfig_branch_columns_ui_id, advconfig_branch::guid_branch_display, 0);

advconfig_branch_factory advconfig_branch_notification_area(
"Windows notification area", advconfig_branch_notification_area_id, advconfig_branch_columns_ui_id, 0);
advconfig_branch_factory advconfig_branch_system_tray(
"System tray", advconfig_branch_system_tray_id, advconfig_branch_columns_ui_id, 0);

static GUID advbool_notification_icon_x_buttons_id{
static GUID advbool_system_tray_icon_x_buttons_id{
0xcee3f8cc, 0x7ca6, 0x4277, {0xaa, 0xd4, 0xce, 0xc7, 0xb9, 0xd0, 0x5a, 0x63}};
advconfig_checkbox_factory advbool_notification_icon_x_buttons(
"Use back/forward mouse buttons to skip track when over notification area icon",
advbool_notification_icon_x_buttons_id, advconfig_branch_notification_area_id, 0, false);
advconfig_checkbox_factory advbool_system_tray_icon_x_buttons(
"Use back/forward mouse buttons to skip track when over system tray icon", advbool_system_tray_icon_x_buttons_id,
advconfig_branch_system_tray_id, 0, false);

static GUID advbool_close_to_notification_icon_id{
static GUID advbool_close_to_system_tray_icon_id{
0x41695241, 0x7854, 0x5a5a, {0x4d, 0x69, 0x6b, 0x75, 0x57, 0x52, 0x6c, 0x44}};
advconfig_checkbox_factory advbool_close_to_notification_icon("Close to notification area icon",
advbool_close_to_notification_icon_id, advconfig_branch_notification_area_id, 0, false);
advconfig_checkbox_factory advbool_close_to_system_tray_icon(
"Close to system tray icon", advbool_close_to_system_tray_icon_id, advconfig_branch_system_tray_id, 0, false);

cfg_bool cfg_playlist_tabs_middle_click(
{0x3074ea96, 0x22e7, 0x464a, {0x9d, 0xac, 0xec, 0x9, 0xc0, 0xb4, 0x5e, 0x5a}}, true);
Expand Down
6 changes: 3 additions & 3 deletions foo_ui_columns/config_vars.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ namespace cui::config {

constexpr GUID advconfig_branch_columns_ui_id{
0xd2dd7ffc, 0xf780, 0x4fa3, {0x89, 0x52, 0x38, 0xd8, 0x2c, 0x8c, 0x1e, 0x4b}};
constexpr GUID advconfig_branch_notification_area_id{
constexpr GUID advconfig_branch_system_tray_id{
0x8b39648d, 0x3e4, 0x4748, {0x8d, 0xd3, 0x71, 0x6b, 0x76, 0x8a, 0x39, 0xf0}};

extern advconfig_checkbox_factory advbool_notification_icon_x_buttons;
extern advconfig_checkbox_factory advbool_close_to_notification_icon;
extern advconfig_checkbox_factory advbool_system_tray_icon_x_buttons;
extern advconfig_checkbox_factory advbool_close_to_system_tray_icon;

extern cfg_bool cfg_playlist_tabs_middle_click;
} // namespace cui::config
Expand Down
8 changes: 4 additions & 4 deletions foo_ui_columns/fcl_titles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ class TitlesDataSet : public fcl::dataset {
enum ItemID {
identifier_main_window_title,
identifier_status_bar,
identifier_notification_icon_tooltip,
identifier_system_tray_icon_tooltip,
identifier_copy_command,
identifier_playlist,
identifier_status_pane,
Expand All @@ -406,7 +406,7 @@ class TitlesDataSet : public fcl::dataset {

out.write_item(identifier_status_bar, main_window::config_status_bar_script.get());
out.write_item(identifier_status_pane, status_pane::status_pane_script);
out.write_item(identifier_notification_icon_tooltip, main_window::config_notification_icon_script.get());
out.write_item(identifier_system_tray_icon_tooltip, main_window::config_system_tray_icon_script.get());
out.write_item(identifier_main_window_title, main_window::config_main_window_title_script.get());
}
void set_data(stream_reader* p_reader, size_t stream_size, uint32_t type, fcl::t_import_feedback& feedback,
Expand All @@ -430,9 +430,9 @@ class TitlesDataSet : public fcl::dataset {
reader.read_item(buffer, element_size);
main_window::config_main_window_title_script.set(buffer);
break;
case identifier_notification_icon_tooltip:
case identifier_system_tray_icon_tooltip:
reader.read_item(buffer, element_size);
main_window::config_notification_icon_script.set(buffer);
main_window::config_system_tray_icon_script.set(buffer);
break;
case identifier_status_bar:
reader.read_item(buffer, element_size);
Expand Down
8 changes: 4 additions & 4 deletions foo_ui_columns/foo_ui_columns.rc
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ BEGIN
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,114,161,10
END

IDD_PREFS_NOTIFICATION_AREA DIALOGEX 0, 0, 327, 271
IDD_PREFS_SYSTEM_TRAY DIALOGEX 0, 0, 327, 271
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 400, 0, 0x0
BEGIN
LTEXT "Windows notification area",IDC_TITLE1,7,4,313,16
LTEXT "System tray",IDC_TITLE1,7,4,313,16
CONTROL "Always show icon",IDC_SHOW_SYSTRAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,30,74,10
CONTROL "Minimise to icon",IDC_MINIMISE_TO_SYSTRAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,48,71,10
CONTROL "Use custom icon",IDC_USE_CUSTOM_ICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,66,70,10
Expand Down Expand Up @@ -747,7 +747,7 @@ END

IDD_ITEM_DETAILS_PICK_FONT DIALOGEX 0, 0, 200, 227
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Format code generator Item details"
CAPTION "Format code generator Item details"
FONT 8, "Segoe UI", 400, 0, 0x0
BEGIN
LTEXT "Font family",-1,14,7,47,8
Expand Down Expand Up @@ -795,7 +795,7 @@ BEGIN
BOTTOMMARGIN, 264
END

IDD_PREFS_NOTIFICATION_AREA, DIALOG
IDD_PREFS_SYSTEM_TRAY, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 320
Expand Down
8 changes: 4 additions & 4 deletions foo_ui_columns/foo_ui_columns.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@
<ClCompile Include="filter_fcl.cpp" />
<ClCompile Include="legacy_artwork_config.cpp" />
<ClCompile Include="ng_playlist\config_object_callbacks.cpp" />
<ClCompile Include="notification_area_callbacks.cpp" />
<ClCompile Include="system_tray_callbacks.cpp" />
<ClCompile Include="output_format.cpp" />
<ClCompile Include="playlist_switcher_title_formatting.cpp" />
<ClCompile Include="rename_dialog.cpp" />
Expand Down Expand Up @@ -389,7 +389,7 @@
<ClCompile Include="tab_fonts.cpp" />
<ClCompile Include="tab_global.cpp" />
<ClCompile Include="tab_main.cpp" />
<ClCompile Include="tab_notification_area.cpp" />
<ClCompile Include="tab_system_tray.cpp" />
<ClCompile Include="tab_playlist_tabs.cpp" />
<ClCompile Include="tab_playlist_dd.cpp" />
<ClCompile Include="tab_status_bar.cpp" />
Expand Down Expand Up @@ -420,7 +420,7 @@
<ClCompile Include="helpers.cpp" />
<ClCompile Include="config_host.cpp" />
<ClCompile Include="list_view_panel.cpp" />
<ClCompile Include="notification_area.cpp" />
<ClCompile Include="system_tray.cpp" />
<ClCompile Include="output_device.cpp" />
<ClCompile Include="playlist_item_helpers.cpp" />
<ClCompile Include="rebar_band.cpp" />
Expand Down Expand Up @@ -520,7 +520,7 @@
<ClInclude Include="drop_down_list_toolbar.h" />
<ClInclude Include="filter_search_bar.h" />
<ClInclude Include="list_view_panel.h" />
<ClInclude Include="notification_area.h" />
<ClInclude Include="system_tray.h" />
<ClInclude Include="playlist_item_helpers.h" />
<ClInclude Include="rebar_band.h" />
<ClInclude Include="rename_dialog.h" />
Expand Down
20 changes: 10 additions & 10 deletions foo_ui_columns/foo_ui_columns.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@
<Filter Include="Status bar">
<UniqueIdentifier>{55d1a4ec-5524-4ac3-a61f-d78b064cdf91}</UniqueIdentifier>
</Filter>
<Filter Include="Notification area">
<UniqueIdentifier>{67475e56-3bb2-46a8-8b62-8cf3417c4af0}</UniqueIdentifier>
</Filter>
<Filter Include="Buttons toolbar">
<UniqueIdentifier>{1180d005-d933-4628-b2de-deb1f0f38fd3}</UniqueIdentifier>
</Filter>
Expand Down Expand Up @@ -124,6 +121,9 @@
<Filter Include="Playlist selector toolbar">
<UniqueIdentifier>{0eaa631f-d75d-4656-a064-8a6201707260}</UniqueIdentifier>
</Filter>
<Filter Include="System tray">
<UniqueIdentifier>{67475e56-3bb2-46a8-8b62-8cf3417c4af0}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="config.cpp">
Expand Down Expand Up @@ -202,7 +202,7 @@
<ClCompile Include="tab_main.cpp">
<Filter>Config UI</Filter>
</ClCompile>
<ClCompile Include="tab_notification_area.cpp">
<ClCompile Include="tab_system_tray.cpp">
<Filter>Config UI</Filter>
</ClCompile>
<ClCompile Include="tab_status_bar.cpp">
Expand Down Expand Up @@ -394,8 +394,8 @@
<ClCompile Include="status_bar.cpp">
<Filter>Status bar</Filter>
</ClCompile>
<ClCompile Include="notification_area.cpp">
<Filter>Notification area</Filter>
<ClCompile Include="system_tray.cpp">
<Filter>System tray</Filter>
</ClCompile>
<ClCompile Include="buttons.cpp">
<Filter>Buttons toolbar</Filter>
Expand Down Expand Up @@ -491,8 +491,8 @@
<ClCompile Include="seekbar_callbacks.cpp">
<Filter>Seek bar</Filter>
</ClCompile>
<ClCompile Include="notification_area_callbacks.cpp">
<Filter>Notification area</Filter>
<ClCompile Include="system_tray_callbacks.cpp">
<Filter>System tray</Filter>
</ClCompile>
<ClCompile Include="main_window_callbacks.cpp">
<Filter>Main window</Filter>
Expand Down Expand Up @@ -770,8 +770,8 @@
<ClInclude Include="status_bar.h">
<Filter>Status bar</Filter>
</ClInclude>
<ClInclude Include="notification_area.h">
<Filter>Notification area</Filter>
<ClInclude Include="system_tray.h">
<Filter>System tray</Filter>
</ClInclude>
<ClInclude Include="buttons.h">
<Filter>Buttons toolbar</Filter>
Expand Down
2 changes: 1 addition & 1 deletion foo_ui_columns/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "layout.h"
#include "dark_mode.h"
#include "icons.h"
#include "notification_area.h"
#include "system_tray.h"
#include "status_bar.h"
#include "migrate.h"
#include "legacy_artwork_config.h"
Expand Down
2 changes: 1 addition & 1 deletion foo_ui_columns/main_window.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ enum {
MSG_SET_AOT = WM_USER + 3,
MSG_UPDATE_TITLE,
MSG_RUN_INITIAL_SETUP,
MSG_NOTIFICATION_ICON,
MSG_SYSTEM_TRAY_ICON,
MSG_CREATE_TASKBAR_BUTTONS,
MSG_UPDATE_TASKBAR_BUTTONS
};
Expand Down
8 changes: 4 additions & 4 deletions foo_ui_columns/mw_wnd_proc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "main_window.h"
#include "rebar.h"
#include "status_bar.h"
#include "notification_area.h"
#include "system_tray.h"

extern HWND g_status;
extern bool g_icon_created;
Expand Down Expand Up @@ -179,7 +179,7 @@ LRESULT cui::MainWindow::on_message(HWND wnd, UINT msg, WPARAM wp, LPARAM lp)
m_taskbar_button_images.reset();
break;
case WM_CLOSE:
if (config::advbool_close_to_notification_icon.get()) {
if (config::advbool_close_to_system_tray_icon.get()) {
cfg_go_to_tray = true;
ShowWindow(wnd, SW_MINIMIZE);
} else
Expand Down Expand Up @@ -550,7 +550,7 @@ LRESULT cui::MainWindow::on_message(HWND wnd, UINT msg, WPARAM wp, LPARAM lp)
if (process_keydown(msg, lp, wp))
return 0;
break;
case MSG_NOTIFICATION_ICON:
case MSG_SYSTEM_TRAY_ICON:
if (lp == WM_LBUTTONUP) {
// if (b_wasDown)
standard_commands::main_activate_or_hide();
Expand All @@ -572,7 +572,7 @@ LRESULT cui::MainWindow::on_message(HWND wnd, UINT msg, WPARAM wp, LPARAM lp)
return TRUE;
} else if (lp == WM_MOUSEMOVE) {
} else if (lp == WM_XBUTTONUP) {
if (config::advbool_notification_icon_x_buttons.get()) {
if (config::advbool_system_tray_icon_x_buttons.get()) {
if (g_last_sysray_x1_down && !g_last_sysray_x2_down)
standard_commands::main_previous();
if (g_last_sysray_x2_down && !g_last_sysray_x1_down)
Expand Down
2 changes: 1 addition & 1 deletion foo_ui_columns/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
#define IDD_RENAME_PLAYLIST 200
#define IDD_PREFS_TAB_HOST 201
#define IDD_PREFS_PLAYLIST_TABS 202
#define IDD_PREFS_NOTIFICATION_AREA 203
#define IDD_PREFS_SYSTEM_TRAY 203
#define IDD_SPECTRUM_ANALYSER_OPTIONS 204
#define IDD_BUTTON_COMMAND_PICKER 206
#define IDD_FCL_IMPORT 207
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "pch.h"

#include "notification_area.h"
#include "system_tray.h"
#include "main_window.h"

extern HWND g_status;
Expand All @@ -18,7 +18,7 @@ void update_systray(bool balloon, int btitle, bool force_balloon)

if (track.is_valid()) {
service_ptr_t<titleformat_object> to_systray;
titleformat_compiler::get()->compile_safe(to_systray, main_window::config_notification_icon_script.get());
titleformat_compiler::get()->compile_safe(to_systray, main_window::config_system_tray_icon_script.get());
play_api->playback_format_title_ex(
track, nullptr, title, to_systray, nullptr, play_control::display_level_titles);

Expand All @@ -31,29 +31,29 @@ void update_systray(bool balloon, int btitle, bool force_balloon)
uFixAmpersandChars(title, sys);

if (balloon && (cfg_balloon || force_balloon)) {
uShellNotifyIconEx(NIM_MODIFY, cui::main_window.get_wnd(), 1, MSG_NOTIFICATION_ICON, g_icon, sys, "", "");
uShellNotifyIconEx(NIM_MODIFY, cui::main_window.get_wnd(), 1, MSG_NOTIFICATION_ICON, g_icon, sys,
uShellNotifyIconEx(NIM_MODIFY, cui::main_window.get_wnd(), 1, MSG_SYSTEM_TRAY_ICON, g_icon, sys, "", "");
uShellNotifyIconEx(NIM_MODIFY, cui::main_window.get_wnd(), 1, MSG_SYSTEM_TRAY_ICON, g_icon, sys,
(btitle == 0 ? "Now playing:" : (btitle == 1 ? "Unpaused:" : "Paused:")), title);
} else
uShellNotifyIcon(NIM_MODIFY, cui::main_window.get_wnd(), 1, MSG_NOTIFICATION_ICON, g_icon, sys);
uShellNotifyIcon(NIM_MODIFY, cui::main_window.get_wnd(), 1, MSG_SYSTEM_TRAY_ICON, g_icon, sys);
}
}

void destroy_systray_icon()
{
if (g_icon_created) {
uShellNotifyIcon(NIM_DELETE, cui::main_window.get_wnd(), 1, MSG_NOTIFICATION_ICON, nullptr, nullptr);
uShellNotifyIcon(NIM_DELETE, cui::main_window.get_wnd(), 1, MSG_SYSTEM_TRAY_ICON, nullptr, nullptr);
g_icon_created = false;
}
}

void on_show_notification_area_icon_change()
void on_show_system_tray_icon_change()
{
if (!cui::main_window.get_wnd())
return;

const auto is_iconic = IsIconic(cui::main_window.get_wnd()) != 0;
const auto close_to_icon = cui::config::advbool_close_to_notification_icon.get();
const auto close_to_icon = cui::config::advbool_close_to_system_tray_icon.get();
if (cfg_show_systray && !g_icon_created) {
create_systray_icon();
} else if (!cfg_show_systray && g_icon_created && (!is_iconic || !(cfg_minimise_to_tray || close_to_icon))) {
Expand All @@ -67,8 +67,8 @@ void on_show_notification_area_icon_change()

void create_systray_icon()
{
uShellNotifyIcon(g_icon_created ? NIM_MODIFY : NIM_ADD, cui::main_window.get_wnd(), 1, MSG_NOTIFICATION_ICON,
g_icon, core_version_info_v2::get()->get_name());
uShellNotifyIcon(g_icon_created ? NIM_MODIFY : NIM_ADD, cui::main_window.get_wnd(), 1, MSG_SYSTEM_TRAY_ICON, g_icon,
core_version_info_v2::get()->get_name());
/* There was some misbehaviour with the newer messages. So we don't use them. */
// if (!g_icon_created)
// uih::shell_notify_icon(NIM_SETVERSION, cui::main_window.get_wnd(), 1, NOTIFYICON_VERSION,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ void create_icon_handle();
void create_systray_icon();
void update_systray(bool balloon = false, int btitle = 0, bool force_balloon = false);
void destroy_systray_icon();
void on_show_notification_area_icon_change();
void on_show_system_tray_icon_change();
Loading

0 comments on commit 0b31831

Please sign in to comment.