diff --git a/lib/appbase/singletons/Fonts.cpp b/lib/appbase/singletons/Fonts.cpp index e3ccf4007..2cc29b0b7 100644 --- a/lib/appbase/singletons/Fonts.cpp +++ b/lib/appbase/singletons/Fonts.cpp @@ -161,6 +161,8 @@ Fonts::FontData Fonts::createFontData(FontStyle type, float scale) {FontStyle::Tiny, {8, "Monospace", false, QFont::Normal}}, {FontStyle::UiMedium, {int(9 * multiplier), DEFAULT_FONT_FAMILY, false, QFont::Normal}}, + {FontStyle::UiMediumBold, + {int(9 * multiplier), DEFAULT_FONT_FAMILY, false, QFont::Bold}}, {FontStyle::UiTabs, {int(9 * multiplier), DEFAULT_FONT_FAMILY, false, QFont::Normal}}, }; diff --git a/lib/appbase/singletons/Fonts.hpp b/lib/appbase/singletons/Fonts.hpp index ff67bc3e7..ad1fe8cab 100644 --- a/lib/appbase/singletons/Fonts.hpp +++ b/lib/appbase/singletons/Fonts.hpp @@ -28,6 +28,7 @@ enum class FontStyle : uint8_t { ChatVeryLarge, UiMedium, + UiMediumBold, UiTabs, // don't remove this value diff --git a/lib/appbase/widgets/Label.cpp b/lib/appbase/widgets/Label.cpp index 3f4bba150..5eb319d8f 100644 --- a/lib/appbase/widgets/Label.cpp +++ b/lib/appbase/widgets/Label.cpp @@ -100,6 +100,8 @@ void Label::paintEvent(QPaintEvent *) ? Qt::AlignLeft | Qt::AlignVCenter : Qt::AlignCenter; + painter.setBrush(this->palette().windowText()); + QTextOption option(alignment); option.setWrapMode(QTextOption::NoWrap); painter.drawText(textRect, this->text_, option); diff --git a/lib/appbase/widgets/helper/Button.cpp b/lib/appbase/widgets/helper/Button.cpp index e9572ce1a..822afa585 100644 --- a/lib/appbase/widgets/helper/Button.cpp +++ b/lib/appbase/widgets/helper/Button.cpp @@ -38,14 +38,14 @@ const QPixmap &Button::getPixmap() const return this->pixmap_; } -void Button::setDim(bool value) +void Button::setDim(Dim value) { this->dimPixmap_ = value; this->update(); } -bool Button::getDim() const +Button::Dim Button::getDim() const { return this->dimPixmap_; } @@ -76,7 +76,12 @@ bool Button::getEnableMargin() const qreal Button::getCurrentDimAmount() const { - return this->dimPixmap_ && !this->mouseOver_ ? 0.7 : 1; + if (this->dimPixmap_ == Dim::None || this->mouseOver_) + return 1; + else if (this->dimPixmap_ == Dim::Some) + return 0.7; + else + return 0.15; } void Button::setBorderColor(const QColor &color) @@ -114,13 +119,13 @@ void Button::paintEvent(QPaintEvent *) if (!this->pixmap_.isNull()) { - if (!this->mouseOver_ && this->dimPixmap_ && this->enabled_) - { - painter.setOpacity(this->getCurrentDimAmount()); - } + painter.setOpacity(this->getCurrentDimAmount()); QRect rect = this->rect(); - int s = this->enableMargin_ ? int(6 * this->scale()) : 0; + + int margin = this->height() < 22 * this->scale() ? 3 : 6; + + int s = this->enableMargin_ ? int(margin * this->scale()) : 0; rect.moveLeft(s); rect.setRight(rect.right() - s - s); diff --git a/lib/appbase/widgets/helper/Button.hpp b/lib/appbase/widgets/helper/Button.hpp index ab8825e18..06ab218a5 100644 --- a/lib/appbase/widgets/helper/Button.hpp +++ b/lib/appbase/widgets/helper/Button.hpp @@ -28,14 +28,16 @@ class Button : public BaseWidget }; public: + enum class Dim { None, Some, Lots }; + Button(BaseWidget *parent = nullptr); void setMouseEffectColor(boost::optional color); void setPixmap(const QPixmap &pixmap_); const QPixmap &getPixmap() const; - void setDim(bool value); - bool getDim() const; + void setDim(Dim value); + Dim getDim() const; qreal getCurrentDimAmount() const; void setEnable(bool value); @@ -76,7 +78,7 @@ private: QColor borderColor_{}; QPixmap pixmap_{}; - bool dimPixmap_{true}; + Dim dimPixmap_{Dim::Some}; bool enableMargin_{true}; QPoint mousePos_{}; double hoverMultiplier_{0.0}; diff --git a/src/widgets/dialogs/UserInfoPopup.cpp b/src/widgets/dialogs/UserInfoPopup.cpp index 79bf6d0a4..5d0758faa 100644 --- a/src/widgets/dialogs/UserInfoPopup.cpp +++ b/src/widgets/dialogs/UserInfoPopup.cpp @@ -24,9 +24,23 @@ #define TEXT_FOLLOWERS "Followers: " #define TEXT_VIEWS "Views: " #define TEXT_CREATED "Created: " -#define TEXT_USER_ID "User ID: " +#define TEXT_USER_ID "ID: " namespace chatterino { +namespace { + void addCopyableLabel(LayoutCreator box, Label **assign) + { + auto label = box.emplace