# HG changeset patch # User Daniel Atallah # Date 1105925742 0 # Node ID 976c7b186789956ac0d2c96fae3618eceb581e91 # Parent bec9130b24d2065b509f6fa87b83b2554ee7e1b9 [gaim-migrate @ 11835] It turns out that Windows 2000 and ME will load icons with a greater color depth than 4 bits, but will only display them in 4-bit color. This is very ugly, so the new icons will only be used for Windows XP and newer. committer: Tailor Script diff -r bec9130b24d2 -r 976c7b186789 pixmaps/Makefile.am --- a/pixmaps/Makefile.am Mon Jan 17 00:33:30 2005 +0000 +++ b/pixmaps/Makefile.am Mon Jan 17 01:35:42 2005 +0000 @@ -15,7 +15,7 @@ gaim_info.png \ gaim_question.png \ gaim_warning.png \ - info.png \ + info.png \ insert-image-small.png \ insert-link-small.png \ insert-smiley-small.png \ @@ -43,14 +43,16 @@ status/Makefile.mingw \ gaim-install.ico \ gaim.ico \ - gaim_away.ico \ - gaim_offline.ico \ - gaim_16.ico \ + gaim_4bit_16.ico \ gaim_away_16.ico \ + gaim_away_4bit_16.ico \ gaim_blank_4bit_16.ico \ gaim_msgpend_16.ico \ + gaim_msgpend_4bit_16.ico \ gaim_msgunread_16.ico \ - gaim_offline_16.ico + gaim_msgunread_4bit_16.ico \ + gaim_offline_16.ico \ + gaim_offline_4bit_16.ico gaimbuttonpixdir = $(datadir)/pixmaps/gaim/buttons diff -r bec9130b24d2 -r 976c7b186789 pixmaps/gaim_4bit_16.ico Binary file pixmaps/gaim_4bit_16.ico has changed diff -r bec9130b24d2 -r 976c7b186789 pixmaps/gaim_away_4bit_16.ico Binary file pixmaps/gaim_away_4bit_16.ico has changed diff -r bec9130b24d2 -r 976c7b186789 pixmaps/gaim_msgpend_4bit_16.ico Binary file pixmaps/gaim_msgpend_4bit_16.ico has changed diff -r bec9130b24d2 -r 976c7b186789 pixmaps/gaim_msgunread_4bit_16.ico Binary file pixmaps/gaim_msgunread_4bit_16.ico has changed diff -r bec9130b24d2 -r 976c7b186789 pixmaps/gaim_offline_4bit_16.ico Binary file pixmaps/gaim_offline_4bit_16.ico has changed diff -r bec9130b24d2 -r 976c7b186789 plugins/docklet/docklet-win32.c --- a/plugins/docklet/docklet-win32.c Mon Jan 17 00:33:30 2005 +0000 +++ b/plugins/docklet/docklet-win32.c Mon Jan 17 01:35:42 2005 +0000 @@ -192,15 +192,31 @@ } static void wgaim_tray_create() { + OSVERSIONINFO osinfo; /* dummy window to process systray messages */ systray_hwnd = systray_create_hiddenwin(); - /* Load icons, and init systray notify icon */ - sysicon_disconn = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_OFFLINE_TRAY_ICON), IMAGE_ICON, 16, 16, 0); - sysicon_conn = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_TRAY_ICON), IMAGE_ICON, 16, 16, 0); - sysicon_away = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_AWAY_TRAY_ICON), IMAGE_ICON, 16, 16, 0); - sysicon_pend = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_PEND_TRAY_ICON), IMAGE_ICON, 16, 16, 0); - sysicon_awypend = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_AWAYPEND_TRAY_ICON), IMAGE_ICON, 16, 16, 0); + osinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&osinfo); + + /* Load icons, and init systray notify icon + * NOTE: Windows > XP only supports displaying 4-bit images in the Systray, + * 2K and ME will use the highest color depth that the desktop will support, + * but will scale it back to 4-bits for display. + * That is why we use custom 4-bit icons for pre XP Windowses */ + if (osinfo.dwMajorVersion == 5 && osinfo.dwMinorVersion > 0) { + sysicon_disconn = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_OFFLINE_TRAY_ICON), IMAGE_ICON, 16, 16, 0); + sysicon_conn = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_TRAY_ICON), IMAGE_ICON, 16, 16, 0); + sysicon_away = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_AWAY_TRAY_ICON), IMAGE_ICON, 16, 16, 0); + sysicon_pend = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_PEND_TRAY_ICON), IMAGE_ICON, 16, 16, 0); + sysicon_awypend = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_AWAYPEND_TRAY_ICON), IMAGE_ICON, 16, 16, 0); + } else { + sysicon_disconn = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_OFFLINE_TRAY_ICON_4BIT), IMAGE_ICON, 16, 16, 0); + sysicon_conn = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_TRAY_ICON_4BIT), IMAGE_ICON, 16, 16, 0); + sysicon_away = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_AWAY_TRAY_ICON_4BIT), IMAGE_ICON, 16, 16, 0); + sysicon_pend = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_PEND_TRAY_ICON_4BIT), IMAGE_ICON, 16, 16, 0); + sysicon_awypend = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_AWAYPEND_TRAY_ICON_4BIT), IMAGE_ICON, 16, 16, 0); + } sysicon_blank = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_BLANK_TRAY_ICON), IMAGE_ICON, 16, 16, 0); /* Create icon in systray */ diff -r bec9130b24d2 -r 976c7b186789 src/win32/gaimrc.rc --- a/src/win32/gaimrc.rc Mon Jan 17 00:33:30 2005 +0000 +++ b/src/win32/gaimrc.rc Mon Jan 17 01:35:42 2005 +0000 @@ -1,9 +1,14 @@ #include "resource.h" -GAIM_ICON ICON "../pixmaps/gaim.ico" -GAIM_TRAY_ICON ICON "../pixmaps/gaim_16.ico" -GAIM_OFFLINE_TRAY_ICON ICON "../pixmaps/gaim_offline_16.ico" -GAIM_AWAY_TRAY_ICON ICON "../pixmaps/gaim_away_16.ico" -GAIM_PEND_TRAY_ICON ICON "../pixmaps/gaim_msgunread_16.ico" -GAIM_AWAYPEND_TRAY_ICON ICON "../pixmaps/gaim_msgpend_16.ico" -GAIM_BLANK_TRAY_ICON ICON "../pixmaps/gaim_blank_4bit_16.ico" +GAIM_ICON ICON "../pixmaps/gaim.ico" +GAIM_TRAY_ICON ICON "../pixmaps/gaim_16.ico" +GAIM_OFFLINE_TRAY_ICON ICON "../pixmaps/gaim_offline_16.ico" +GAIM_AWAY_TRAY_ICON ICON "../pixmaps/gaim_away_16.ico" +GAIM_PEND_TRAY_ICON ICON "../pixmaps/gaim_msgunread_16.ico" +GAIM_AWAYPEND_TRAY_ICON ICON "../pixmaps/gaim_msgpend_16.ico" +GAIM_BLANK_TRAY_ICON ICON "../pixmaps/gaim_blank_4bit_16.ico" +GAIM_TRAY_ICON_4BIT ICON "../pixmaps/gaim_4bit_16.ico" +GAIM_OFFLINE_TRAY_ICON_4BIT ICON "../pixmaps/gaim_offline_4bit_16.ico" +GAIM_AWAY_TRAY_ICON_4BIT ICON "../pixmaps/gaim_away_4bit_16.ico" +GAIM_PEND_TRAY_ICON_4BIT ICON "../pixmaps/gaim_msgunread_4bit_16.ico" +GAIM_AWAYPEND_TRAY_ICON_4BIT ICON "../pixmaps/gaim_msgpend_4bit_16.ico" diff -r bec9130b24d2 -r 976c7b186789 src/win32/resource.h --- a/src/win32/resource.h Mon Jan 17 00:33:30 2005 +0000 +++ b/src/win32/resource.h Mon Jan 17 01:35:42 2005 +0000 @@ -7,3 +7,8 @@ #define GAIM_PEND_TRAY_ICON 110 #define GAIM_AWAYPEND_TRAY_ICON 111 #define GAIM_BLANK_TRAY_ICON 112 +#define GAIM_TRAY_ICON_4BIT 113 +#define GAIM_OFFLINE_TRAY_ICON_4BIT 114 +#define GAIM_AWAY_TRAY_ICON_4BIT 115 +#define GAIM_PEND_TRAY_ICON_4BIT 116 +#define GAIM_AWAYPEND_TRAY_ICON_4BIT 117