Skip to content

Commit

Permalink
disable FR hack workaround as no longer needed in recent Qts
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinhendricks committed Feb 16, 2025
1 parent 8615e46 commit 869ebd2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
1 change: 1 addition & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pre-2.X.X
- because Linux has multiple light and dark themes (but different)
always send out our internal theme change signal when palette changes
- detect urls in altimg attributes in math tags and properly update them is changed
- disable workaround for FR open interfering in MainWindow restorestate as no longer needed

New Features
- upgrade MacOS and Windows release and ci builds to use Qt 6.8.2
Expand Down
18 changes: 14 additions & 4 deletions src/MainUI/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1730,8 +1730,10 @@ void MainWindow::closeEvent(QCloseEvent *event)

DBG qDebug() << "in close event before maybe save";

#if 0
bool find_was_open = m_FindReplace->isVisible();

#endif

// this should be done first to save all geometry
// extra saves should not be an issue if the window close is abandoned
WriteSettings();
Expand Down Expand Up @@ -1781,10 +1783,13 @@ void MainWindow::closeEvent(QCloseEvent *event)
} else {
event->ignore();
SetupPreviewTimer();
// WriteSettings closes F&R if open so repoen if needed

#if 0
// WriteSettings closes F&R if open so reopen if needed
if (find_was_open) {
QTimer::singleShot(10, this, SLOT(Find()));
}
#endif
m_IsClosing = false;
}
}
Expand Down Expand Up @@ -4936,8 +4941,10 @@ void MainWindow::ReadSettings()
// So read in now but delay restore until the first time the widget is made active
m_LastState = settings.value("toolbars",QByteArray()).toByteArray();

#if 0
// Work around saved state restore bug with Find and Replace
m_FRVisible = settings.value("frvisible", false).toBool();
#endif

QByteArray lastWindowSize = settings.value("geometry", QByteArray()).toByteArray();
if (!lastWindowSize.isEmpty()) restoreGeometry(lastWindowSize);
Expand Down Expand Up @@ -5036,12 +5043,14 @@ void MainWindow::WriteSettings()
settings.setValue("maximized", isMaximized());
settings.setValue("fullscreen",isFullScreen());

#if 0
// work around Find Replace saved state restore bug on macOS
settings.setValue("frvisible",m_FindReplace->isVisible());
if (m_FindReplace->isVisible()) {
// can not use just hide() and FR keeps its own internal state
m_FindReplace->HideFindReplace();
}
#endif

DBG DebugCurrentWidgetSizes();

Expand Down Expand Up @@ -5823,7 +5832,6 @@ void MainWindow::ExtendUI()
}
}

m_FindReplace->ShowHide();
// We want a nice frame around the tab manager
QFrame *frame = new QFrame(this);
QLayout *layout = new QVBoxLayout(frame);
Expand Down Expand Up @@ -6211,10 +6219,12 @@ void MainWindow::changeEvent(QEvent *e)

if (m_FirstTime) {
if (!m_LastState.isEmpty()) restoreState(m_LastState);


#if 0
if (m_FRVisible) {
QTimer::singleShot(30, this, SLOT(Find()));
}
#endif

DWINGEO {
QScreen * srn = qApp->primaryScreen();
Expand Down
4 changes: 2 additions & 2 deletions src/MainUI/MainWindow.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/************************************************************************
**
** Copyright (C) 2015-2024 Kevin B. Hendricks, Stratford, Ontario, Canada
** Copyright (C) 2015-2025 Kevin B. Hendricks, Stratford, Ontario, Canada
** Copyright (C) 2015-2022 Doug Massay
** Copyright (C) 2012-2015 John Schember <[email protected]>
** Copyright (C) 2012 Dave Heiland
Expand Down Expand Up @@ -1076,7 +1076,7 @@ private slots:

QString m_mathjaxfolder;

bool m_FRVisible;
// bool m_FRVisible;

bool m_UsingAutomate;
QStringList m_AutomateLog;
Expand Down

0 comments on commit 869ebd2

Please sign in to comment.