From fe05b5994cf4403c5069e225ae81c4f8d023848d Mon Sep 17 00:00:00 2001 From: Mm2PL Date: Mon, 6 Jan 2025 22:18:39 +0100 Subject: [PATCH 01/12] Fix: Take Lua HTTP callbacks as sol::main_protected_function (#5800) Co-authored-by: Nerixyz --- CHANGELOG.md | 2 ++ src/controllers/plugins/api/HTTPRequest.cpp | 6 +++--- src/controllers/plugins/api/HTTPRequest.hpp | 12 ++++++------ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9b8ae37007..f38527c575d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unversioned +- Bugfix: Fixed a crash relating to Lua HTTP. (#5800) + ## 2.5.2 - Bugfix: Fixed a crash in the 7TV EventApi when closing Chatterino. (#5768) diff --git a/src/controllers/plugins/api/HTTPRequest.cpp b/src/controllers/plugins/api/HTTPRequest.cpp index a1a97f616c8..a270e815147 100644 --- a/src/controllers/plugins/api/HTTPRequest.cpp +++ b/src/controllers/plugins/api/HTTPRequest.cpp @@ -49,12 +49,12 @@ void HTTPRequest::createUserType(sol::table &c2) ); } -void HTTPRequest::on_success(sol::protected_function func) +void HTTPRequest::on_success(sol::main_protected_function func) { this->cbSuccess = std::make_optional(func); } -void HTTPRequest::on_error(sol::protected_function func) +void HTTPRequest::on_error(sol::main_protected_function func) { this->cbError = std::make_optional(func); } @@ -64,7 +64,7 @@ void HTTPRequest::set_timeout(int timeout) this->timeout_ = timeout; } -void HTTPRequest::finally(sol::protected_function func) +void HTTPRequest::finally(sol::main_protected_function func) { this->cbFinally = std::make_optional(func); } diff --git a/src/controllers/plugins/api/HTTPRequest.hpp b/src/controllers/plugins/api/HTTPRequest.hpp index ebf82967f74..825894109a0 100644 --- a/src/controllers/plugins/api/HTTPRequest.hpp +++ b/src/controllers/plugins/api/HTTPRequest.hpp @@ -48,9 +48,9 @@ class HTTPRequest : public std::enable_shared_from_this int timeout_ = 10'000; bool done = false; - std::optional cbSuccess; - std::optional cbError; - std::optional cbFinally; + std::optional cbSuccess; + std::optional cbError; + std::optional cbFinally; public: // These functions are wrapped so data can be accessed more easily. When a call from Lua comes in: @@ -64,7 +64,7 @@ class HTTPRequest : public std::enable_shared_from_this * @lua@param callback c2.HTTPCallback Function to call when the HTTP request succeeds * @exposed c2.HTTPRequest:on_success */ - void on_success(sol::protected_function func); + void on_success(sol::main_protected_function func); /** * Sets the failure callback @@ -72,7 +72,7 @@ class HTTPRequest : public std::enable_shared_from_this * @lua@param callback c2.HTTPCallback Function to call when the HTTP request fails or returns a non-ok status * @exposed c2.HTTPRequest:on_error */ - void on_error(sol::protected_function func); + void on_error(sol::main_protected_function func); /** * Sets the finally callback @@ -80,7 +80,7 @@ class HTTPRequest : public std::enable_shared_from_this * @lua@param callback fun(): nil Function to call when the HTTP request finishes * @exposed c2.HTTPRequest:finally */ - void finally(sol::protected_function func); + void finally(sol::main_protected_function func); /** * Sets the timeout From 2f2fc367916bde35b34fe97764bc104037cfa866 Mon Sep 17 00:00:00 2001 From: pajlada Date: Sat, 11 Jan 2025 11:19:03 +0100 Subject: [PATCH 02/12] chore: bump winget-releaser action (#5793) --- .github/workflows/winget.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/winget.yml b/.github/workflows/winget.yml index 7e8a5091a70..8f9b44726b5 100644 --- a/.github/workflows/winget.yml +++ b/.github/workflows/winget.yml @@ -7,7 +7,7 @@ jobs: runs-on: windows-latest if: ${{ startsWith(github.event.release.tag_name, 'v') }} steps: - - uses: vedantmgoyal2009/winget-releaser@v2 + - uses: vedantmgoyal2009/winget-releaser@4ffc7888bffd451b357355dc214d43bb9f23917e with: identifier: ChatterinoTeam.Chatterino installers-regex: ^Chatterino.Installer.exe$ From 3ec9b936843afd1bfe39fc3fa1ecb6defd1cf9f9 Mon Sep 17 00:00:00 2001 From: nerix Date: Sat, 11 Jan 2025 12:09:12 +0100 Subject: [PATCH 03/12] =?UTF-8?q?build(conan):=20=F0=9F=91=B7=20update=20v?= =?UTF-8?q?ersion=20and=20dependencies=20(#5776)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 4 +--- .github/workflows/test-windows.yml | 4 +--- CHANGELOG.md | 1 + conanfile.py | 20 ++++++++++++++++---- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9debd28cdbe..d1c0519118c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,9 +19,7 @@ env: C2_ENABLE_LTO: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/bugfix-release/') || startsWith(github.ref, 'refs/heads/release/') }} CHATTERINO_REQUIRE_CLEAN_GIT: On C2_BUILD_WITH_QT6: Off - # Last known good conan version - # 2.0.3 has a bug on Windows (conan-io/conan#13606) - CONAN_VERSION: 2.0.2 + CONAN_VERSION: 2.11.0 jobs: build-ubuntu-docker: diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 40c03c3874a..52d844a2b09 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -10,9 +10,7 @@ env: TWITCH_PUBSUB_SERVER_TAG: v1.0.7 HTTPBOX_TAG: v0.2.1 QT_QPA_PLATFORM: minimal - # Last known good conan version - # 2.0.3 has a bug on Windows (conan-io/conan#13606) - CONAN_VERSION: 2.0.2 + CONAN_VERSION: 2.11.0 concurrency: group: test-windows-${{ github.ref }} diff --git a/CHANGELOG.md b/CHANGELOG.md index f38527c575d..8dd896f0115 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unversioned - Bugfix: Fixed a crash relating to Lua HTTP. (#5800) +- Dev: Updated Conan dependencies. (#5776) ## 2.5.2 diff --git a/conanfile.py b/conanfile.py index a1d498695c8..581ec445723 100644 --- a/conanfile.py +++ b/conanfile.py @@ -1,11 +1,12 @@ from conan import ConanFile from conan.tools.files import copy +from conan.tools.cmake import CMakeToolchain from os import path class Chatterino(ConanFile): name = "Chatterino" - requires = "boost/1.83.0" + requires = "boost/1.86.0" settings = "os", "compiler", "build_type", "arch" default_options = { "with_benchmark": False, @@ -18,18 +19,29 @@ class Chatterino(ConanFile): # Qt is built with OpenSSL 3 from version 6.5.0 onwards "with_openssl3": [True, False], } - generators = "CMakeDeps", "CMakeToolchain" + generators = "CMakeDeps" def requirements(self): if self.options.get_safe("with_benchmark", False): - self.requires("benchmark/1.7.1") + self.requires("benchmark/1.9.0") if self.options.get_safe("with_openssl3", False): - self.requires("openssl/3.2.0") + self.requires("openssl/3.3.2") else: self.requires("openssl/1.1.1t") def generate(self): + tc = CMakeToolchain(self) + tc.blocks.remove("compilers") + tc.blocks.remove("cmake_flags_init") + tc.blocks.remove("cppstd") + tc.blocks.remove("libcxx") + tc.blocks.remove("generic_system") + tc.blocks.remove("user_toolchain") + tc.blocks.remove("output_dirs") + tc.blocks.remove("apple_system") + tc.generate() + def copy_bin(dep, selector, subdir): src = path.realpath(dep.cpp_info.bindirs[0]) dst = path.realpath(path.join(self.build_folder, subdir)) From f152c885e91764d0102209bf65e5e9e8cc809360 Mon Sep 17 00:00:00 2001 From: pajlada Date: Sat, 11 Jan 2025 12:14:55 +0100 Subject: [PATCH 04/12] Update release docs (#5809) --- docs/make-release.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/make-release.md b/docs/make-release.md index 1509289fd39..d60cbe82a2f 100644 --- a/docs/make-release.md +++ b/docs/make-release.md @@ -14,12 +14,17 @@ - [ ] Update the changelog `## Unreleased` section to the new version `CHANGELOG.md` Make sure to leave the `## Unreleased` line unchanged for easier merges +- [ ] Ensure all GitHub API credentials from the `chatterino-ci` user are still valid + ## After the PR has been merged - [ ] Tag the release - [ ] Manually run the [create-installer](https://github.com/Chatterino/chatterino2/actions/workflows/create-installer.yml) workflow. This is only necessary if the tag was created after the CI in the main branch finished. -- [ ] Start a manual [Launchpad import](https://code.launchpad.net/~pajlada/chatterino/+git/chatterino) - scroll down & click Import Now -- [ ] Make a PPA release to [this repo](https://git.launchpad.net/~pajlada/+git/chatterino-packaging/) with the `debchange` command. - `debchange -v 2.4.0` then add the changelog entries - `debchange --release` then change the distro to be `unstable` +- [ ] If the winget releaser action doesn't work as expected, you can run this manually using [Komac](https://github.com/russellbanks/Komac), replacing `v2.5.2` with the current release: + `komac update ChatterinoTeam.Chatterino --version 2.5.2 --urls https://github.com/Chatterino/chatterino2/releases/download/v2.5.2/Chatterino.Installer.exe` + +## After the binaries have been uploaded to fourtf's bucket + +- [ ] Re-run the Publish Homebrew Cask on Release action +- [ ] Update links in the Chatterino website to point to the new release From 687fb353a7ed3b20177af6f03be901684fbd3161 Mon Sep 17 00:00:00 2001 From: teknsl <64030674+teknsl@users.noreply.github.com> Date: Sat, 11 Jan 2025 14:08:21 +0100 Subject: [PATCH 05/12] consolidate firefox incognitobrowser logic (and deprecate opera/launcher) (#5805) Co-authored-by: Rasmus Karlsson --- CHANGELOG.md | 2 + src/util/IncognitoBrowser.cpp | 100 ++++++++++++++++++--------------- src/util/IncognitoBrowser.hpp | 6 ++ tests/CMakeLists.txt | 1 + tests/src/IncognitoBrowser.cpp | 21 +++++++ 5 files changed, 84 insertions(+), 46 deletions(-) create mode 100644 tests/src/IncognitoBrowser.cpp diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dd896f0115..77d227334ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unversioned +- Minor: Treat all browsers starting with `firefox` as a Firefox browser. (#5805) +- Minor: Remove incognito browser support for `opera/launcher` (this should no longer be a thing). (#5805) - Bugfix: Fixed a crash relating to Lua HTTP. (#5800) - Dev: Updated Conan dependencies. (#5776) diff --git a/src/util/IncognitoBrowser.cpp b/src/util/IncognitoBrowser.cpp index 3d147b6f756..bb71e7e0c8c 100644 --- a/src/util/IncognitoBrowser.cpp +++ b/src/util/IncognitoBrowser.cpp @@ -5,6 +5,7 @@ # include "util/XDGHelper.hpp" #endif +#include #include #include @@ -12,52 +13,6 @@ namespace { using namespace chatterino; -QString getPrivateSwitch(const QString &browserExecutable) -{ - // list of command line switches to turn on private browsing in browsers - static auto switches = std::vector>{ - {"firefox", "-private-window"}, - {"librewolf", "-private-window"}, - {"waterfox", "-private-window"}, - {"icecat", "-private-window"}, - {"chrome", "-incognito"}, - {"google-chrome-stable", "-incognito"}, - {"vivaldi", "-incognito"}, - {"opera", "-newprivatetab"}, - {"opera\\launcher", "--private"}, - {"iexplore", "-private"}, - {"msedge", "-inprivate"}, - {"firefox-esr", "-private-window"}, - {"chromium", "-incognito"}, - {"brave", "-incognito"}, - {"firefox-devedition", "-private-window"}, - {"firefox-developer-edition", "-private-window"}, - {"firefox-beta", "-private-window"}, - {"firefox-nightly", "-private-window"}, - }; - - // compare case-insensitively - auto lowercasedBrowserExecutable = browserExecutable.toLower(); - -#ifdef Q_OS_WINDOWS - if (lowercasedBrowserExecutable.endsWith(".exe")) - { - lowercasedBrowserExecutable.chop(4); - } -#endif - - for (const auto &switch_ : switches) - { - if (lowercasedBrowserExecutable.endsWith(switch_.first)) - { - return switch_.second; - } - } - - // couldn't match any browser -> unknown browser - return {}; -} - QString getDefaultBrowserExecutable() { #ifdef USEWINSDK @@ -102,9 +57,62 @@ QString getDefaultBrowserExecutable() } } // namespace +// + +namespace chatterino::incognitobrowser::detail { + +QString getPrivateSwitch(const QString &browserExecutable) +{ + static auto switches = std::vector>{ + {"librewolf", "-private-window"}, + {"waterfox", "-private-window"}, + {"icecat", "-private-window"}, + {"chrome", "-incognito"}, + {"google-chrome-stable", "-incognito"}, + {"vivaldi", "-incognito"}, + {"opera", "-newprivatetab"}, + {"iexplore", "-private"}, + {"msedge", "-inprivate"}, + {"chromium", "-incognito"}, + {"brave", "-incognito"}, + }; + + // the browser executable may be a full path, strip it to its basename and + // compare case insensitively + auto lowercasedBrowserExecutable = + QFileInfo(browserExecutable).baseName().toLower(); + +#ifdef Q_OS_WINDOWS + if (lowercasedBrowserExecutable.endsWith(".exe")) + { + lowercasedBrowserExecutable.chop(4); + } +#endif + + for (const auto &switch_ : switches) + { + if (lowercasedBrowserExecutable == switch_.first) + { + return switch_.second; + } + } + + // catch all mozilla distributed variants + if (lowercasedBrowserExecutable.startsWith("firefox")) + { + return "-private-window"; + } + + // couldn't match any browser -> unknown browser + return {}; +} + +} // namespace chatterino::incognitobrowser::detail namespace chatterino { +using namespace chatterino::incognitobrowser::detail; + bool supportsIncognitoLinks() { auto browserExe = getDefaultBrowserExecutable(); diff --git a/src/util/IncognitoBrowser.hpp b/src/util/IncognitoBrowser.hpp index 9db1e800f4b..86908aa2d8d 100644 --- a/src/util/IncognitoBrowser.hpp +++ b/src/util/IncognitoBrowser.hpp @@ -2,6 +2,12 @@ #include +namespace chatterino::incognitobrowser::detail { + +QString getPrivateSwitch(const QString &browserExecutable); + +} // namespace chatterino::incognitobrowser::detail + namespace chatterino { bool supportsIncognitoLinks(); diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 06349c0e0a4..65e619c0402 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -52,6 +52,7 @@ set(test_SOURCES ${CMAKE_CURRENT_LIST_DIR}/src/TwitchIrc.cpp ${CMAKE_CURRENT_LIST_DIR}/src/IgnoreController.cpp ${CMAKE_CURRENT_LIST_DIR}/src/OnceFlag.cpp + ${CMAKE_CURRENT_LIST_DIR}/src/IncognitoBrowser.cpp ${CMAKE_CURRENT_LIST_DIR}/src/lib/Snapshot.cpp ${CMAKE_CURRENT_LIST_DIR}/src/lib/Snapshot.hpp # Add your new file above this line! diff --git a/tests/src/IncognitoBrowser.cpp b/tests/src/IncognitoBrowser.cpp new file mode 100644 index 00000000000..0eeea9623ae --- /dev/null +++ b/tests/src/IncognitoBrowser.cpp @@ -0,0 +1,21 @@ +#include "util/IncognitoBrowser.hpp" + +#include "Test.hpp" + +using namespace chatterino; + +TEST(IncognitoBrowser, getPrivateSwitch) +{ + using namespace chatterino::incognitobrowser::detail; + + ASSERT_EQ(getPrivateSwitch("firefox.exe"), "-private-window"); + ASSERT_EQ(getPrivateSwitch("firefox"), "-private-window"); + ASSERT_EQ(getPrivateSwitch("firefox-forsen-version"), "-private-window"); + + ASSERT_EQ(getPrivateSwitch("chrome.exe"), "-incognito"); + ASSERT_EQ(getPrivateSwitch("google-chrome-stable"), "-incognito"); + + ASSERT_EQ(getPrivateSwitch("opera.exe"), "-newprivatetab"); + + ASSERT_EQ(getPrivateSwitch("unsupportedBrowser.exe"), ""); +} From 8e3108cca83b49d30f7fdbf1fd0a3ed67ae85464 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Sat, 11 Jan 2025 18:54:20 +0100 Subject: [PATCH 06/12] Remove iexplore, because it is EOL (#5810) EOL since 2022-06-15. https://learn.microsoft.com/de-de/lifecycle/products/internet-explorer-11 --- CHANGELOG.md | 1 + src/util/IncognitoBrowser.cpp | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77d227334ac..c7d98db827f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Minor: Treat all browsers starting with `firefox` as a Firefox browser. (#5805) - Minor: Remove incognito browser support for `opera/launcher` (this should no longer be a thing). (#5805) +- Minor: Remove incognito browser support for `iexplore`, because internet explorer is EOL. (#5810) - Bugfix: Fixed a crash relating to Lua HTTP. (#5800) - Dev: Updated Conan dependencies. (#5776) diff --git a/src/util/IncognitoBrowser.cpp b/src/util/IncognitoBrowser.cpp index bb71e7e0c8c..51eb0c3d8ed 100644 --- a/src/util/IncognitoBrowser.cpp +++ b/src/util/IncognitoBrowser.cpp @@ -71,7 +71,6 @@ QString getPrivateSwitch(const QString &browserExecutable) {"google-chrome-stable", "-incognito"}, {"vivaldi", "-incognito"}, {"opera", "-newprivatetab"}, - {"iexplore", "-private"}, {"msedge", "-inprivate"}, {"chromium", "-incognito"}, {"brave", "-incognito"}, From c090471b1f32ead9d97a1aef57fd005a8a81b2ac Mon Sep 17 00:00:00 2001 From: pajlada Date: Sat, 11 Jan 2025 20:32:29 +0100 Subject: [PATCH 07/12] fix: update winget repo url (#5813) --- .github/workflows/winget.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/winget.yml b/.github/workflows/winget.yml index 8f9b44726b5..3059f0c1387 100644 --- a/.github/workflows/winget.yml +++ b/.github/workflows/winget.yml @@ -7,7 +7,7 @@ jobs: runs-on: windows-latest if: ${{ startsWith(github.event.release.tag_name, 'v') }} steps: - - uses: vedantmgoyal2009/winget-releaser@4ffc7888bffd451b357355dc214d43bb9f23917e + - uses: vedantmgoyal9/winget-releaser@4ffc7888bffd451b357355dc214d43bb9f23917e with: identifier: ChatterinoTeam.Chatterino installers-regex: ^Chatterino.Installer.exe$ From acb89479572b0ec24b26bc3e5515e622a1032abf Mon Sep 17 00:00:00 2001 From: pajlada Date: Sat, 11 Jan 2025 20:57:49 +0100 Subject: [PATCH 08/12] fix: winget url fix (#5814) --- .github/workflows/winget.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/winget.yml b/.github/workflows/winget.yml index 3059f0c1387..d2a03827991 100644 --- a/.github/workflows/winget.yml +++ b/.github/workflows/winget.yml @@ -7,7 +7,7 @@ jobs: runs-on: windows-latest if: ${{ startsWith(github.event.release.tag_name, 'v') }} steps: - - uses: vedantmgoyal9/winget-releaser@4ffc7888bffd451b357355dc214d43bb9f23917e + - uses: vedantmgoyal9/winget-releaser@main with: identifier: ChatterinoTeam.Chatterino installers-regex: ^Chatterino.Installer.exe$ From b2d91f63365b10a60e98e0dead274ca0fec80435 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 11 Jan 2025 21:08:53 +0000 Subject: [PATCH 09/12] chore(deps): bump codecov/codecov-action from 5.0.7 to 5.1.2 (#5772) Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.0.7 to 5.1.2. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v5.0.7...v5.1.2) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b1b6bd31e59..f2c057543a9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -96,7 +96,7 @@ jobs: working-directory: build-test - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v5.0.7 + uses: codecov/codecov-action@v5.1.2 with: token: ${{ secrets.CODECOV_TOKEN }} plugins: gcov From ae964be75806e48f9d8838284ac92ed2eaf11894 Mon Sep 17 00:00:00 2001 From: 8thony <114905842+8thony@users.noreply.github.com> Date: Sun, 12 Jan 2025 11:29:50 +0100 Subject: [PATCH 10/12] fix: missing word wrap in update popup (#5811) Co-authored-by: Nerixyz --- CHANGELOG.md | 1 + src/widgets/Label.cpp | 21 ++++++++++++++++++++- src/widgets/Label.hpp | 4 ++++ src/widgets/dialogs/UpdateDialog.cpp | 27 ++++++++++++++------------- 4 files changed, 39 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7d98db827f..e0653234007 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Minor: Remove incognito browser support for `opera/launcher` (this should no longer be a thing). (#5805) - Minor: Remove incognito browser support for `iexplore`, because internet explorer is EOL. (#5810) - Bugfix: Fixed a crash relating to Lua HTTP. (#5800) +- Bugfix: Fixed missing word wrap in update popup. (#5811) - Dev: Updated Conan dependencies. (#5776) ## 2.5.2 diff --git a/src/widgets/Label.cpp b/src/widgets/Label.cpp index 6f56acb2767..6fe1bcdadc9 100644 --- a/src/widgets/Label.cpp +++ b/src/widgets/Label.cpp @@ -64,6 +64,18 @@ void Label::setHasOffset(bool hasOffset) this->hasOffset_ = hasOffset; this->updateSize(); } + +bool Label::getWordWrap() const +{ + return this->wordWrap_; +} + +void Label::setWordWrap(bool wrap) +{ + this->wordWrap_ = wrap; + this->update(); +} + void Label::setFontStyle(FontStyle style) { this->fontStyle_ = style; @@ -107,7 +119,14 @@ void Label::paintEvent(QPaintEvent *) painter.setBrush(this->palette().windowText()); QTextOption option(alignment); - option.setWrapMode(QTextOption::NoWrap); + if (this->wordWrap_) + { + option.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere); + } + else + { + option.setWrapMode(QTextOption::NoWrap); + } painter.drawText(textRect, this->text_, option); #if 0 diff --git a/src/widgets/Label.hpp b/src/widgets/Label.hpp index 285980641bf..f3a7c845dd0 100644 --- a/src/widgets/Label.hpp +++ b/src/widgets/Label.hpp @@ -27,6 +27,9 @@ class Label : public BaseWidget bool getHasOffset() const; void setHasOffset(bool hasOffset); + bool getWordWrap() const; + void setWordWrap(bool wrap); + protected: void scaleChangedEvent(float scale_) override; void paintEvent(QPaintEvent *) override; @@ -43,6 +46,7 @@ class Label : public BaseWidget QSize preferedSize_; bool centered_ = false; bool hasOffset_ = true; + bool wordWrap_ = false; pajlada::Signals::SignalHolder connections_; }; diff --git a/src/widgets/dialogs/UpdateDialog.cpp b/src/widgets/dialogs/UpdateDialog.cpp index 64ec27eec46..a1084b2a702 100644 --- a/src/widgets/dialogs/UpdateDialog.cpp +++ b/src/widgets/dialogs/UpdateDialog.cpp @@ -19,7 +19,8 @@ UpdateDialog::UpdateDialog() LayoutCreator(this).setLayoutType(); layout.emplace