[PATCH 1/2] explorer: Improve tray sizing and style.
Zebediah Figura
zfigura at codeweavers.com
Fri Jul 7 18:56:11 CDT 2017
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
programs/explorer/systray.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c
index 9e58ad48333..5a3b1db5d09 100644
--- a/programs/explorer/systray.c
+++ b/programs/explorer/systray.c
@@ -491,7 +491,7 @@ static void sync_taskbar_buttons(void)
{
if (!win->hwnd) /* start button */
{
- SetWindowPos( win->button, 0, pos, 0, start_button_width, tray_height,
+ SetWindowPos( win->button, 0, pos, 0, start_button_width, tray_height - 4,
SWP_NOZORDER | SWP_NOACTIVATE | SWP_SHOWWINDOW );
pos += start_button_width;
continue;
@@ -510,7 +510,7 @@ static void sync_taskbar_buttons(void)
if (!win->hwnd) continue; /* start button */
if (win->visible && right - pos >= width)
{
- SetWindowPos( win->button, 0, pos, 0, width, tray_height,
+ SetWindowPos( win->button, 0, pos, 0, width, tray_height - 4,
SWP_NOZORDER | SWP_NOACTIVATE | SWP_SHOWWINDOW );
InvalidateRect( win->button, NULL, TRUE );
pos += width;
@@ -653,12 +653,10 @@ static void paint_taskbar_button( const DRAWITEMSTRUCT *dis )
if (!win) return;
GetClientRect( dis->hwndItem, &rect );
DrawFrameControl( dis->hDC, &rect, DFC_BUTTON, DFCS_BUTTONPUSH | DFCS_ADJUSTRECT |
- ((dis->itemState & ODS_SELECTED) ? DFCS_PUSHED : 0 ));
+ ((dis->itemState & ODS_SELECTED) ? DFCS_PUSHED : 0) |
+ (win->hwnd && win->active ? DFCS_CHECKED : 0) );
if (win->hwnd)
- {
- flags |= win->active ? DC_ACTIVE : DC_INBUTTON;
- DrawCaptionTempW( win->hwnd, dis->hDC, &rect, 0, 0, NULL, flags );
- }
+ DrawCaptionTempW( win->hwnd, dis->hDC, &rect, 0, 0, NULL, flags | DC_INBUTTON | DC_ICON );
else /* start button */
DrawCaptionTempW( 0, dis->hDC, &rect, 0, 0, start_label, flags | DC_INBUTTON | DC_ICON );
}
@@ -765,9 +763,10 @@ static void do_show_systray(void)
tray_width = GetSystemMetrics( SM_CXSCREEN );
tray_height = max( icon_cy, size.cy );
+ tray_height = max( tray_height, 26 );
start_button_width = size.cx;
- SetWindowPos( tray_window, HWND_TOPMOST, 0, GetSystemMetrics( SM_CYSCREEN ) - tray_height,
- tray_width, tray_height, SWP_NOACTIVATE | SWP_SHOWWINDOW );
+ SetWindowPos( tray_window, HWND_TOPMOST, -2, GetSystemMetrics(SM_CYSCREEN) - tray_height - 2,
+ tray_width + 4, tray_height + 4, SWP_NOACTIVATE | SWP_SHOWWINDOW );
sync_taskbar_buttons();
}
@@ -925,7 +924,8 @@ void initialize_systray( HMODULE graphics_driver, BOOL using_root, BOOL arg_enab
return;
}
- tray_window = CreateWindowExW( WS_EX_NOACTIVATE, classname, NULL, WS_POPUP,
+ tray_window = CreateWindowExW( WS_EX_TOOLWINDOW|WS_EX_TOPMOST, classname, NULL,
+ WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_BORDER | WS_THICKFRAME,
0, GetSystemMetrics( SM_CYSCREEN ), 0, 0, 0, 0, 0, 0 );
if (!tray_window)
{
--
2.13.2
More information about the wine-patches
mailing list