diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-09-21 15:49:11 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-09-21 15:49:11 +0000 |
commit | 4e0aef28194077beaaaa07775f819c3a4cf934e9 (patch) | |
tree | 9790e7e37c3e3bac42fcdae8415cfc62e9574383 /src/modules/options | |
parent | eda233a99f1a74b1d43b2cc0fd41c0a874a7b3cd (diff) |
using Uxtheme in core
git-svn-id: http://svn.miranda-ng.org/main/trunk@6158 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/options')
-rw-r--r-- | src/modules/options/headerbar.cpp | 6 | ||||
-rw-r--r-- | src/modules/options/iconheader.cpp | 22 | ||||
-rw-r--r-- | src/modules/options/options.cpp | 51 |
3 files changed, 38 insertions, 41 deletions
diff --git a/src/modules/options/headerbar.cpp b/src/modules/options/headerbar.cpp index 8b124cd14b..f4fdec8745 100644 --- a/src/modules/options/headerbar.cpp +++ b/src/modules/options/headerbar.cpp @@ -35,7 +35,7 @@ static BOOL IsAeroMode() static BOOL IsVSMode()
{
- return isThemeActive && IsWinVerVistaPlus() && isThemeActive();
+ return IsWinVerVistaPlus() && IsThemeActive();
}
////////////////////////////////////////////////////////////////////////////////////
@@ -213,7 +213,7 @@ static LRESULT MHeaderbar_OnPaint(HWND hwndDlg, MHeaderbarCtrl *mit, UINT msg, dto.dwFlags = DTT_COMPOSITED|DTT_GLOWSIZE;
dto.iGlowSize = 10;
- HANDLE hTheme = openThemeData(hwndDlg, L"Window");
+ HANDLE hTheme = OpenThemeData(hwndDlg, L"Window");
textRect.left = 50;
hOldFont = (HFONT)SelectObject(tempDC, hFntBold);
@@ -229,7 +229,7 @@ static LRESULT MHeaderbar_OnPaint(HWND hwndDlg, MHeaderbarCtrl *mit, UINT msg, drawThemeTextEx(hTheme, tempDC, WP_CAPTION, CS_ACTIVE, szSubTitleW, -1, DT_BOTTOM|DT_LEFT|DT_SINGLELINE|DT_NOPREFIX|DT_NOCLIP|DT_END_ELLIPSIS, &textRect, &dto);
mir_free(szSubTitleW);
}
- closeThemeData(hTheme);
+ CloseThemeData(hTheme);
}
else {
textRect.left = 50;
diff --git a/src/modules/options/iconheader.cpp b/src/modules/options/iconheader.cpp index cf90cf8b25..184ca6c4a7 100644 --- a/src/modules/options/iconheader.cpp +++ b/src/modules/options/iconheader.cpp @@ -35,7 +35,7 @@ static BOOL IsAeroMode() static BOOL IsVSMode()
{
- return isThemeActive && IsWinVerVistaPlus() && isThemeActive();
+ return IsWinVerVistaPlus() && IsThemeActive();
}
////////////////////////////////////////////////////////////////////////////////////
@@ -196,13 +196,13 @@ static void MIcoTab_DrawItem(HWND hwnd, HDC hdc, MIcoTabCtrl *dat, MIcoTab *tab, rc.top = iTopSpace;
rc.right = itemX + dat->itemWidth;
rc.bottom = iTopSpace + dat->itemHeight;
- HANDLE hTheme = openThemeData(hwnd, L"ListView");
+ HANDLE hTheme = OpenThemeData(hwnd, L"ListView");
if (dat->nHotIdx == i || GetFocus() == hwnd)
- drawThemeBackground(hTheme, hdc, LVP_LISTITEM, LISS_HOTSELECTED, &rc, NULL);
+ DrawThemeBackground(hTheme, hdc, LVP_LISTITEM, LISS_HOTSELECTED, &rc, NULL);
else
- drawThemeBackground(hTheme, hdc, LVP_LISTITEM, LISS_SELECTED, &rc, NULL);
+ DrawThemeBackground(hTheme, hdc, LVP_LISTITEM, LISS_SELECTED, &rc, NULL);
- closeThemeData(hTheme);
+ CloseThemeData(hTheme);
}
else {
MIcoTab_FillRect(hdc, itemX, ITC_BORDER_SIZE, dat->itemWidth, dat->itemHeight, dat->clSelBorder);
@@ -217,10 +217,10 @@ static void MIcoTab_DrawItem(HWND hwnd, HDC hdc, MIcoTabCtrl *dat, MIcoTab *tab, rc.top = iTopSpace;
rc.right = itemX + dat->itemWidth;
rc.bottom = iTopSpace + dat->itemHeight;
- setWindowTheme(hwnd, L"explorer", NULL);
- HANDLE hTheme = openThemeData(hwnd, L"ListView");
- drawThemeBackground(hTheme, hdc, LVP_LISTITEM, LISS_HOT, &rc, NULL);
- closeThemeData(hTheme);
+ SetWindowTheme(hwnd, L"explorer", NULL);
+ HANDLE hTheme = OpenThemeData(hwnd, L"ListView");
+ DrawThemeBackground(hTheme, hdc, LVP_LISTITEM, LISS_HOT, &rc, NULL);
+ CloseThemeData(hTheme);
}
else {
MIcoTab_FillRect(hdc, itemX, ITC_BORDER_SIZE, dat->itemWidth, dat->itemHeight, dat->clHotBorder);
@@ -242,11 +242,11 @@ static void MIcoTab_DrawItem(HWND hwnd, HDC hdc, MIcoTabCtrl *dat, MIcoTab *tab, dto.dwSize = sizeof(dto);
dto.dwFlags = DTT_COMPOSITED|DTT_GLOWSIZE;
dto.iGlowSize = 10;
- HANDLE hTheme = openThemeData(hwnd, L"Window");
+ HANDLE hTheme = OpenThemeData(hwnd, L"Window");
wchar_t *tcsNameW = mir_t2u(tab->tcsName);
drawThemeTextEx(hTheme, hdc, WP_CAPTION, CS_ACTIVE, tcsNameW, -1, DT_VCENTER|DT_CENTER|DT_END_ELLIPSIS, &textRect, &dto);
mir_free(tcsNameW);
- closeThemeData(hTheme);
+ CloseThemeData(hTheme);
}
else DrawText(hdc, tab->tcsName, -1, &textRect, DT_VCENTER|DT_CENTER|DT_END_ELLIPSIS);
diff --git a/src/modules/options/options.cpp b/src/modules/options/options.cpp index 5d995447bb..6f19035d1e 100644 --- a/src/modules/options/options.cpp +++ b/src/modules/options/options.cpp @@ -182,8 +182,7 @@ static void SaveOptionsTreeState(HWND hdlg) static void ThemeDialogBackground(HWND hwnd, BOOL tabbed)
{
- if (enableThemeDialogTexture)
- enableThemeDialogTexture(hwnd, (tabbed ? ETDT_ENABLE : ETDT_DISABLE) | ETDT_USETABTEXTURE);
+ EnableThemeDialogTexture(hwnd, (tabbed ? ETDT_ENABLE : ETDT_DISABLE) | ETDT_USETABTEXTURE);
}
static int lstrcmpnull(TCHAR *str1, TCHAR *str2)
@@ -282,31 +281,29 @@ static LRESULT CALLBACK OptionsFilterSubclassProc(HWND hWnd, UINT message, WPARA int oldMode = SetBkMode(hdc, TRANSPARENT);
- if (openThemeData) {
- HTHEME hTheme = openThemeData(hWnd, L"EDIT");
- if (hTheme) {
- if (isThemeBackgroundPartiallyTransparent(hTheme, EP_EDITTEXT, ETS_NORMAL))
- drawThemeParentBackground(hWnd, hdc, &rc);
-
- RECT rc2;
- getThemeBackgroundContentRect(hTheme, hdc, EP_EDITTEXT, ETS_NORMAL, &rc, &rc2);
- rc2.top = 2 * rc.top - rc2.top;
- rc2.left = 2 * rc.left - rc2.left;
- rc2.bottom = 2 * rc.bottom - rc2.bottom;
- rc2.right = 2 * rc.right - rc2.right;
-
- drawThemeBackground(hTheme, hdc, EP_EDITTEXT, ETS_NORMAL, &rc2, &rc);
- HFONT hFont = (HFONT) SendMessage(hWnd, WM_GETFONT, 0, 0);
- HFONT oldFont = (HFONT) SelectObject(hdc, hFont);
-
- wchar_t *bufW = mir_t2u(buf);
- drawThemeText(hTheme, hdc, EP_EDITTEXT, ETS_DISABLED, bufW, -1, 0, 0, &rc);
- mir_free(bufW);
-
- SelectObject(hdc, oldFont);
- closeThemeData(hTheme);
- bDrawnByTheme = TRUE;
- }
+ HTHEME hTheme = OpenThemeData(hWnd, L"EDIT");
+ if (hTheme) {
+ if (IsThemeBackgroundPartiallyTransparent(hTheme, EP_EDITTEXT, ETS_NORMAL))
+ DrawThemeParentBackground(hWnd, hdc, &rc);
+
+ RECT rc2;
+ GetThemeBackgroundContentRect(hTheme, hdc, EP_EDITTEXT, ETS_NORMAL, &rc, &rc2);
+ rc2.top = 2 * rc.top - rc2.top;
+ rc2.left = 2 * rc.left - rc2.left;
+ rc2.bottom = 2 * rc.bottom - rc2.bottom;
+ rc2.right = 2 * rc.right - rc2.right;
+
+ DrawThemeBackground(hTheme, hdc, EP_EDITTEXT, ETS_NORMAL, &rc2, &rc);
+ HFONT hFont = (HFONT) SendMessage(hWnd, WM_GETFONT, 0, 0);
+ HFONT oldFont = (HFONT) SelectObject(hdc, hFont);
+
+ wchar_t *bufW = mir_t2u(buf);
+ DrawThemeText(hTheme, hdc, EP_EDITTEXT, ETS_DISABLED, bufW, -1, 0, 0, &rc);
+ mir_free(bufW);
+
+ SelectObject(hdc, oldFont);
+ CloseThemeData(hTheme);
+ bDrawnByTheme = TRUE;
}
SetBkMode(hdc, oldMode);
|