diff options
author | George Hazan <ghazan@miranda.im> | 2020-05-05 19:03:57 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-05-05 19:03:57 +0300 |
commit | 01e2e633ef9c613464b84d8065d103d1112d4156 (patch) | |
tree | 367fc5552a313fbbdc25c5cb58a49b234a08507b /plugins/NewStory/src | |
parent | cfc04a114e5d83318f26e0641cfd36ed26736196 (diff) |
NewStory: option to hide scrollbar
Diffstat (limited to 'plugins/NewStory/src')
-rw-r--r-- | plugins/NewStory/src/history_control.cpp | 8 | ||||
-rw-r--r-- | plugins/NewStory/src/main.cpp | 3 | ||||
-rw-r--r-- | plugins/NewStory/src/options.cpp | 4 | ||||
-rw-r--r-- | plugins/NewStory/src/resource.h | 1 | ||||
-rw-r--r-- | plugins/NewStory/src/stdafx.h | 3 |
5 files changed, 14 insertions, 5 deletions
diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp index f7225ef153..e851c0b768 100644 --- a/plugins/NewStory/src/history_control.cpp +++ b/plugins/NewStory/src/history_control.cpp @@ -242,7 +242,8 @@ struct NewstoryListData : public MZeroedObject scrollTopPixel = cachedMaxTopPixel; } - RecalcScrollBar(); + if (g_plugin.bOptVScroll) + RecalcScrollBar(); } int LayoutItem(int index) @@ -505,7 +506,10 @@ LRESULT CALLBACK NewstoryListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case WM_CREATE: data = new NewstoryListData(hwnd); SetWindowLongPtr(hwnd, 0, (LONG_PTR)data); - data->RecalcScrollBar(); + if (!g_plugin.bOptVScroll) + SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) & ~WS_VSCROLL); + else + data->RecalcScrollBar(); break; // History list control messages diff --git a/plugins/NewStory/src/main.cpp b/plugins/NewStory/src/main.cpp index 4e1a540171..5f38b787a7 100644 --- a/plugins/NewStory/src/main.cpp +++ b/plugins/NewStory/src/main.cpp @@ -32,7 +32,8 @@ PLUGININFOEX pluginInfoEx = }; CMPlugin::CMPlugin() : - PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx) + PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx), + bOptVScroll(MODULENAME, "VScroll", true) { } diff --git a/plugins/NewStory/src/options.cpp b/plugins/NewStory/src/options.cpp index f6c681bda2..12c0581688 100644 --- a/plugins/NewStory/src/options.cpp +++ b/plugins/NewStory/src/options.cpp @@ -5,13 +5,15 @@ class CGeneralOptsDlg : public CDlgBase { - CCtrlCheck chkGrouping; + CCtrlCheck chkGrouping, chkVScroll; public: CGeneralOptsDlg() : CDlgBase(g_plugin, IDD_OPT_ADVANCED), + chkVScroll(this, IDC_VSCROLL), chkGrouping(this, IDC_GROUPING) { + CreateLink(chkVScroll, g_plugin.bOptVScroll); CreateLink(chkGrouping, g_bOptGrouping); } diff --git a/plugins/NewStory/src/resource.h b/plugins/NewStory/src/resource.h index e9dc7ace1d..8dc3868356 100644 --- a/plugins/NewStory/src/resource.h +++ b/plugins/NewStory/src/resource.h @@ -80,6 +80,7 @@ #define IDC_MONTHCALENDAR 1046 #define IDC_GROUPING 1047 #define IDC_TEMPLATES 1048 +#define IDC_VSCROLL 1048 #define IDC_EDITTEMPLATE 1049 #define IDC_PREVIEW 1050 #define IDC_GPREVIEW 1051 diff --git a/plugins/NewStory/src/stdafx.h b/plugins/NewStory/src/stdafx.h index 83ea563746..eb3adc1797 100644 --- a/plugins/NewStory/src/stdafx.h +++ b/plugins/NewStory/src/stdafx.h @@ -81,7 +81,8 @@ struct CMPlugin : public PLUGIN<CMPlugin> { HANDLE m_log; - bool bMsgGrouping; + CMOption<bool> bOptVScroll; + bool bMsgGrouping; // this option is a copy of static CMOption to keep performance high CMPlugin(); |