From 9f5f0276d87dd9b8fc019a6b2cdfe3347df5526f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignacio=20Rodr=C3=ADguez?= Date: Thu, 21 Jan 2021 17:46:01 +0700 Subject: [PATCH] Duplicating text spaces after dot only for Mac (#6914) * duplicating text spaces after dot * updated changelog * implemented suggestion Co-authored-by: SerhiiGadzhilov <71632867+SerhiiGadzhilov@users.noreply.github.com> --- ChangeLog | 1 + src/gui/src/SetupWizard.cpp | 18 ++++++++++++++++++ src/gui/src/SetupWizard.h | 4 ++++ src/gui/src/main.cpp | 6 +++--- 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ea374e4135..da91795948 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ Bug fixes: - #6900 Remaining SonarCloud reported bug items - #6903 Save global settings - #6889 Systray Icon on Ubuntu Auto Start (take 2) +- #6914 Fix for Qt Word Wrap on Mac Enhancements: - #6912 Removes UI for Screen Saver Sync and Files Drag and Drop diff --git a/src/gui/src/SetupWizard.cpp b/src/gui/src/SetupWizard.cpp index 4714a96547..ba761ae94e 100644 --- a/src/gui/src/SetupWizard.cpp +++ b/src/gui/src/SetupWizard.cpp @@ -37,6 +37,9 @@ SetupWizard::SetupWizard(MainWindow& mainWindow, bool startMain) : resize(600, 500); setMinimumSize(size()); + // additionally, we identified an issue with presenting dots, see SYNERGY-719 + duplicateSpaces(); + #elif defined(Q_OS_WIN) // when areo is disabled on windows, the next/back buttons @@ -146,4 +149,19 @@ void SetupWizard::on_m_pComboLanguage_currentIndexChanged(int index) { QString ietfCode = m_pComboLanguage->itemData(index).toString(); QSynergyApplication::getInstance()->switchTranslator(ietfCode); +#if defined(Q_OS_MAC) + duplicateSpaces(); +#endif // defined(Q_OS_MAC) } + +#if defined(Q_OS_MAC) +void SetupWizard::duplicateSpaces() +{ + auto list = this->findChildren(); + foreach(QLabel *l, list) { + if (l->wordWrap()) { + l->setText(l->text().replace(". ", ". ")); + } + } +} +#endif // defined(Q_OS_MAC) diff --git a/src/gui/src/SetupWizard.h b/src/gui/src/SetupWizard.h index 5e3173eaec..27b77598be 100644 --- a/src/gui/src/SetupWizard.h +++ b/src/gui/src/SetupWizard.h @@ -48,6 +48,10 @@ private: bool m_StartMain; SynergyLocale m_Locale; +#if defined(Q_OS_MAC) + void duplicateSpaces(); +#endif // defined(Q_OS_MAC) + private slots: void on_m_pComboLanguage_currentIndexChanged(int index); }; diff --git a/src/gui/src/main.cpp b/src/gui/src/main.cpp index 336e11dabd..2de9b6f188 100644 --- a/src/gui/src/main.cpp +++ b/src/gui/src/main.cpp @@ -97,11 +97,11 @@ int main(int argc, char* argv[]) QObject::connect(dynamic_cast(&app), SIGNAL(aboutToQuit()), &mainWindow, SLOT(saveSettings())); - SetupWizard setupWizard(mainWindow, true); - + std::unique_ptr setupWizard; if (appConfig.wizardShouldRun()) { - setupWizard.show(); + setupWizard.reset(new SetupWizard(mainWindow, true)); + setupWizard->show(); } else {