summaryrefslogtreecommitdiff
path: root/plugins/Scriver/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Scriver/src')
-rw-r--r--plugins/Scriver/src/globals.cpp3
-rw-r--r--plugins/Scriver/src/globals.h1
-rw-r--r--plugins/Scriver/src/msgoptions.cpp12
-rw-r--r--plugins/Scriver/src/msgs.h4
-rw-r--r--plugins/Scriver/src/msgwindow.cpp21
-rw-r--r--plugins/Scriver/src/resource.h2
6 files changed, 24 insertions, 19 deletions
diff --git a/plugins/Scriver/src/globals.cpp b/plugins/Scriver/src/globals.cpp
index 9a81ebcdbb..6e9a23b22b 100644
--- a/plugins/Scriver/src/globals.cpp
+++ b/plugins/Scriver/src/globals.cpp
@@ -390,9 +390,12 @@ void ReloadGlobals() {
g_dat->flags2 |= SMF2_SWITCHTOACTIVE;
if (DBGetContactSettingByte(NULL, SRMMMOD, SRMSGSET_LIMITNAMES, SRMSGDEFSET_LIMITNAMES))
g_dat->flags2 |= SMF2_LIMITNAMES;
+ if (DBGetContactSettingByte(NULL, SRMMMOD, SRMSGSET_HIDEONETAB, SRMSGDEFSET_HIDEONETAB))
g_dat->flags2 |= SMF2_HIDEONETAB;
if (DBGetContactSettingByte(NULL, SRMMMOD, SRMSGSET_SEPARATECHATSCONTAINERS, SRMSGDEFSET_SEPARATECHATSCONTAINERS))
g_dat->flags2 |= SMF2_SEPARATECHATSCONTAINERS;
+ if (DBGetContactSettingByte(NULL, SRMMMOD, SRMSGSET_TABCLOSEBUTTON, SRMSGDEFSET_TABCLOSEBUTTON))
+ g_dat->flags2 |= SMF2_TABCLOSEBUTTON;
if (DBGetContactSettingByte(NULL, SRMMMOD, SRMSGSET_LIMITTABS, SRMSGDEFSET_LIMITTABS))
g_dat->flags2 |= SMF2_LIMITTABS;
if (DBGetContactSettingByte(NULL, SRMMMOD, SRMSGSET_LIMITCHATSTABS, SRMSGDEFSET_LIMITCHATSTABS))
diff --git a/plugins/Scriver/src/globals.h b/plugins/Scriver/src/globals.h
index d3ec2af2d8..dd3e07d595 100644
--- a/plugins/Scriver/src/globals.h
+++ b/plugins/Scriver/src/globals.h
@@ -59,6 +59,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define SMF2_LIMITNAMES 0x00000008
#define SMF2_SWITCHTOACTIVE 0x00000010
#define SMF2_SEPARATECHATSCONTAINERS 0x00000020
+#define SMF2_TABCLOSEBUTTON 0x00000040
#define SMF2_LIMITTABS 0x00000080
#define SMF2_LIMITCHATSTABS 0x00000100
#define SMF2_HIDECONTAINERS 0x00000200
diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp
index fb660d59d7..ea103245bd 100644
--- a/plugins/Scriver/src/msgoptions.cpp
+++ b/plugins/Scriver/src/msgoptions.cpp
@@ -370,8 +370,10 @@ static INT_PTR CALLBACK DlgProcTabsOptions(HWND hwndDlg, UINT msg, WPARAM wParam
int bChecked;
TranslateDialogDefault(hwndDlg);
CheckDlgButton(hwndDlg, IDC_USETABS, DBGetContactSettingByte(NULL, SRMMMOD, SRMSGSET_USETABS, SRMSGDEFSET_USETABS));
+ CheckDlgButton(hwndDlg, IDC_ALWAYSSHOWTABS, !DBGetContactSettingByte(NULL, SRMMMOD, SRMSGSET_HIDEONETAB, SRMSGDEFSET_HIDEONETAB));
CheckDlgButton(hwndDlg, IDC_TABSATBOTTOM, DBGetContactSettingByte(NULL, SRMMMOD, SRMSGSET_TABSATBOTTOM, SRMSGDEFSET_TABSATBOTTOM));
CheckDlgButton(hwndDlg, IDC_SWITCHTOACTIVE, DBGetContactSettingByte(NULL, SRMMMOD, SRMSGSET_SWITCHTOACTIVE, SRMSGDEFSET_SWITCHTOACTIVE));
+ CheckDlgButton(hwndDlg, IDC_TABCLOSEBUTTON, DBGetContactSettingByte(NULL, SRMMMOD, SRMSGSET_TABCLOSEBUTTON, SRMSGDEFSET_TABCLOSEBUTTON));
CheckDlgButton(hwndDlg, IDC_LIMITNAMES, DBGetContactSettingByte(NULL, SRMMMOD, SRMSGSET_LIMITNAMES, SRMSGDEFSET_LIMITNAMES));
limitLength = DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_LIMITNAMESLEN, SRMSGDEFSET_LIMITNAMESLEN);
(int)SetDlgItemInt(hwndDlg, IDC_LIMITNAMESLEN, limitLength >= SRMSGSET_LIMITNAMESLEN_MIN ? limitLength : SRMSGDEFSET_LIMITNAMESLEN, FALSE);
@@ -387,8 +389,10 @@ static INT_PTR CALLBACK DlgProcTabsOptions(HWND hwndDlg, UINT msg, WPARAM wParam
CheckDlgButton(hwndDlg, IDC_SEPARATECHATSCONTAINERS, DBGetContactSettingByte(NULL, SRMMMOD, SRMSGSET_SEPARATECHATSCONTAINERS, SRMSGDEFSET_SEPARATECHATSCONTAINERS));
bChecked = IsDlgButtonChecked(hwndDlg, IDC_USETABS);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ALWAYSSHOWTABS), bChecked );
EnableWindow(GetDlgItem(hwndDlg, IDC_TABSATBOTTOM), bChecked );
- EnableWindow(GetDlgItem(hwndDlg, IDC_SWITCHTOACTIVE), bChecked);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SWITCHTOACTIVE), bChecked );
+ EnableWindow(GetDlgItem(hwndDlg, IDC_TABCLOSEBUTTON), bChecked );
EnableWindow(GetDlgItem(hwndDlg, IDC_LIMITNAMES), bChecked );
EnableWindow(GetDlgItem(hwndDlg, IDC_SEPARATECHATSCONTAINERS), bChecked );
EnableWindow(GetDlgItem(hwndDlg, IDC_LIMITTABS), bChecked );
@@ -411,7 +415,9 @@ static INT_PTR CALLBACK DlgProcTabsOptions(HWND hwndDlg, UINT msg, WPARAM wParam
EnableWindow(GetDlgItem(hwndDlg, IDC_SWITCHTOACTIVE), bChecked);
EnableWindow(GetDlgItem(hwndDlg, IDC_TABSATBOTTOM), bChecked);
EnableWindow(GetDlgItem(hwndDlg, IDC_LIMITNAMES), bChecked);
- EnableWindow(GetDlgItem(hwndDlg, IDC_SEPARATECHATSCONTAINERS), bChecked );
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ALWAYSSHOWTABS), bChecked);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_TABCLOSEBUTTON), bChecked);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SEPARATECHATSCONTAINERS), bChecked);
EnableWindow(GetDlgItem(hwndDlg, IDC_LIMITTABS), bChecked);
}
case IDC_LIMITTABS:
@@ -466,7 +472,9 @@ static INT_PTR CALLBACK DlgProcTabsOptions(HWND hwndDlg, UINT msg, WPARAM wParam
limitLength = GetDlgItemInt(hwndDlg, IDC_LIMITCHATSTABSNUM, NULL, TRUE) >= 1 ? GetDlgItemInt(hwndDlg, IDC_LIMITCHATSTABSNUM, NULL, TRUE) : 1;
DBWriteContactSettingDword(NULL, SRMMMOD, SRMSGSET_LIMITCHATSTABSNUM, limitLength);
+ DBWriteContactSettingByte(NULL, SRMMMOD, SRMSGSET_HIDEONETAB, (BYTE) !IsDlgButtonChecked(hwndDlg, IDC_ALWAYSSHOWTABS));
DBWriteContactSettingByte(NULL, SRMMMOD, SRMSGSET_SWITCHTOACTIVE, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SWITCHTOACTIVE));
+ DBWriteContactSettingByte(NULL, SRMMMOD, SRMSGSET_TABCLOSEBUTTON, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_TABCLOSEBUTTON));
DBWriteContactSettingByte(NULL, SRMMMOD, SRMSGSET_SEPARATECHATSCONTAINERS, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SEPARATECHATSCONTAINERS));
ApplyChanges(8);
diff --git a/plugins/Scriver/src/msgs.h b/plugins/Scriver/src/msgs.h
index e17c63897d..a28dcb963f 100644
--- a/plugins/Scriver/src/msgs.h
+++ b/plugins/Scriver/src/msgs.h
@@ -266,11 +266,15 @@ extern int fontOptionsListSize;
#define SRMSGDEFSET_USETABS 1
#define SRMSGSET_TABSATBOTTOM "TabsPosition"
#define SRMSGDEFSET_TABSATBOTTOM 0
+#define SRMSGSET_TABCLOSEBUTTON "TabCloseButton"
+#define SRMSGDEFSET_TABCLOSEBUTTON 0
#define SRMSGSET_LIMITNAMES "LimitNamesOnTabs"
#define SRMSGDEFSET_LIMITNAMES 1
#define SRMSGSET_LIMITNAMESLEN "LimitNamesLength"
#define SRMSGDEFSET_LIMITNAMESLEN 20
#define SRMSGSET_LIMITNAMESLEN_MIN 0
+#define SRMSGSET_HIDEONETAB "HideOneTab"
+#define SRMSGDEFSET_HIDEONETAB 1
#define SRMSGSET_SEPARATECHATSCONTAINERS "SeparateChatsContainers"
#define SRMSGDEFSET_SEPARATECHATSCONTAINERS 0
#define SRMSGSET_LIMITTABS "LimitTabs"
diff --git a/plugins/Scriver/src/msgwindow.cpp b/plugins/Scriver/src/msgwindow.cpp
index a59e0482e8..4fa52a0005 100644
--- a/plugins/Scriver/src/msgwindow.cpp
+++ b/plugins/Scriver/src/msgwindow.cpp
@@ -346,16 +346,6 @@ static void ActivateChild(ParentWindowData *dat, HWND child) {
}
}
-static void UpdateTabsPadding(ParentWindowData *dat)
-{
- if (dat->childrenCount > 1) {
-// ws |= 0x2000; //TCS_OWNERDRAWFIXED
- TabCtrl_SetPadding(dat->hwndTabs, GetSystemMetrics(SM_CXEDGE) + 12, GetSystemMetrics(SM_CYEDGE) + 1);
- } else {
- TabCtrl_SetPadding(dat->hwndTabs, GetSystemMetrics(SM_CXEDGE) + 4, GetSystemMetrics(SM_CYEDGE) + 1);
- }
-}
-
static void AddChild(ParentWindowData *dat, HWND hwnd, HANDLE hContact)
{
TCITEM tci;
@@ -372,7 +362,6 @@ static void AddChild(ParentWindowData *dat, HWND hwnd, HANDLE hContact)
tci.pszText = _T("");
tabId = TabCtrl_InsertItem(dat->hwndTabs, dat->childrenCount-1, &tci);
// ActivateChild(dat, mdat->hwnd);
- UpdateTabsPadding(dat);
SetWindowPos(mwtd->hwnd, HWND_TOP, dat->childRect.left, dat->childRect.top, dat->childRect.right-dat->childRect.left, dat->childRect.bottom - dat->childRect.top, SWP_HIDEWINDOW);
SendMessage(dat->hwnd, WM_SIZE, 0, 0);
@@ -398,7 +387,6 @@ static void RemoveChild(ParentWindowData *dat, HWND child)
else
dat->hwndActive = NULL;
}
- UpdateTabsPadding(dat);
ReleaseIcon(tci.iImage);
}
}
@@ -413,7 +401,6 @@ static void CloseOtherChilden(ParentWindowData *dat, HWND child)
SendMessage(mwtd->hwnd, WM_CLOSE, 0, 0);
}
}
- UpdateTabsPadding(dat);
ActivateChild(dat, child);
}
@@ -471,7 +458,7 @@ static void SetContainerWindowStyle(ParentWindowData *dat)
ws |= TCS_BOTTOM;
}
ws |= 0x2000; //TCS_OWNERDRAWFIXED
- if (dat->childrenCount > 1) {
+ if (dat->flags2 & SMF2_TABCLOSEBUTTON) {
// ws |= 0x2000; //TCS_OWNERDRAWFIXED
TabCtrl_SetPadding(dat->hwndTabs, GetSystemMetrics(SM_CXEDGE) + 12, GetSystemMetrics(SM_CYEDGE) + 1);
} else {
@@ -1231,7 +1218,7 @@ static void DrawTab(ParentWindowData *dat, HWND hwnd, WPARAM wParam, LPARAM lPar
ImageList_DrawEx(g_dat->hTabIconList, tci.iImage, lpDIS->hDC, rIcon.left, rIcon.top, 0, 0, CLR_NONE, CLR_NONE, ILD_NORMAL);
rect.left = rIcon.left + (info.rcImage.right - info.rcImage.left);
}
- if (dat->childrenCount > 1) {
+ if (dat->flags2 & SMF2_TABCLOSEBUTTON) {
ImageList_GetImageInfo(g_dat->hButtonIconList, 0, &info);
rIcon.left = rect.right - GetSystemMetrics(SM_CXEDGE) - (bSelected ? 6 : 2) - (info.rcImage.right - info.rcImage.left);
ImageList_DrawEx(g_dat->hButtonIconList, 0, lpDIS->hDC, rIcon.left, rIcon.top, 0, 0, CLR_NONE, CLR_NONE, ILD_NORMAL);
@@ -1247,7 +1234,7 @@ static void DrawTab(ParentWindowData *dat, HWND hwnd, WPARAM wParam, LPARAM lPar
ImageList_DrawEx(g_dat->hTabIconList, tci.iImage, lpDIS->hDC, rIcon.left, rIcon.top, 0, 0, CLR_NONE, CLR_NONE, ILD_NORMAL);
rect.left = rIcon.left + (info.rcImage.right - info.rcImage.left);
}
- if (dat->childrenCount > 1) {
+ if (dat->flags2 & SMF2_TABCLOSEBUTTON) {
ImageList_GetImageInfo(g_dat->hButtonIconList, 0, &info);
rIcon.top = rect.bottom - (info.rcImage.bottom - info.rcImage.top) - 2;
rIcon.left = rect.right - GetSystemMetrics(SM_CXEDGE) - (bSelected ? 6 : 2) - (info.rcImage.right - info.rcImage.left);
@@ -1462,7 +1449,7 @@ BOOL CALLBACK TabCtrlProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
dat->destTab = -1;
RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW);
}
- } else if (dat->srcTab >= 0 && TabCtrl_GetItemCount(hwnd) > 1) {
+ } else if (dat->srcTab >= 0 && g_dat->flags2 & SMF2_TABCLOSEBUTTON) {
IMAGEINFO info;
POINT pt;
RECT rect;
diff --git a/plugins/Scriver/src/resource.h b/plugins/Scriver/src/resource.h
index 07ea9a6546..6f48c2d97a 100644
--- a/plugins/Scriver/src/resource.h
+++ b/plugins/Scriver/src/resource.h
@@ -83,6 +83,7 @@
#define IDC_STAYMINIMIZED 1006
#define IDC_SWITCHTOACTIVE 1007
#define IDC_SEPARATECHATSCONTAINERS 1008
+#define IDC_TABCLOSEBUTTON 1009
#define IDC_LIMITTABS 1010
#define IDC_LIMITTABSNUM 1011
#define IDC_LIMITCHATSTABS 1012
@@ -150,6 +151,7 @@
#define IDC_ATRANSPARENCYPERC 1620
#define IDC_ITRANSPARENCYVALUE 1621
#define IDC_ITRANSPARENCYPERC 1622
+#define IDC_ALWAYSSHOWTABS 1623
#define IDC_SENDALL 1624
#define IDC_TRANSPARENCYTEXT1 1627
#define IDC_TRANSPARENCYTEXT2 1628