From c16e8e071b0b84bfb4ed58d22779e3052b8407d3 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 4 Feb 2013 14:57:59 +0000 Subject: fix for always visible TopToolBar frame fixes #74 git-svn-id: http://svn.miranda-ng.org/main/trunk@3421 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TopToolBar/src/toolbarwnd.cpp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'plugins/TopToolBar/src/toolbarwnd.cpp') diff --git a/plugins/TopToolBar/src/toolbarwnd.cpp b/plugins/TopToolBar/src/toolbarwnd.cpp index c4a3dc993f..99793040d4 100644 --- a/plugins/TopToolBar/src/toolbarwnd.cpp +++ b/plugins/TopToolBar/src/toolbarwnd.cpp @@ -124,7 +124,7 @@ LRESULT CALLBACK TopToolBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara switch(msg) { case WM_CREATE: g_ctrl->hWnd = hwnd; - PostMessage(hwnd, TTB_UPDATEFRAMEVISIBILITY, 1, 0); + PostMessage(hwnd, TTB_UPDATEFRAMEVISIBILITY, 0, 0); return FALSE; case WM_DESTROY: @@ -154,7 +154,7 @@ LRESULT CALLBACK TopToolBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara GetClientRect(g_ctrl->hWnd, &rcClient); if (rcClient.bottom - rcClient.top != iHeight && iHeight) { supressRepos = true; - PostMessage(hwnd, TTB_UPDATEFRAMEVISIBILITY, -1, 0); + PostMessage(hwnd, TTB_UPDATEFRAMEVISIBILITY, 0, 0); } } return 0; @@ -208,12 +208,10 @@ LRESULT CALLBACK TopToolBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara case TTB_UPDATEFRAMEVISIBILITY: { - BOOL vis=(BOOL)wParam; - BOOL curvis = IsWindowVisible(hwnd); bool bResize = false; - int Height = ArrangeButtons(); if (g_ctrl->bAutoSize) { + int Height = ArrangeButtons(); INT_PTR frameopt = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_HEIGHT, g_ctrl->hFrame), 0); if (Height != frameopt) { CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_HEIGHT, g_ctrl->hFrame), Height); @@ -224,12 +222,8 @@ LRESULT CALLBACK TopToolBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara if (g_ctrl->bOrderChanged) bResize = TRUE, g_ctrl->bOrderChanged = FALSE; - if ((curvis != vis || bResize) && vis != -1) { - INT_PTR frameopt = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS, g_ctrl->hFrame), 0); - frameopt &= ~F_VISIBLE; - frameopt |= vis ? F_VISIBLE : 0; - CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS, g_ctrl->hFrame), frameopt); - } + if (bResize) + CallService(MS_CLIST_FRAMES_UPDATEFRAME, (WPARAM)g_ctrl->hFrame, FU_FMPOS); } break; @@ -288,8 +282,7 @@ INT_PTR OnEventFire(WPARAM wParam, LPARAM lParam) // if there's no customized frames, create our own if (g_ctrl->hFrame == NULL) { - CLISTFrame Frame = { 0 }; - Frame.cbSize = sizeof(Frame); + CLISTFrame Frame = { sizeof(Frame) }; Frame.tname = _T("Toolbar"); Frame.hWnd = g_ctrl->hWnd; Frame.align = alTop; -- cgit v1.2.3