diff options
author | George Hazan <ghazan@miranda.im> | 2020-02-21 11:51:18 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-02-21 11:51:18 +0300 |
commit | 582648f317fe46d07e860c0db3b91ae96fea9292 (patch) | |
tree | 98e2c33a10bf1b06710247a0cf453ecc4e13f207 | |
parent | 935ea869e2a565a6b4a4c759966e516cadeeda96 (diff) |
Clist_modern:
- fixes #2227 (Clist_modern: Диалог "Режимы вида" неправильно работает);
- minor code cleaning;
- version bump
-rw-r--r-- | plugins/Clist_modern/src/modern_viewmodebar.cpp | 51 | ||||
-rw-r--r-- | plugins/Clist_modern/src/version.h | 2 |
2 files changed, 25 insertions, 28 deletions
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp index 0f2d58703a..91d6f2e114 100644 --- a/plugins/Clist_modern/src/modern_viewmodebar.cpp +++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp @@ -63,31 +63,6 @@ static UINT _buttons[] = { IDC_RESETMODES, IDC_SELECTMODE, IDC_CONFIGUREMODES }; static BOOL sttDrawViewModeBackground(HWND hwnd, HDC hdc, RECT *rect);
static void DeleteViewMode(char * szName);
-static int DrawViewModeBar(HWND hWnd, HDC hDC)
-{
- RECT rc;
- GetClientRect(hWnd, &rc);
- SkinDrawGlyph(hDC, &rc, &rc, "ViewMode,ID=Background");
- return 0;
-}
-
-static int ViewModePaintCallbackProc(HWND hWnd, HDC hDC, RECT *, HRGN, DWORD, void *)
-{
- RECT MyRect = { 0 };
- GetWindowRect(hWnd, &MyRect);
- DrawViewModeBar(hWnd, hDC);
- for (auto &btn : _buttons) {
- RECT childRect;
- GetWindowRect(GetDlgItem(hWnd, btn), &childRect);
-
- POINT Offset;
- Offset.x = childRect.left - MyRect.left;
- Offset.y = childRect.top - MyRect.top;
- SendDlgItemMessage(hWnd, btn, BUTTONDRAWINPARENT, (WPARAM)hDC, (LPARAM)&Offset);
- }
- return 0;
-}
-
/*
* enumerate all view modes, call the callback function with the mode name
* useful for filling lists, menus and so on..
@@ -195,7 +170,6 @@ static void UpdateStickies() SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELONG(i - ID_STATUS_OFFLINE, nullImage));
hItem = (HANDLE)SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hItem);
}
- ShowPage(clvmHwnd, 0);
}
static int FillDialog(HWND hwnd)
@@ -780,6 +754,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP }
EnableWindow(GetDlgItem(hwndDlg, IDC_ADDVIEWMODE), FALSE);
UpdateFilters();
+ ShowPage(clvmHwnd, 0);
break;
}
case IDC_CLEARALL:
@@ -870,6 +845,8 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP return FALSE;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
static int menuCounter = 0;
static int FillMenuCallback(char *szSetting)
@@ -906,6 +883,8 @@ void BuildViewModeMenu() AppendMenu(hViewModeMenu, MFT_STRING, 10001, TranslateT("Setup view modes..."));
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
@@ -1008,7 +987,7 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM }
else ske_BltBackImage(hwnd, hdc2, &rc);
- DrawViewModeBar(hwnd, hdc2);
+ SkinDrawGlyph(hdc, &rc, &rc, "ViewMode,ID=Background");
}
for (auto &btn : _buttons) {
@@ -1166,6 +1145,24 @@ static int ehhViewModeBackgroundSettingsChanged(WPARAM, LPARAM) return 0;
}
+static int ViewModePaintCallbackProc(HWND hWnd, HDC hDC, RECT *, HRGN, DWORD, void *)
+{
+ RECT MyRect = { 0 };
+ GetWindowRect(hWnd, &MyRect);
+ SkinDrawGlyph(hDC, &MyRect, &MyRect, "ViewMode,ID=Background");
+
+ for (auto &btn : _buttons) {
+ RECT childRect;
+ GetWindowRect(GetDlgItem(hWnd, btn), &childRect);
+
+ POINT Offset;
+ Offset.x = childRect.left - MyRect.left;
+ Offset.y = childRect.top - MyRect.top;
+ SendDlgItemMessage(hWnd, btn, BUTTONDRAWINPARENT, (WPARAM)hDC, (LPARAM)&Offset);
+ }
+ return 0;
+}
+
void CreateViewModeFrame()
{
CallService(MS_BACKGROUNDCONFIG_REGISTER, (WPARAM)(LPGEN("View mode background")"/ViewMode"), 0);
diff --git a/plugins/Clist_modern/src/version.h b/plugins/Clist_modern/src/version.h index 1b02ee2054..090ab46c27 100644 --- a/plugins/Clist_modern/src/version.h +++ b/plugins/Clist_modern/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0
#define __MINOR_VERSION 9
#define __RELEASE_NUM 1
-#define __BUILD_NUM 9
+#define __BUILD_NUM 10
#include <stdver.h>
|