Repository navigation
fix: make reply-cancel button less coarse-grained - #6106
Merged
Merged
Conversation
leungbk
force-pushed
the
reply-cancel
branch
2 times, most recently
from
March 23, 2025 04:51
e8f184a to
a2ebc7c
Compare
pajlada
requested changes
Mar 23, 2025
Comment on lines
+313
to
+314
| this->ui_.cancelReplyButton->setFixedHeight(int(24 * scale)); | ||
| this->ui_.cancelReplyButton->setFixedWidth(int(24 * scale)); |
Member
There was a problem hiding this comment.
We can retain the old size by disabling the margin for now
Suggested change
| this->ui_.cancelReplyButton->setFixedHeight(int(24 * scale)); | |
| this->ui_.cancelReplyButton->setFixedWidth(int(24 * scale)); | |
| this->ui_.cancelReplyButton->setEnableMargin(false); | |
| this->ui_.cancelReplyButton->setFixedHeight(int(12 * scale)); | |
| this->ui_.cancelReplyButton->setFixedWidth(int(12 * scale)); |
Nerixyz
suggested changes
Mar 23, 2025
Nerixyz
left a comment
Contributor
There was a problem hiding this comment.
On 100% scaling, the button had 4 pixels padding horizontally and no padding vertically:
diff --git a/src/widgets/helper/Button.cpp b/src/widgets/helper/Button.cpp
index cf941f49c..19c7ec37c 100644
--- a/src/widgets/helper/Button.cpp
+++ b/src/widgets/helper/Button.cpp
@@ -84,7 +84,12 @@ void Button::setSvgResource(const QString &resourcePath)
return;
}
+ if (this->svgRenderer)
+ {
+ this->svgRenderer->deleteLater();
+ }
this->svgRenderer = new QSvgRenderer(resourcePath, this);
+ this->svgRenderer->setAspectRatioMode(Qt::KeepAspectRatio);
this->svgResourcePath = resourcePath;
this->update();
@@ -199,15 +204,7 @@ void Button::paintButton(QPainter &painter)
if (this->enableMargin_)
{
auto s = this->getMargin();
- auto outSize = rect.size() - QSize{2 * s, 2 * s};
- outSize = this->svgRenderer->defaultSize().scaled(
- outSize, Qt::KeepAspectRatio);
- auto margin = rect.size() - outSize;
-
- rect = QRect{
- QPoint{margin.width() / 2, margin.height() / 2},
- outSize,
- };
+ rect = {{s, s}, rect.size() - QSize{2 * s, 2 * s}};
}
this->svgRenderer->render(&painter, rect);
diff --git a/src/widgets/splits/SplitInput.cpp b/src/widgets/splits/SplitInput.cpp
index a8af1c7c7..c2013b44a 100644
--- a/src/widgets/splits/SplitInput.cpp
+++ b/src/widgets/splits/SplitInput.cpp
@@ -310,8 +310,9 @@ void SplitInput::updateCancelReplyButton()
{
this->ui_.cancelReplyButton->setSvgResource(":/buttons/cancel.svg");
}
- this->ui_.cancelReplyButton->setFixedHeight(int(24 * scale));
- this->ui_.cancelReplyButton->setFixedWidth(int(24 * scale));
+ this->ui_.cancelReplyButton->setEnableMargin(false);
+ this->ui_.cancelReplyButton->setFixedHeight(int(12 * scale));
+ this->ui_.cancelReplyButton->setFixedWidth(int(20 * scale));
}
void SplitInput::openEmotePopup()Co-authored-by: nerix <nerixdev@outlook.de> Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
Nerixyz
approved these changes
Mar 23, 2025
pajlada
approved these changes
Apr 5, 2025
some devil has injected this error
Member
|
Thank you! As a first-time contributor, you are now eligible to be listed in the About page in Chatterino. If you want this, you can open a new PR where you modify the |
babicekmarek
pushed a commit
to babicekmarek/streamally-chatterino
that referenced
this pull request
Sep 14, 2026
Co-authored-by: nerix <nerixdev@outlook.de> Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Fixes #6099.