From cf6bdeddc7fa68da33712951a377d3a5e5966f83 Mon Sep 17 00:00:00 2001 From: fourtf Date: Tue, 19 Jun 2018 20:14:13 +0200 Subject: [PATCH] fixed user info popup user info loading --- src/widgets/helper/channelview.cpp | 2 +- src/widgets/label.cpp | 7 +++++-- src/widgets/scrollbar.cpp | 4 ++-- src/widgets/userinfopopup.cpp | 15 ++++++++++----- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/widgets/helper/channelview.cpp b/src/widgets/helper/channelview.cpp index 6b43760ce..698769116 100644 --- a/src/widgets/helper/channelview.cpp +++ b/src/widgets/helper/channelview.cpp @@ -51,7 +51,7 @@ ChannelView::ChannelView(BaseWidget *parent) })); this->scrollBar_.getCurrentValueChanged().connect([this] { - qDebug() << "getCurrentValueChanged"; + // qDebug() << "getCurrentValueChanged"; // Whenever the scrollbar value has been changed, re-render the ChatWidgetView this->actuallyLayoutMessages(true); diff --git a/src/widgets/label.cpp b/src/widgets/label.cpp index c146e99af..e8ef84161 100644 --- a/src/widgets/label.cpp +++ b/src/widgets/label.cpp @@ -30,8 +30,11 @@ const QString &Label::getText() const void Label::setText(const QString &text) { - this->text_ = text; - this->updateSize(); + if (this->text_ != text) { + this->text_ = text; + this->updateSize(); + this->update(); + } } FontStyle Label::getFontStyle() const diff --git a/src/widgets/scrollbar.cpp b/src/widgets/scrollbar.cpp index cc5bfa675..c269215c8 100644 --- a/src/widgets/scrollbar.cpp +++ b/src/widgets/scrollbar.cpp @@ -190,8 +190,8 @@ void Scrollbar::setCurrentValue(qreal value) value = std::max(this->minimum_, std::min(this->maximum_ - this->largeChange_, value + this->smoothScrollingOffset_)); - if (std::abs(this->currentValue_ - value) > 0.000001) { - qDebug() << "setCurrentValue"; + if (std::abs(this->currentValue_ - value) > 0.0001) { + // qDebug() << "setCurrentValue"; this->currentValue_ = value; this->updateScroll(); diff --git a/src/widgets/userinfopopup.cpp b/src/widgets/userinfopopup.cpp index d43f47c14..49598a219 100644 --- a/src/widgets/userinfopopup.cpp +++ b/src/widgets/userinfopopup.cpp @@ -366,7 +366,7 @@ UserInfoPopup::TimeoutWidget::TimeoutWidget() a->setBorderColor(color1); QObject::connect( - *a, &RippleEffectLabel2::clicked, [ this, timeout = std::get<1>(item) ] { + *a, &RippleEffectLabel2::clicked, [this, timeout = std::get<1>(item)] { this->buttonClicked.invoke(std::make_pair(Action::Timeout, timeout)); }); } @@ -377,16 +377,21 @@ UserInfoPopup::TimeoutWidget::TimeoutWidget() addTimeouts("sec", {{"1", 1}}); addTimeouts("min", { - {"1", 1 * 60}, {"5", 5 * 60}, {"10", 10 * 60}, + {"1", 1 * 60}, + {"5", 5 * 60}, + {"10", 10 * 60}, }); addTimeouts("hour", { - {"1", 1 * 60 * 60}, {"4", 4 * 60 * 60}, + {"1", 1 * 60 * 60}, + {"4", 4 * 60 * 60}, }); addTimeouts("days", { - {"1", 1 * 60 * 60 * 24}, {"3", 3 * 60 * 60 * 24}, + {"1", 1 * 60 * 60 * 24}, + {"3", 3 * 60 * 60 * 24}, }); addTimeouts("weeks", { - {"1", 1 * 60 * 60 * 24 * 7}, {"2", 2 * 60 * 60 * 24 * 7}, + {"1", 1 * 60 * 60 * 24 * 7}, + {"2", 2 * 60 * 60 * 24 * 7}, }); addButton(Ban, "ban", getApp()->resources->buttons.ban);