diff options
Diffstat (limited to 'plugins/TipperYM')
-rw-r--r-- | plugins/TipperYM/res/resource.rc | 10 | ||||
-rw-r--r-- | plugins/TipperYM/src/options.cpp | 15 | ||||
-rw-r--r-- | plugins/TipperYM/src/options.h | 5 | ||||
-rw-r--r-- | plugins/TipperYM/src/popwin.cpp | 26 | ||||
-rw-r--r-- | plugins/TipperYM/src/resource.h | 1 |
5 files changed, 32 insertions, 25 deletions
diff --git a/plugins/TipperYM/res/resource.rc b/plugins/TipperYM/res/resource.rc index b4f4fd43ea..5c1891659c 100644 --- a/plugins/TipperYM/res/resource.rc +++ b/plugins/TipperYM/res/resource.rc @@ -53,7 +53,6 @@ BEGIN CONTROL "",IDC_SPIN_HOVER,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,277,101,11,12
RTEXT "Hover time:",IDC_STATIC,165,104,80,8,0,WS_EX_RIGHT
COMBOBOX IDC_CMB_POS,14,17,133,69,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- CONTROL "Status bar tips",IDC_CHK_SBAR,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,166,153,125,11
GROUPBOX "Alignment",IDC_STATIC,5,175,150,45
COMBOBOX IDC_CMB_LV,57,186,43,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_CMB_VV,57,202,43,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
@@ -76,10 +75,11 @@ BEGIN EDITTEXT IDC_ED_OUTAVPADDING,117,135,30,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT
CONTROL "",IDC_SPIN_OUTAVPADDING,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,135,135,11,12
RTEXT "Outer avatar padding:",IDC_STATIC,9,138,104,8
- CONTROL "Round corners (avatar)",IDC_CHK_ROUNDCORNERSAV,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,166,187,125,11
- CONTROL "Keep original avatar size",IDC_CHK_ORIGINALAVSIZE,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,166,204,125,11
- CONTROL "Avatar border",IDC_CHK_AVBORDER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,166,170,125,11
+ CONTROL "Show title",IDC_CHK_SHOWTITLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,166,153,125,11
+ CONTROL "Status bar tips",IDC_CHK_SBAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,166,166,125,11
+ CONTROL "Avatar border",IDC_CHK_AVBORDER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,166,179,125,11
+ CONTROL "Round corners (avatar)",IDC_CHK_ROUNDCORNERSAV,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,166,192,125,11
+ CONTROL "Keep original avatar size",IDC_CHK_ORIGINALAVSIZE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,166,204,125,11
EDITTEXT IDC_ED_TITLEINDENT,117,79,30,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT
CONTROL "",IDC_SPIN_TITLEINDENT,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,135,79,11,12
RTEXT "Title indent:",IDC_STATIC,9,82,104,8
diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp index 41aef2fc2b..f9aae7e2fd 100644 --- a/plugins/TipperYM/src/options.cpp +++ b/plugins/TipperYM/src/options.cpp @@ -239,7 +239,8 @@ void SaveOptions() db_set_dw(0, MODULE, "MaxHeight", opt.iWinMaxHeight);
db_set_b(0, MODULE, "AvatarOpacity", (BYTE)opt.iAvatarOpacity);
db_set_b(0, MODULE, "AvatarRoundCorners", (opt.bAvatarRound ? 1 : 0));
- db_set_b(0, MODULE, "TitleLayout", (BYTE)opt.titleLayout);
+ db_set_b(0, MODULE, "TitleIconLayout", (BYTE)opt.titleIconLayout);
+ db_set_b(0, MODULE, "TitleShow", (opt.bShowTitle ? 1 : 0));
if (ServiceExists(MS_AV_DRAWAVATAR))
db_set_b(0, MODULE, "AVLayout", (BYTE)opt.avatarLayout);
opt.bWaitForAvatar = (opt.avatarLayout == PAV_NONE) ? false : true;
@@ -347,7 +348,8 @@ void LoadOptions() opt.iAvatarOpacity = db_get_b(0, MODULE, "AvatarOpacity", 100);
if (opt.iAvatarOpacity > 100) opt.iAvatarOpacity = 100;
opt.bAvatarRound = (db_get_b(0, MODULE, "AvatarRoundCorners", opt.bRound ? 1 : 0) == 1);
- opt.titleLayout = (PopupTitleLayout)db_get_b(0, MODULE, "TitleLayout", (BYTE)PTL_LEFTICON);
+ opt.titleIconLayout = (PopupIconTitleLayout)db_get_b(0, MODULE, "TitleIconLayout", (BYTE)PTL_LEFTICON);
+ opt.bShowTitle = (db_get_b(0, MODULE, "TitleShow", 1) == 1);
if (ServiceExists(MS_AV_DRAWAVATAR))
opt.avatarLayout = (PopupAvLayout)db_get_b(0, MODULE, "AVLayout", PAV_RIGHT);
else
@@ -1362,14 +1364,14 @@ INT_PTR CALLBACK DlgProcOptsAppearance(HWND hwndDlg, UINT msg, WPARAM wParam, LP {
TranslateDialogDefault( hwndDlg );
+ CheckDlgButton(hwndDlg, IDC_CHK_SHOWTITLE, opt.bShowTitle ? TRUE : FALSE);
CheckDlgButton(hwndDlg, IDC_CHK_NOFOCUS, opt.bShowNoFocus ? TRUE : FALSE);
CheckDlgButton(hwndDlg, IDC_CHK_SBAR, opt.bStatusBarTips ? TRUE : FALSE);
+ SendDlgItemMessage(hwndDlg, IDC_CMB_ICON, CB_ADDSTRING, 0, (LPARAM)TranslateT("No icon"));
SendDlgItemMessage(hwndDlg, IDC_CMB_ICON, CB_ADDSTRING, 0, (LPARAM)TranslateT("Icon on left"));
SendDlgItemMessage(hwndDlg, IDC_CMB_ICON, CB_ADDSTRING, 0, (LPARAM)TranslateT("Icon on right"));
- SendDlgItemMessage(hwndDlg, IDC_CMB_ICON, CB_ADDSTRING, 0, (LPARAM)TranslateT("No icon"));
- SendDlgItemMessage(hwndDlg, IDC_CMB_ICON, CB_ADDSTRING, 0, (LPARAM)TranslateT("No title"));
- SendDlgItemMessage(hwndDlg, IDC_CMB_ICON, CB_SETCURSEL, (int)opt.titleLayout, 0);
+ SendDlgItemMessage(hwndDlg, IDC_CMB_ICON, CB_SETCURSEL, (int)opt.titleIconLayout, 0);
SendDlgItemMessage(hwndDlg, IDC_CMB_POS, CB_ADDSTRING, 0, (LPARAM)TranslateT("Bottom right"));
SendDlgItemMessage(hwndDlg, IDC_CMB_POS, CB_ADDSTRING, 0, (LPARAM)TranslateT("Bottom left"));
@@ -1523,7 +1525,7 @@ INT_PTR CALLBACK DlgProcOptsAppearance(HWND hwndDlg, UINT msg, WPARAM wParam, LP new_val = GetDlgItemInt(hwndDlg, IDC_ED_SBWIDTH, &trans, FALSE);
if (trans) opt.iSidebarWidth = new_val;
- opt.titleLayout = (PopupTitleLayout)SendDlgItemMessage(hwndDlg, IDC_CMB_ICON, CB_GETCURSEL, 0, 0);
+ opt.titleIconLayout = (PopupIconTitleLayout)SendDlgItemMessage(hwndDlg, IDC_CMB_ICON, CB_GETCURSEL, 0, 0);
opt.avatarLayout = (PopupAvLayout)SendDlgItemMessage(hwndDlg, IDC_CMB_AV, CB_GETCURSEL, 0, 0);
opt.pos = (PopupPosition)SendDlgItemMessage(hwndDlg, IDC_CMB_POS, CB_GETCURSEL, 0, 0);
@@ -1531,6 +1533,7 @@ INT_PTR CALLBACK DlgProcOptsAppearance(HWND hwndDlg, UINT msg, WPARAM wParam, LP opt.bAvatarRound = IsDlgButtonChecked(hwndDlg, IDC_CHK_ROUNDCORNERSAV) && IsWindowEnabled(GetDlgItem(hwndDlg, IDC_CHK_ROUNDCORNERSAV)) ? true : false;
opt.bOriginalAvatarSize = IsDlgButtonChecked(hwndDlg, IDC_CHK_ORIGINALAVSIZE) ? true : false;
+ opt.bShowTitle = IsDlgButtonChecked(hwndDlg, IDC_CHK_SHOWTITLE) ? true : false;
opt.bShowNoFocus = IsDlgButtonChecked(hwndDlg, IDC_CHK_NOFOCUS) ? true : false;
opt.bStatusBarTips = IsDlgButtonChecked(hwndDlg, IDC_CHK_SBAR) ? true : false;
diff --git a/plugins/TipperYM/src/options.h b/plugins/TipperYM/src/options.h index 98caec2063..ac61325b85 100644 --- a/plugins/TipperYM/src/options.h +++ b/plugins/TipperYM/src/options.h @@ -125,13 +125,14 @@ typedef struct { } ICONSTATE;
typedef enum {PAV_NONE=0, PAV_LEFT=1, PAV_RIGHT=2} PopupAvLayout;
-typedef enum {PTL_LEFTICON=0, PTL_RIGHTICON=1, PTL_NOICON=2, PTL_NOTITLE=3} PopupTitleLayout;
+typedef enum {PTL_NOICON=0, PTL_LEFTICON=1, PTL_RIGHTICON=2} PopupIconTitleLayout;
typedef enum {PP_BOTTOMRIGHT=0, PP_BOTTOMLEFT=1, PP_TOPRIGHT=2, PP_TOPLEFT=3} PopupPosition;
typedef enum {PSE_NONE=0, PSE_ANIMATE=1, PSE_FADE=2} PopupShowEffect;
typedef struct {
int iWinWidth, iWinMaxHeight, iAvatarSize; //tweety
- PopupTitleLayout titleLayout;
+ PopupIconTitleLayout titleIconLayout;
+ bool bShowTitle;
PopupAvLayout avatarLayout;
int iTextIndent, iTitleIndent, iValueIndent;
bool bShowNoFocus;
diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp index 95f558cb08..2568132110 100644 --- a/plugins/TipperYM/src/popwin.cpp +++ b/plugins/TipperYM/src/popwin.cpp @@ -558,13 +558,13 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa tr.top = 0;
tr.bottom = opt.iPadding;
- if (!pwd->bIsTextTip && opt.titleLayout != PTL_NOTITLE) {
- if (opt.titleLayout != PTL_NOICON) {
+ if (!pwd->bIsTextTip) {
+ if (opt.titleIconLayout != PTL_NOICON) {
// draw icons
int iIconX, iIconY;
iIconY = opt.iPadding + opt.iTextPadding;
- if (opt.titleLayout == PTL_RIGHTICON)
+ if (opt.titleIconLayout == PTL_RIGHTICON)
iIconX = r2.right - 16 - opt.iPadding;
else
iIconX = r2.left + opt.iPadding;
@@ -578,12 +578,14 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa }
// title text
- if (hFontTitle) SelectObject(hdc, (HGDIOBJ)hFontTitle);
- SetTextColor(hdc, opt.colTitle);
- tr.top = opt.iPadding;
- tr.bottom = tr.top + pwd->iTitleHeight - opt.iPadding;
- UINT uTextFormat = DT_TOP | DT_LEFT | DT_WORDBREAK | DT_WORD_ELLIPSIS | DT_END_ELLIPSIS | DT_NOPREFIX;
- DrawTextExt(hdc, pwd->swzTitle, -1, &tr, uTextFormat, NULL, pwd->spiTitle);
+ if (opt.bShowTitle) {
+ if (hFontTitle) SelectObject(hdc, (HGDIOBJ)hFontTitle);
+ SetTextColor(hdc, opt.colTitle);
+ tr.top = opt.iPadding;
+ tr.bottom = tr.top + pwd->iTitleHeight - opt.iPadding;
+ UINT uTextFormat = DT_TOP | DT_LEFT | DT_WORDBREAK | DT_WORD_ELLIPSIS | DT_END_ELLIPSIS | DT_NOPREFIX;
+ DrawTextExt(hdc, pwd->swzTitle, -1, &tr, uTextFormat, NULL, pwd->spiTitle);
+ }
}
// values
@@ -650,7 +652,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa }
// status icon in tray tooltip
- if (opt.titleLayout != PTL_NOICON && pwd->bIsTrayTip && pwd->rows[i].hIcon) {
+ if (opt.titleIconLayout != PTL_NOICON && pwd->bIsTrayTip && pwd->rows[i].hIcon) {
DrawIconExAlpha(hdc, opt.iPadding, tr.top + (pwd->rows[i].iLabelHeight - 16) / 2, pwd->rows[i].hIcon, 16, 16, 0, NULL, DI_NORMAL, false);
bIconPainted = true;
}
@@ -689,7 +691,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa else
tr.bottom = tr.top + iRowHeight;
- if (opt.titleLayout != PTL_NOICON && pwd->bIsTrayTip && pwd->rows[i].hIcon && !bIconPainted)
+ if (opt.titleIconLayout != PTL_NOICON && pwd->bIsTrayTip && pwd->rows[i].hIcon && !bIconPainted)
DrawIconExAlpha(hdc, opt.iPadding, tr.top + (pwd->rows[i].iValueHeight - 16) / 2, pwd->rows[i].hIcon, 16, 16, 0, NULL, DI_NORMAL, false);
UINT uFormat = opt.iValueValign | opt.iValueHalign | DT_WORDBREAK | DT_WORD_ELLIPSIS | DT_END_ELLIPSIS | DT_NOPREFIX;
@@ -1142,7 +1144,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa }
// titlebar height
- if (!pwd->bIsTextTip && pwd->swzTitle && opt.titleLayout != PTL_NOTITLE) {
+ if (!pwd->bIsTextTip && pwd->swzTitle && opt.bShowTitle) {
smr.top = smr.bottom = 0;
smr.left = rc.left + opt.iPadding + pwd->iIndent;
smr.right = rc.right;
diff --git a/plugins/TipperYM/src/resource.h b/plugins/TipperYM/src/resource.h index 5f14e5a4b2..2e2ae30fd7 100644 --- a/plugins/TipperYM/src/resource.h +++ b/plugins/TipperYM/src/resource.h @@ -125,6 +125,7 @@ #define IDC_BTN_APPLYSKIN 1124
#define IDC_BTN_VARIABLE 1125
#define IDC_BTN_GETSKINS 1125
+#define IDC_CHK_SHOWTITLE 1126
// Next default values for new objects
//
|