summaryrefslogtreecommitdiff
path: root/plugins/NewStory/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-10-22 20:33:56 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-10-22 20:33:56 +0300
commit29be1661e4f294cc1056a1d315001f25acfbb21f (patch)
treefb82c9ca81e26dea9ec26dbe68677aeca7efd6bb /plugins/NewStory/src
parent57f3aa3dbcefdd94a4f26a71adccfe8ebe988eab (diff)
fixes #4602 (NewStory: сделать опцию для ограничения максимальной высоты превьюшки изображения)
Diffstat (limited to 'plugins/NewStory/src')
-rw-r--r--plugins/NewStory/src/main.cpp2
-rw-r--r--plugins/NewStory/src/options.cpp5
-rw-r--r--plugins/NewStory/src/resource.h4
-rw-r--r--plugins/NewStory/src/stdafx.h1
-rw-r--r--plugins/NewStory/src/templates.cpp6
5 files changed, 13 insertions, 5 deletions
diff --git a/plugins/NewStory/src/main.cpp b/plugins/NewStory/src/main.cpp
index e497dce495..f271bf1f40 100644
--- a/plugins/NewStory/src/main.cpp
+++ b/plugins/NewStory/src/main.cpp
@@ -36,6 +36,8 @@ CMOption<uint32_t> g_clCustom2(MODULENAME, "CustomColor2", -1);
CMOption<uint32_t> g_clCustom3(MODULENAME, "CustomColor3", -1);
CMOption<uint32_t> g_clCustom4(MODULENAME, "CustomColor4", -1);
+CMOption<int> g_iPreviewHeight(MODULENAME, "PreviewHeight", 300);
+
MWindowList g_hNewstoryWindows = 0, g_hNewstoryLogs = 0;
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/NewStory/src/options.cpp b/plugins/NewStory/src/options.cpp
index a879a54e91..7098909ecd 100644
--- a/plugins/NewStory/src/options.cpp
+++ b/plugins/NewStory/src/options.cpp
@@ -41,12 +41,14 @@ protected:
class CGeneralOptsDlg : public CBaseOptsDlg
{
+ CCtrlSpin spinHeight;
CCtrlCheck chkGrouping, chkVScroll, chkDrawEdge, chkSortOrder, chkHppCompat;
CCtrlCheck chkShowType, chkShowPreview, chkShowDirection;
public:
CGeneralOptsDlg() :
CBaseOptsDlg(IDD_OPT_ADVANCED),
+ spinHeight(this, IDC_SPIN1, 500, 200),
chkVScroll(this, IDC_VSCROLL),
chkShowType(this, IDC_SHOW_TYPE),
chkDrawEdge(this, IDC_DRAWEDGE),
@@ -60,11 +62,12 @@ public:
CreateLink(chkShowType, g_bShowType);
CreateLink(chkGrouping, g_bOptGrouping);
CreateLink(chkDrawEdge, g_bOptDrawEdge);
+ CreateLink(chkSortOrder, g_plugin.bSortAscending);
CreateLink(chkHppCompat, g_bOptHppCompat);
CreateLink(chkShowPreview, g_bShowPreview);
CreateLink(chkShowDirection, g_bShowDirection);
- CreateLink(chkSortOrder, g_plugin.bSortAscending);
+ CreateLink(spinHeight, g_iPreviewHeight);
}
bool OnApply() override
diff --git a/plugins/NewStory/src/resource.h b/plugins/NewStory/src/resource.h
index be213cd879..a53b45a995 100644
--- a/plugins/NewStory/src/resource.h
+++ b/plugins/NewStory/src/resource.h
@@ -102,7 +102,9 @@
#define IDC_TOPLINE 1062
#define IDC_SHOW_PREVIEW 1062
#define IDC_DELSERVERHISTORY 1063
+#define IDC_PREVIEW_HEIGHT 1063
#define IDC_BOTH 1064
+#define IDC_SPIN1 1064
#define IDC_COLOR1 1065
#define IDC_COLOR2 1066
#define IDC_COLOR3 1067
@@ -130,7 +132,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 131
#define _APS_NEXT_COMMAND_VALUE 40019
-#define _APS_NEXT_CONTROL_VALUE 1061
+#define _APS_NEXT_CONTROL_VALUE 1065
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
diff --git a/plugins/NewStory/src/stdafx.h b/plugins/NewStory/src/stdafx.h
index 324b17befc..a0edec01c5 100644
--- a/plugins/NewStory/src/stdafx.h
+++ b/plugins/NewStory/src/stdafx.h
@@ -128,6 +128,7 @@ struct CMPlugin : public PLUGIN<CMPlugin>
extern CMOption<bool> g_bOptGrouping, g_bOptDrawEdge, g_bOptHppCompat, g_bShowType, g_bShowDirection, g_bShowPreview;
extern CMOption<uint32_t> g_clCustom0, g_clCustom1, g_clCustom2, g_clCustom3, g_clCustom4;
+extern CMOption<int> g_iPreviewHeight;
extern wchar_t* months[12];
extern int g_iPixelY;
diff --git a/plugins/NewStory/src/templates.cpp b/plugins/NewStory/src/templates.cpp
index 36c6cedadb..e915e468ae 100644
--- a/plugins/NewStory/src/templates.cpp
+++ b/plugins/NewStory/src/templates.cpp
@@ -45,7 +45,7 @@ static wchar_t* font2html(LOGFONTA &lf, wchar_t *dest)
return dest;
}
-static void AppendImage(CMStringW &buf, const CMStringW &wszUrl, const CMStringW &wszDescr, ItemData *pItem, UINT uMaxHeight = 300)
+static void AppendImage(CMStringW &buf, const CMStringW &wszUrl, const CMStringW &wszDescr, ItemData *pItem, UINT uMaxHeight)
{
if (g_plugin.bShowPreview) {
pItem->pOwner->webPage.load_image(wszUrl, pItem);
@@ -150,7 +150,7 @@ static void AppendString(CMStringW &buf, const wchar_t *p, ItemData *pItem)
if (auto *p2 = wcsstr(p1, L"[/img]")) {
CMStringW wszDescr(p1, int(p2 - p1));
- AppendImage(buf, wszUrl, wszDescr, pItem, iMaxHeight ? iMaxHeight : 300);
+ AppendImage(buf, wszUrl, wszDescr, pItem, iMaxHeight ? iMaxHeight : g_iPreviewHeight);
p = p2 + 5;
}
}
@@ -161,7 +161,7 @@ static void AppendString(CMStringW &buf, const wchar_t *p, ItemData *pItem)
if (auto *p1 = wcsstr(p, L"[/img]")) {
CMStringW wszUrl(p, int(p1 - p));
- AppendImage(buf, wszUrl, L"", pItem);
+ AppendImage(buf, wszUrl, L"", pItem, g_iPreviewHeight);
p = p1 + 5;
}
else p--;