From 10684b6d82f1843eff3921da40802d335fb3cf5c Mon Sep 17 00:00:00 2001 From: "Felix (xq) Queißner" Date: Wed, 17 Mar 2021 11:54:43 +0100 Subject: Further improves localization (#191). Allows switching and setting the chosen localization properly. --- src/browsertab.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/browsertab.cpp') diff --git a/src/browsertab.cpp b/src/browsertab.cpp index ef6f5e8..fa4ed9a 100644 --- a/src/browsertab.cpp +++ b/src/browsertab.cpp @@ -64,6 +64,12 @@ BrowserTab::BrowserTab(MainWindow *mainWindow) : QWidget(nullptr), { ui->setupUi(this); + connect( // connect with "this" as context, so the connection will die when the window is destroyed + kristall::globals().localization.get(), &Localization::translationChanged, + this, [this]() { this->ui->retranslateUi(this); }, + Qt::DirectConnection + ); + this->setUiDensity(kristall::globals().options.ui_density); addProtocolHandler(); -- cgit v1.2.3