fix: missing word wrap in update popup (#5811)
Co-authored-by: Nerixyz <nerixdev@outlook.de>
This commit is contained in:
@@ -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 `opera/launcher` (this should no longer be a thing). (#5805)
|
||||||
- Minor: Remove incognito browser support for `iexplore`, because internet explorer is EOL. (#5810)
|
- Minor: Remove incognito browser support for `iexplore`, because internet explorer is EOL. (#5810)
|
||||||
- Bugfix: Fixed a crash relating to Lua HTTP. (#5800)
|
- Bugfix: Fixed a crash relating to Lua HTTP. (#5800)
|
||||||
|
- Bugfix: Fixed missing word wrap in update popup. (#5811)
|
||||||
- Dev: Updated Conan dependencies. (#5776)
|
- Dev: Updated Conan dependencies. (#5776)
|
||||||
|
|
||||||
## 2.5.2
|
## 2.5.2
|
||||||
|
|||||||
+20
-1
@@ -64,6 +64,18 @@ void Label::setHasOffset(bool hasOffset)
|
|||||||
this->hasOffset_ = hasOffset;
|
this->hasOffset_ = hasOffset;
|
||||||
this->updateSize();
|
this->updateSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Label::getWordWrap() const
|
||||||
|
{
|
||||||
|
return this->wordWrap_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Label::setWordWrap(bool wrap)
|
||||||
|
{
|
||||||
|
this->wordWrap_ = wrap;
|
||||||
|
this->update();
|
||||||
|
}
|
||||||
|
|
||||||
void Label::setFontStyle(FontStyle style)
|
void Label::setFontStyle(FontStyle style)
|
||||||
{
|
{
|
||||||
this->fontStyle_ = style;
|
this->fontStyle_ = style;
|
||||||
@@ -107,7 +119,14 @@ void Label::paintEvent(QPaintEvent *)
|
|||||||
painter.setBrush(this->palette().windowText());
|
painter.setBrush(this->palette().windowText());
|
||||||
|
|
||||||
QTextOption option(alignment);
|
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);
|
painter.drawText(textRect, this->text_, option);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|||||||
@@ -27,6 +27,9 @@ public:
|
|||||||
bool getHasOffset() const;
|
bool getHasOffset() const;
|
||||||
void setHasOffset(bool hasOffset);
|
void setHasOffset(bool hasOffset);
|
||||||
|
|
||||||
|
bool getWordWrap() const;
|
||||||
|
void setWordWrap(bool wrap);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void scaleChangedEvent(float scale_) override;
|
void scaleChangedEvent(float scale_) override;
|
||||||
void paintEvent(QPaintEvent *) override;
|
void paintEvent(QPaintEvent *) override;
|
||||||
@@ -43,6 +46,7 @@ private:
|
|||||||
QSize preferedSize_;
|
QSize preferedSize_;
|
||||||
bool centered_ = false;
|
bool centered_ = false;
|
||||||
bool hasOffset_ = true;
|
bool hasOffset_ = true;
|
||||||
|
bool wordWrap_ = false;
|
||||||
|
|
||||||
pajlada::Signals::SignalHolder connections_;
|
pajlada::Signals::SignalHolder connections_;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ UpdateDialog::UpdateDialog()
|
|||||||
LayoutCreator<UpdateDialog>(this).setLayoutType<QVBoxLayout>();
|
LayoutCreator<UpdateDialog>(this).setLayoutType<QVBoxLayout>();
|
||||||
|
|
||||||
layout.emplace<Label>("You shouldn't be seeing this dialog.")
|
layout.emplace<Label>("You shouldn't be seeing this dialog.")
|
||||||
.assign(&this->ui_.label);
|
.assign(&this->ui_.label)
|
||||||
|
->setWordWrap(true);
|
||||||
|
|
||||||
auto buttons = layout.emplace<QDialogButtonBox>();
|
auto buttons = layout.emplace<QDialogButtonBox>();
|
||||||
auto *install = buttons->addButton("Install", QDialogButtonBox::AcceptRole);
|
auto *install = buttons->addButton("Install", QDialogButtonBox::AcceptRole);
|
||||||
@@ -52,18 +53,18 @@ void UpdateDialog::updateStatusChanged(Updates::Status status)
|
|||||||
switch (status)
|
switch (status)
|
||||||
{
|
{
|
||||||
case Updates::UpdateAvailable: {
|
case Updates::UpdateAvailable: {
|
||||||
this->ui_.label->setText((
|
this->ui_.label->setText(
|
||||||
getApp()->getUpdates().isDowngrade()
|
(getApp()->getUpdates().isDowngrade()
|
||||||
? QString(
|
? QString(
|
||||||
"The version online (%1) seems to be\nlower than the "
|
"The version online (%1) seems to be lower than the "
|
||||||
"current (%2).\nEither a version was reverted or "
|
"current (%2).\nEither a version was reverted or "
|
||||||
"you are\nrunning a newer build.\n\nDo you want to "
|
"you are running a newer build.\n\nDo you want to "
|
||||||
"download and install it?")
|
"download and install it?")
|
||||||
.arg(getApp()->getUpdates().getOnlineVersion(),
|
.arg(getApp()->getUpdates().getOnlineVersion(),
|
||||||
getApp()->getUpdates().getCurrentVersion())
|
getApp()->getUpdates().getCurrentVersion())
|
||||||
: QString("An update (%1) is available.\n\nDo you want to "
|
: QString("An update (%1) is available.\n\nDo you want to "
|
||||||
"download and install it?")
|
"download and install it?")
|
||||||
.arg(getApp()->getUpdates().getOnlineVersion())));
|
.arg(getApp()->getUpdates().getOnlineVersion())));
|
||||||
this->updateGeometry();
|
this->updateGeometry();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user