diff options
author | George Hazan <ghazan@miranda.im> | 2020-05-01 20:15:02 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-05-01 20:15:02 +0300 |
commit | 9b7e17fc68e9e641a43b220375338bc2cebeed5f (patch) | |
tree | 8dce65bf7d849b3a61763086a7e98151e4a28beb /src/mir_app | |
parent | e4110132f0123c2b3da9deb5b55c915e4178b07d (diff) |
fix for pszTab argument behavior of the Options dialog
Diffstat (limited to 'src/mir_app')
-rw-r--r-- | src/mir_app/src/options.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mir_app/src/options.cpp b/src/mir_app/src/options.cpp index dfb378504e..4ce9ef73fb 100644 --- a/src/mir_app/src/options.cpp +++ b/src/mir_app/src/options.cpp @@ -964,6 +964,10 @@ public: opd->bInsideTab = IsInsideTab(m_currentPage);
if (opd->bInsideTab) {
+ // if called inside OnInitDialog, we use tab setting passed for positioning
+ // or the first tab of the current tree item
+ auto *pwszTab = (IsInitialized()) ? opd->ptszTab : m_szTab;
+
// Make tabbed pane
int pages = 0, sel = 0;
HWND hwndTab = GetDlgItem(m_hwnd, IDC_TAB);
@@ -983,7 +987,7 @@ public: tie.pszText = TranslateW_LP(p->ptszTab, p->pPlugin);
tie.lParam = i;
TabCtrl_InsertItem(hwndTab, pages, &tie);
- if (!mir_wstrcmp(opd->ptszTab, p->ptszTab))
+ if (!mir_wstrcmp(pwszTab, p->ptszTab))
sel = pages;
pages++;
}
|