diff options
author | slotwin <slotwin@users.noreply.github.com> | 2014-06-03 20:55:09 +0000 |
---|---|---|
committer | slotwin <slotwin@users.noreply.github.com> | 2014-06-03 20:55:09 +0000 |
commit | 852e3bb1fa504e3f52f5a6a7a824ca3002e38b07 (patch) | |
tree | 008b7293d1790bec0811beda815fbcbcf237418d | |
parent | 6496e700ab055e170a48047f808312e0611ea1e3 (diff) |
Clist_nicer: move color settings to Fonts and colors option page
git-svn-id: http://svn.miranda-ng.org/main/trunk@9411 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | plugins/Clist_nicer/res/resource.rc | 4 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clcopts.cpp | 21 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clui.cpp | 14 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/cluiopts.cpp | 11 |
4 files changed, 17 insertions, 33 deletions
diff --git a/plugins/Clist_nicer/res/resource.rc b/plugins/Clist_nicer/res/resource.rc index b83222a8d7..79f634266b 100644 --- a/plugins/Clist_nicer/res/resource.rc +++ b/plugins/Clist_nicer/res/resource.rc @@ -270,8 +270,6 @@ BEGIN CONTROL "",IDC_CBOTTOMSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_HOTTRACK,115,146,10,14
EDITTEXT IDC_CRIGHT,127,142,31,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
CONTROL "",IDC_CRIGHTSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_HOTTRACK,149,139,10,14
- LTEXT "Embedded frames border",IDC_STATIC,174,121,84,12
- CONTROL "",IDC_CLUIFRAMESBDR,"ColourPicker",WS_TABSTOP,264,119,29,12
LTEXT "Clip border by",IDC_STATIC,173,138,67,10
EDITTEXT IDC_CLIPBORDER,264,135,31,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
CONTROL "",IDC_CLIPBORDERSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_HOTTRACK,284,134,10,14
@@ -330,8 +328,6 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN
GROUPBOX "Contact list background",IDC_STATIC,1,4,302,177
CONTROL "Use Windows colors",IDC_WINCOLOUR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,20,282,10
- CONTROL "",IDC_BKGCOLOUR,"ColourPicker",WS_TABSTOP,22,34,22,10
- LTEXT "Background color",IDC_STATIC,48,35,246,8,NOT WS_GROUP
CONTROL "Use background image",IDC_BITMAP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,57,282,10
EDITTEXT IDC_FILENAME,22,71,184,12,ES_AUTOHSCROLL
PUSHBUTTON "...",IDC_BROWSE,208,72,15,11
diff --git a/plugins/Clist_nicer/src/clcopts.cpp b/plugins/Clist_nicer/src/clcopts.cpp index b3b1171f30..ca1688dce8 100644 --- a/plugins/Clist_nicer/src/clcopts.cpp +++ b/plugins/Clist_nicer/src/clcopts.cpp @@ -707,11 +707,8 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, TranslateDialogDefault(hwndDlg);
CheckDlgButton(hwndDlg, IDC_BITMAP, cfg::getByte("CLC", "UseBitmap", CLCDEFAULT_USEBITMAP) ? BST_CHECKED : BST_UNCHECKED);
SendMessage(hwndDlg, WM_USER + 10, 0, 0);
- SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_SETDEFAULTCOLOUR, 0, CLCDEFAULT_BKCOLOUR);
- SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_SETCOLOUR, 0, cfg::getDword("CLC", "BkColour", CLCDEFAULT_BKCOLOUR));
CheckDlgButton(hwndDlg, IDC_WINCOLOUR, cfg::getByte("CLC", "UseWinColours", 0));
CheckDlgButton(hwndDlg, IDC_SKINMODE, cfg::dat.bWallpaperMode);
- SendMessage(hwndDlg, WM_USER + 11, 0, 0);
{
DBVARIANT dbv;
if (!cfg::getTString(NULL, "CLC", "BkBitmap", &dbv)) {
@@ -744,12 +741,6 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, Utils::enableDlgControl(hwndDlg, IDC_SCROLL, IsDlgButtonChecked(hwndDlg, IDC_BITMAP));
Utils::enableDlgControl(hwndDlg, IDC_PROPORTIONAL, IsDlgButtonChecked(hwndDlg, IDC_BITMAP));
break;
- case WM_USER + 11:
- {
- BOOL b = IsDlgButtonChecked(hwndDlg, IDC_WINCOLOUR);
- Utils::enableDlgControl(hwndDlg, IDC_BKGCOLOUR, !b);
- break;
- }
case WM_COMMAND:
if (LOWORD(wParam) == IDC_BROWSE) {
char str[MAX_PATH];
@@ -793,15 +784,9 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, if (!opt_clc_bkg_changed)
return TRUE;
- cfg::writeByte("CLC", "UseBitmap", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BITMAP)); {
- COLORREF col;
- col = SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_GETCOLOUR, 0, 0);
- if (col == CLCDEFAULT_BKCOLOUR)
- db_unset(NULL, "CLC", "BkColour");
- else
- cfg::writeDword("CLC", "BkColour", col);
- cfg::writeByte("CLC", "UseWinColours", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_WINCOLOUR));
- } {
+ cfg::writeByte("CLC", "UseBitmap", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BITMAP));
+ cfg::writeByte("CLC", "UseWinColours", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_WINCOLOUR));
+ {
char str[MAX_PATH], strrel[MAX_PATH];
GetDlgItemTextA(hwndDlg, IDC_FILENAME, str, sizeof(str));
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index 099613673d..5c1271a650 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -56,6 +56,7 @@ extern HWND g_hwndSFL; extern ButtonItem *g_ButtonItems;
extern COLORREF g_CLUISkinnedBkColorRGB;
extern FRAMEWND *wndFrameCLC;
+extern HPEN g_hPenCLUIFrames;
static BYTE old_cliststate, show_on_first_autosize = FALSE;
@@ -149,6 +150,12 @@ static void LayoutButtons(HWND hwnd, RECT *rc) static int FS_FontsChanged(WPARAM wParam, LPARAM lParam)
{
+ COLORREF clr_cluiframes = cfg::getDword("CLUI", "clr_frameborder", RGB(40, 40, 40));
+
+ if (g_hPenCLUIFrames)
+ DeleteObject(g_hPenCLUIFrames);
+ g_hPenCLUIFrames = CreatePen(PS_SOLID, 1, clr_cluiframes);
+
pcli->pfnClcOptionsChanged();
RedrawWindow(pcli->hwndContactList, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
return 0;
@@ -2093,4 +2100,11 @@ void FS_RegisterFonts() colourid.order = 1;
colourid.defcolour = CLCDEFAULT_QUICKSEARCHCOLOUR;
ColourRegisterT(&colourid);
+
+ strncpy(colourid.dbSettingsGroup, "CLUI", sizeof(colourid.dbSettingsGroup));
+ strncpy(colourid.setting, "clr_frameborder", sizeof(colourid.setting));
+ _tcsncpy(colourid.name, LPGENT("Embedded frames border"), SIZEOF(colourid.name));
+ colourid.order = 1;
+ colourid.defcolour = RGB(40, 40, 40);
+ ColourRegisterT(&colourid);
}
diff --git a/plugins/Clist_nicer/src/cluiopts.cpp b/plugins/Clist_nicer/src/cluiopts.cpp index 5617cd2431..63690bd155 100644 --- a/plugins/Clist_nicer/src/cluiopts.cpp +++ b/plugins/Clist_nicer/src/cluiopts.cpp @@ -28,7 +28,6 @@ extern HANDLE hExtraImageApplying; extern SIZE g_oldSize;
extern POINT g_oldPos;
extern COLORREF g_CLUISkinnedBkColorRGB;
-extern HPEN g_hPenCLUIFrames;
static int opt_clui_changed = 0;
@@ -68,8 +67,6 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l SendDlgItemMessage(hwndDlg, IDC_CTOPSPIN, UDM_SETRANGE, 0, MAKELONG(255, 0));
SendDlgItemMessage(hwndDlg, IDC_CBOTTOMSPIN, UDM_SETRANGE, 0, MAKELONG(255, 0));
- SendDlgItemMessage(hwndDlg, IDC_CLUIFRAMESBDR, CPM_SETCOLOUR, 0, cfg::getDword("CLUI", "clr_frameborder", RGB(40, 40, 40)));
-
SendDlgItemMessage(hwndDlg, IDC_CLEFTSPIN, UDM_SETPOS, 0, cfg::dat.bCLeft - (cfg::dat.dwFlags & CLUI_FRAME_CLISTSUNKEN ? 3 : 0));
SendDlgItemMessage(hwndDlg, IDC_CRIGHTSPIN, UDM_SETPOS, 0, cfg::dat.bCRight - (cfg::dat.dwFlags & CLUI_FRAME_CLISTSUNKEN ? 3 : 0));
SendDlgItemMessage(hwndDlg, IDC_CTOPSPIN, UDM_SETPOS, 0, cfg::dat.bCTop);
@@ -171,7 +168,6 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l BOOL translated;
BYTE oldFading;
BYTE windowStyle = (BYTE)SendDlgItemMessage(hwndDlg, IDC_BORDERSTYLE, CB_GETCURSEL, 0, 0);
- COLORREF clr_cluiframes;
if (!opt_clui_changed)
return TRUE;
@@ -236,13 +232,6 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l cfg::writeByte("CLUI", "ShowMainMenu", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWMAINMENU));
cfg::writeByte("CLUI", "ClientAreaDrag", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CLIENTDRAG));
- clr_cluiframes = (COLORREF)SendDlgItemMessage(hwndDlg, IDC_CLUIFRAMESBDR, CPM_GETCOLOUR, 0, 0);
-
- if (g_hPenCLUIFrames)
- DeleteObject(g_hPenCLUIFrames);
- g_hPenCLUIFrames = CreatePen(PS_SOLID, 1, clr_cluiframes);
- cfg::writeDword("CLUI", "clr_frameborder", clr_cluiframes);
-
ApplyCLUIBorderStyle(pcli->hwndContactList);
if (!IsDlgButtonChecked(hwndDlg, IDC_SHOWMAINMENU))
|