From fc1ccf076ac6239ddceb2075d81da9fe20584e40 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 24 Mar 2024 13:37:06 +0300 Subject: =?UTF-8?q?fixes=20#4293=20(NewStory:=20=D0=BA=D0=BD=D0=BE=D0=BF?= =?UTF-8?q?=D0=BA=D0=B0=20"=D0=A1=D0=B1=D1=80=D0=BE=D1=81=D0=B8=D1=82?= =?UTF-8?q?=D1=8C"=20=D0=BD=D0=B5=20=D0=BE=D1=82=D0=BA=D0=BB=D1=8E=D1=87?= =?UTF-8?q?=D0=B0=D0=B5=D1=82=D1=81=D1=8F)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/NewStory/src/options.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/plugins/NewStory/src/options.cpp b/plugins/NewStory/src/options.cpp index 1310285089..e8a0bae954 100644 --- a/plugins/NewStory/src/options.cpp +++ b/plugins/NewStory/src/options.cpp @@ -287,25 +287,21 @@ public: tvi.mask = TVIF_PARAM; m_tree.GetItem(&tvi); - if (tvi.lParam == 0) { - m_edit.Disable(); - preview.Disable(); - gpreview.Disable(); - btnDiscard.Disable(); - bthVarHelp.Disable(); - + bool bEnabled = tvi.lParam != 0; + m_edit.Enable(bEnabled); + preview.Enable(bEnabled); + gpreview.Enable(bEnabled); + btnReset.Enable(bEnabled); + btnDiscard.Enable(bEnabled); + bthVarHelp.Enable(bEnabled); + + if (!bEnabled) { HTREEITEM hItem = m_tree.GetChild(tvi.hItem); if (hItem) m_tree.Expand(tvi.hItem, TVE_EXPAND); return; } - m_edit.Enable(); - preview.Enable(); - gpreview.Enable(); - btnDiscard.Enable(); - bthVarHelp.Enable(); - if (m_curr != nullptr) replaceStrW(m_curr->tmpValue, m_edit.GetText()); -- cgit v1.2.3