diff --git a/reactos/subsys/system/explorer/doc/changes.txt b/reactos/subsys/system/explorer/doc/changes.txt index 95926c56ccd..e9cebcfc457 100644 --- a/reactos/subsys/system/explorer/doc/changes.txt +++ b/reactos/subsys/system/explorer/doc/changes.txt @@ -90,3 +90,4 @@ If you search for more information, look into the CVS repository. 17.09.2004 m. fuchs handle "." and ".." as special direcory names and move them at the very first beginning of directory listings 23.09.2004 m. fuchs configuration dialog to choose between MDI and SDI mode with persistent storage 20.11.2004 m. fuchs display notification icon change times + notification area button to toggle hidden icons diff --git a/reactos/subsys/system/explorer/explorer-cfg-template.xml b/reactos/subsys/system/explorer/explorer-cfg-template.xml index 4bc56738082..c60a0581f6e 100644 --- a/reactos/subsys/system/explorer/explorer-cfg-template.xml +++ b/reactos/subsys/system/explorer/explorer-cfg-template.xml @@ -11,7 +11,7 @@ - + @@ -22,7 +22,7 @@ - + diff --git a/reactos/subsys/system/explorer/explorer.dsp b/reactos/subsys/system/explorer/explorer.dsp index 23cb86128cc..1e361a3750a 100644 --- a/reactos/subsys/system/explorer/explorer.dsp +++ b/reactos/subsys/system/explorer/explorer.dsp @@ -518,6 +518,14 @@ SOURCE=.\res\notify_h.ico # End Source File # Begin Source File +SOURCE=.\res\notify_l.ico +# End Source File +# Begin Source File + +SOURCE=.\res\notify_r.ico +# End Source File +# Begin Source File + SOURCE=.\res\notify_t.ico # End Source File # Begin Source File diff --git a/reactos/subsys/system/explorer/explorer_intres.h b/reactos/subsys/system/explorer/explorer_intres.h index a1ee3f3897a..65019d11811 100644 --- a/reactos/subsys/system/explorer/explorer_intres.h +++ b/reactos/subsys/system/explorer/explorer_intres.h @@ -44,6 +44,8 @@ #define IDS_NOTIFY_SHOW 40 #define IDS_NOTIFY_HIDE 41 #define IDS_NOTIFY_AUTOHIDE 42 +#define IDS_SHOW_HIDDEN_ICONS 43 +#define IDS_HIDE_ICONS 44 #define IDI_REACTOS 100 #define IDI_EXPLORER 101 #define IDI_STARTMENU 102 @@ -109,6 +111,8 @@ #define IDI_DOT_RED 165 #define IDI_ARROW_UP 166 #define IDI_ARROW_DOWN 167 +#define IDI_NOTIFY_L 168 +#define IDI_NOTIFY_R 169 #define ID_VIEW_NAME 401 #define ID_VIEW_ALL_ATTRIBUTES 402 #define ID_VIEW_SELECTED_ATTRIBUTES 403 @@ -211,7 +215,7 @@ // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 166 +#define _APS_NEXT_RESOURCE_VALUE 169 #define _APS_NEXT_COMMAND_VALUE 40024 #define _APS_NEXT_CONTROL_VALUE 1033 #define _APS_NEXT_SYMED_VALUE 101 diff --git a/reactos/subsys/system/explorer/explorer_intres.rc b/reactos/subsys/system/explorer/explorer_intres.rc index 1b7530407f4..8cbb06cbb32 100644 --- a/reactos/subsys/system/explorer/explorer_intres.rc +++ b/reactos/subsys/system/explorer/explorer_intres.rc @@ -174,6 +174,8 @@ BEGIN IDS_NOTIFY_SHOW "show" IDS_NOTIFY_HIDE "hide" IDS_NOTIFY_AUTOHIDE "autohide" + IDS_SHOW_HIDDEN_ICONS "Show hidden icons" + IDS_HIDE_ICONS "Hide icons" END #endif // Romanian resources @@ -568,6 +570,8 @@ IDI_DOT_TRANS ICON DISCARDABLE "res/dot_trans.ico" IDI_DOT_RED ICON DISCARDABLE "res/dot_red.ico" IDI_ARROW_UP ICON DISCARDABLE "res/arrow_up.ico" IDI_ARROW_DOWN ICON DISCARDABLE "res/arrow_dwn.ico" +IDI_NOTIFY_L ICON DISCARDABLE "res\\notify_l.ico" +IDI_NOTIFY_R ICON DISCARDABLE "res/notify_r.ico" ///////////////////////////////////////////////////////////////////////////// // @@ -627,6 +631,8 @@ BEGIN IDS_NOTIFY_SHOW "sichtbar" IDS_NOTIFY_HIDE "versteckt" IDS_NOTIFY_AUTOHIDE "automatisch" + IDS_SHOW_HIDDEN_ICONS "Zeige versteckte Icons" + IDS_HIDE_ICONS "Verstecke Icons" END #endif // German (Germany) resources @@ -1117,6 +1123,8 @@ BEGIN IDS_NOTIFY_SHOW "show" IDS_NOTIFY_HIDE "hide" IDS_NOTIFY_AUTOHIDE "autohide" + IDS_SHOW_HIDDEN_ICONS "Show hidden icons" + IDS_HIDE_ICONS "Hide icons" END #endif // English (U.S.) resources @@ -1578,6 +1586,8 @@ BEGIN IDS_NOTIFY_SHOW "mostrar" IDS_NOTIFY_HIDE "ocultar" IDS_NOTIFY_AUTOHIDE "autoocultar" + IDS_SHOW_HIDDEN_ICONS "Show hidden icons" + IDS_HIDE_ICONS "Hide icons" END #endif // Spanish (Castilian) resources @@ -1746,6 +1756,8 @@ BEGIN IDS_NOTIFY_SHOW "show" IDS_NOTIFY_HIDE "hide" IDS_NOTIFY_AUTOHIDE "autohide" + IDS_SHOW_HIDDEN_ICONS "Show hidden icons" + IDS_HIDE_ICONS "Hide icons" END #endif // French (France) resources @@ -1957,6 +1969,8 @@ BEGIN IDS_NOTIFY_SHOW "show" IDS_NOTIFY_HIDE "hide" IDS_NOTIFY_AUTOHIDE "autohide" + IDS_SHOW_HIDDEN_ICONS "Show hidden icons" + IDS_HIDE_ICONS "Hide icons" END #endif // Portuguese (Portugal) resources diff --git a/reactos/subsys/system/explorer/res/notify_l.ico b/reactos/subsys/system/explorer/res/notify_l.ico new file mode 100644 index 00000000000..4bee3f0e5f0 Binary files /dev/null and b/reactos/subsys/system/explorer/res/notify_l.ico differ diff --git a/reactos/subsys/system/explorer/res/notify_r.ico b/reactos/subsys/system/explorer/res/notify_r.ico new file mode 100644 index 00000000000..e772ae17cfc Binary files /dev/null and b/reactos/subsys/system/explorer/res/notify_r.ico differ diff --git a/reactos/subsys/system/explorer/taskbar/traynotify.cpp b/reactos/subsys/system/explorer/taskbar/traynotify.cpp index 357c7021fd7..532baebfaff 100644 --- a/reactos/subsys/system/explorer/taskbar/traynotify.cpp +++ b/reactos/subsys/system/explorer/taskbar/traynotify.cpp @@ -118,7 +118,7 @@ NotifyInfo& NotifyInfo::operator=(NOTIFYICONDATA* pnid) if (_hIcon) DestroyIcon(_hIcon); - _hIcon = (HICON) CopyImage(pnid->hIcon, IMAGE_ICON, 16, 16, 0); + _hIcon = (HICON) CopyImage(pnid->hIcon, IMAGE_ICON, NOTIFYICON_SIZE, NOTIFYICON_SIZE, 0); } #ifdef NIF_STATE // as of 21.08.2003 missing in MinGW headers @@ -227,6 +227,7 @@ void NotifyArea::read_config() _hide_inactive = XMLBool(options, "hide-inactive", true); ///@todo read default setting from registry _show_hidden = XMLBool(options, "show-hidden", false); ///@todo read default setting from registry + _show_button = XMLBool(options, "show-button", true); XMLChildrenFilter icons(cfg_pos, "icon"); @@ -272,6 +273,7 @@ void NotifyArea::write_config() XMLPos options(cfg_pos, "options"); XMLBoolRef(options, "hide-inactive") = _hide_inactive; XMLBoolRef(options, "show-hidden") = _show_hidden; + XMLBoolRef(options, "show-button") = _show_button; for(NotifyIconCfgList::iterator it=_cfg.begin(); it!=_cfg.end(); ++it) { NotifyIconConfig& cfg = *it; @@ -365,8 +367,11 @@ LRESULT NotifyArea::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) SetWindowPos(_hwndClock, 0, cx-_clock_width, 0, 0, 0, SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE); break;} - case PM_GET_WIDTH: - return _sorted_icons.size()*NOTIFYICON_DIST + NOTIFYAREA_SPACE + _clock_width; + case PM_GET_WIDTH: { + int w = _sorted_icons.size()*NOTIFYICON_DIST + NOTIFYAREA_SPACE + _clock_width; + if (_show_button) + w += NOTIFYICON_DIST; + return w;} case PM_REFRESH_CONFIG: read_config(); @@ -402,9 +407,11 @@ LRESULT NotifyArea::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) || nmsg==WM_XBUTTONDOWN #endif ) + CancelModes(); - NotifyIconSet::const_iterator found = IconHitTest(Point(lparam)); + Point pt(lparam); + NotifyIconSet::const_iterator found = IconHitTest(pt); if (found != _sorted_icons.end()) { const NotifyInfo& entry = const_cast(*found); // Why does GCC 3.3 need this additional const_cast ?! @@ -446,7 +453,13 @@ LRESULT NotifyArea::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) } else if (_icon_map.erase(entry)) // delete icons without valid owner window UpdateIcons(); - } + } else + // handle clicks on notification area button "show hidden icons" + if (_show_button) + if (nmsg == WM_LBUTTONDOWN) + if (pt.x>=NOTIFYICON_X && pt.x=NOTIFYICON_Y && pt.y=NOTIFYICON_X && pt.x=NOTIFYICON_Y && pt.y(*found); // Why does GCC 3.3 need this additional const_cast ?! + pdi->lpszText = (LPTSTR)(_show_hidden?sHideIcons:sShowIcons).c_str(); + } else { + NotifyIconSet::iterator found = IconHitTest(pt); - pdi->lpszText = (LPTSTR)entry._tipText.c_str(); + if (found != _sorted_icons.end()) { + NotifyInfo& entry = const_cast(*found); // Why does GCC 3.3 need this additional const_cast ?! + + pdi->lpszText = (LPTSTR)entry._tipText.c_str(); + } } } @@ -581,10 +604,18 @@ void NotifyArea::UpdateIcons() // sync tooltip areas to current icon number if (_sorted_icons.size() != _last_icon_count) { - RECT rect = {2, 3, 2+16, 3+16}; - size_t icon_cnt = _sorted_icons.size(); + RECT rect = {NOTIFYICON_X, NOTIFYICON_Y, NOTIFYICON_X+NOTIFYICON_SIZE, NOTIFYICON_Y+NOTIFYICON_SIZE}; size_t tt_idx = 0; + + if (_show_button) { + _tooltip.add(_hwnd, tt_idx++, rect); + + rect.left += NOTIFYICON_DIST; + rect.right += NOTIFYICON_DIST; + } + + size_t icon_cnt = _sorted_icons.size(); while(tt_idx < icon_cnt) { _tooltip.add(_hwnd, tt_idx++, rect); @@ -612,11 +643,19 @@ void NotifyArea::Paint() FillRect(canvas, &canvas.rcPaint, GetSysColorBrush(COLOR_BTNFACE)); // draw icons - int x = 2; - int y = 3; + int x = NOTIFYICON_X; + int y = NOTIFYICON_Y; + + if (_show_button) { + static SmallIcon leftArrowIcon(IDI_NOTIFY_L); + static SmallIcon rightArrowIcon(IDI_NOTIFY_R); + + DrawIconEx(canvas, x, y, _show_hidden?rightArrowIcon:leftArrowIcon, NOTIFYICON_SIZE, NOTIFYICON_SIZE, 0, 0, DI_NORMAL); + x += NOTIFYICON_DIST; + } for(NotifyIconSet::const_iterator it=_sorted_icons.begin(); it!=_sorted_icons.end(); ++it) { - DrawIconEx(canvas, x, y, it->_hIcon, 16, 16, 0, 0, DI_NORMAL); + DrawIconEx(canvas, x, y, it->_hIcon, NOTIFYICON_SIZE, NOTIFYICON_SIZE, 0, 0, DI_NORMAL); x += NOTIFYICON_DIST; } @@ -676,17 +715,20 @@ void NotifyArea::Refresh(bool update) /// search for a icon at a given client coordinate position NotifyIconSet::iterator NotifyArea::IconHitTest(const POINT& pos) { - if (pos.y<2 || pos.y>=2+16) + if (pos.y=NOTIFYICON_Y+NOTIFYICON_SIZE) return _sorted_icons.end(); NotifyIconSet::iterator it = _sorted_icons.begin(); - int x = 2; + int x = NOTIFYICON_X; + + if (_show_button) + x += NOTIFYICON_DIST; for(; it!=_sorted_icons.end(); ++it) { //NotifyInfo& entry = const_cast(*it); // Why does GCC 3.3 need this additional const_cast ?! - if (pos.x>=x && pos.x=x && pos.x