From 29be1661e4f294cc1056a1d315001f25acfbb21f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 22 Oct 2024 20:33:56 +0300 Subject: =?UTF-8?q?fixes=20#4602=20(NewStory:=20=D1=81=D0=B4=D0=B5=D0=BB?= =?UTF-8?q?=D0=B0=D1=82=D1=8C=20=D0=BE=D0=BF=D1=86=D0=B8=D1=8E=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20=D0=BE=D0=B3=D1=80=D0=B0=D0=BD=D0=B8=D1=87=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F=20=D0=BC=D0=B0=D0=BA=D1=81=D0=B8=D0=BC=D0=B0?= =?UTF-8?q?=D0=BB=D1=8C=D0=BD=D0=BE=D0=B9=20=D0=B2=D1=8B=D1=81=D0=BE=D1=82?= =?UTF-8?q?=D1=8B=20=D0=BF=D1=80=D0=B5=D0=B2=D1=8C=D1=8E=D1=88=D0=BA=D0=B8?= =?UTF-8?q?=20=D0=B8=D0=B7=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/NewStory/res/resource.rc | 18 ++++++++++++++---- plugins/NewStory/src/main.cpp | 2 ++ plugins/NewStory/src/options.cpp | 5 ++++- plugins/NewStory/src/resource.h | 4 +++- plugins/NewStory/src/stdafx.h | 1 + plugins/NewStory/src/templates.cpp | 6 +++--- 6 files changed, 27 insertions(+), 9 deletions(-) diff --git a/plugins/NewStory/res/resource.rc b/plugins/NewStory/res/resource.rc index 470db6d250..b3f4494f6f 100644 --- a/plugins/NewStory/res/resource.rc +++ b/plugins/NewStory/res/resource.rc @@ -74,11 +74,18 @@ IDI_USERS ICON "users.ico" IDI_REPLY ICON "reply.ico" -IDI_NO_IMAGE PNG "no-image-ico.png" - IDI_DELIVERED ICON "delivered.ico" -IDI_REMOTEREAD ICON "remoteread.ico" +IDI_REMOTEREAD ICON "remoteread.ico" + + +///////////////////////////////////////////////////////////////////////////// +// +// PNG +// + +IDI_NO_IMAGE PNG "no-image-ico.png" + ///////////////////////////////////////////////////////////////////////////// // @@ -152,7 +159,7 @@ IDD_OPT_ADVANCED DIALOGEX 0, 0, 307, 223 STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN - GROUPBOX "Log window",IDC_STATIC,0,0,307,119 + GROUPBOX "Log window",IDC_STATIC,0,0,307,133 CONTROL "Group messages",IDC_GROUPING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,9,289,12 CONTROL "Enable vertical scroll bar",IDC_VSCROLL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,22,289,12 CONTROL "Draw window edge",IDC_DRAWEDGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,35,289,12 @@ -161,6 +168,9 @@ BEGIN CONTROL "Show event type",IDC_SHOW_TYPE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,74,289,12 CONTROL "Show event direction",IDC_SHOW_DIRECTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,87,289,12 CONTROL "Show picture preview",IDC_SHOW_PREVIEW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,100,289,12 + LTEXT "Maximum preview height (in pixels)",IDC_STATIC,11,117,235,9 + EDITTEXT IDC_PREVIEW_HEIGHT,254,114,40,14,ES_AUTOHSCROLL + CONTROL "",IDC_SPIN1,"msctls_updown32",UDS_SETBUDDYINT | UDS_AUTOBUDDY | UDS_ARROWKEYS,290,114,11,14 END IDD_OPT_TEMPLATES DIALOGEX 0, 0, 307, 234 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 g_clCustom2(MODULENAME, "CustomColor2", -1); CMOption g_clCustom3(MODULENAME, "CustomColor3", -1); CMOption g_clCustom4(MODULENAME, "CustomColor4", -1); +CMOption 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 extern CMOption g_bOptGrouping, g_bOptDrawEdge, g_bOptHppCompat, g_bShowType, g_bShowDirection, g_bShowPreview; extern CMOption g_clCustom0, g_clCustom1, g_clCustom2, g_clCustom3, g_clCustom4; +extern CMOption 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--; -- cgit v1.2.3