remove setStyleSheet calls directly from widget code

removed from:
 - emoji panel scrollbars
 - emoji category labels
 - splitter image handles
 - textfield setTextColor impl

small change to the category separator label for better contrast /
readability in dark mode.

removed setTextColor completely from TextField. Doesn't appear to be in
use anywhere, and focus going more toward qss themeing from qproperty
setting.
This commit is contained in:
Adasauce 2020-02-21 15:16:53 -04:00
parent fa829bebd0
commit 6e6fe0cad2
No known key found for this signature in database
GPG key ID: B4FD3151235211CB
8 changed files with 28 additions and 28 deletions

View file

@ -52,11 +52,18 @@ dialogs--JoinRoom > QLineEdit {
color: #caccd1; color: #caccd1;
} }
emoji--Panel QWidget { border: none; }
emoji--Panel QScrollBar:vertical { width: 0px; margin: 0px; }
emoji--Panel QScrollBar::handle:vertical { min-height: 30px; }
emoji--Category, emoji--Category,
emoji--Category > * { emoji--Category > * {
background-color: #2d3139; background-color: #2d3139;
color: #caccd1; color: #727274;
}
emoji--Category QLabel {
margin: 20px 0 20px 8px;
} }
TimelineItem { TimelineItem {
@ -237,3 +244,5 @@ SnackBar {
qproperty-textColor: #caccd1; qproperty-textColor: #caccd1;
qproperty-bgColor: #202228; qproperty-bgColor: #202228;
} }
QSplitter::handle { image: none; }

View file

@ -187,6 +187,10 @@ emoji--Panel > * {
color: #333; color: #333;
} }
emoji--Panel QWidget { border: none; }
emoji--Panel QScrollBar:vertical { width: 0px; margin: 0px; }
emoji--Panel QScrollBar::handle:vertical { min-height: 30px; }
emoji--Category { emoji--Category {
qproperty-hoverBackgroundColor: rgba(200, 200, 200, 70); qproperty-hoverBackgroundColor: rgba(200, 200, 200, 70);
} }
@ -197,6 +201,8 @@ emoji--Category > * {
color: #ccc; color: #ccc;
} }
emoji--Category QLabel { margin: 20px 0 20px 8px; }
FloatingButton { FloatingButton {
qproperty-backgroundColor: #efefef; qproperty-backgroundColor: #efefef;
qproperty-foregroundColor: black; qproperty-foregroundColor: black;
@ -239,3 +245,5 @@ SnackBar {
qproperty-textColor: white; qproperty-textColor: white;
qproperty-bgColor: #495057; qproperty-bgColor: #495057;
} }
QSplitter::handle { image: none; }

View file

@ -138,6 +138,10 @@ emoji--Panel > * {
color: palette(text); color: palette(text);
} }
emoji--Panel QWidget { border: none; }
emoji--Panel QScrollBar:vertical { width: 0px; margin: 0px; }
emoji--Panel QScrollBar::handle:vertical { min-height: 30px; }
emoji--Category { emoji--Category {
qproperty-hoverBackgroundColor: palette(highlight); qproperty-hoverBackgroundColor: palette(highlight);
} }
@ -148,6 +152,10 @@ emoji--Category > * {
color: palette(text); color: palette(text);
} }
emoji--Category QLabel {
margin: 20px 0 20px 8px;
}
FloatingButton { FloatingButton {
qproperty-backgroundColor: palette(base); qproperty-backgroundColor: palette(base);
qproperty-foregroundColor: palette(text); qproperty-foregroundColor: palette(text);
@ -164,3 +172,5 @@ Toggle {
qproperty-inactiveColor: palette(mid); qproperty-inactiveColor: palette(mid);
qproperty-trackColor: palette(base); qproperty-trackColor: palette(base);
} }
QSplitter::handle { image: none; }

View file

@ -28,7 +28,6 @@ Splitter::Splitter(QWidget *parent)
{ {
connect(this, &QSplitter::splitterMoved, this, &Splitter::onSplitterMoved); connect(this, &QSplitter::splitterMoved, this, &Splitter::onSplitterMoved);
setChildrenCollapsible(false); setChildrenCollapsible(false);
setStyleSheet("QSplitter::handle { image: none; }");
} }
void void

View file

@ -75,7 +75,6 @@ Category::Category(QString category, std::vector<Emoji> emoji, QWidget *parent)
category_ = new QLabel(category, this); category_ = new QLabel(category, this);
category_->setFont(font); category_->setFont(font);
category_->setStyleSheet("margin: 20px 0 20px 8px;");
mainLayout_->addWidget(category_); mainLayout_->addWidget(category_);
mainLayout_->addWidget(emojiListView_); mainLayout_->addWidget(emojiListView_);

View file

@ -35,10 +35,6 @@ Panel::Panel(QWidget *parent)
, height_{350} , height_{350}
, categoryIconSize_{20} , categoryIconSize_{20}
{ {
setStyleSheet("QWidget {border: none;}"
"QScrollBar:vertical { width: 0px; margin: 0px; }"
"QScrollBar::handle:vertical { min-height: 30px; }");
setAttribute(Qt::WA_ShowWithoutActivating, true); setAttribute(Qt::WA_ShowWithoutActivating, true);
setWindowFlags(Qt::Tool | Qt::FramelessWindowHint | Qt::NoDropShadowWindowHint); setWindowFlags(Qt::Tool | Qt::FramelessWindowHint | Qt::NoDropShadowWindowHint);

View file

@ -102,23 +102,6 @@ TextField::label() const
return label_text_; return label_text_;
} }
void
TextField::setTextColor(const QColor &color)
{
text_color_ = color;
setStyleSheet(QString("QLineEdit { color: %1; }").arg(color.name()));
}
QColor
TextField::textColor() const
{
if (!text_color_.isValid()) {
return QPalette().color(QPalette::Text);
}
return text_color_;
}
void void
TextField::setLabelColor(const QColor &color) TextField::setLabelColor(const QColor &color)
{ {

View file

@ -15,7 +15,6 @@ class TextField : public QLineEdit
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(QColor textColor WRITE setTextColor READ textColor)
Q_PROPERTY(QColor inkColor WRITE setInkColor READ inkColor) Q_PROPERTY(QColor inkColor WRITE setInkColor READ inkColor)
Q_PROPERTY(QColor labelColor WRITE setLabelColor READ labelColor) Q_PROPERTY(QColor labelColor WRITE setLabelColor READ labelColor)
Q_PROPERTY(QColor underlineColor WRITE setUnderlineColor READ underlineColor) Q_PROPERTY(QColor underlineColor WRITE setUnderlineColor READ underlineColor)
@ -30,12 +29,10 @@ public:
void setLabelColor(const QColor &color); void setLabelColor(const QColor &color);
void setLabelFontSize(qreal size); void setLabelFontSize(qreal size);
void setShowLabel(bool value); void setShowLabel(bool value);
void setTextColor(const QColor &color);
void setUnderlineColor(const QColor &color); void setUnderlineColor(const QColor &color);
QColor inkColor() const; QColor inkColor() const;
QColor labelColor() const; QColor labelColor() const;
QColor textColor() const;
QColor underlineColor() const; QColor underlineColor() const;
QColor backgroundColor() const; QColor backgroundColor() const;
QString label() const; QString label() const;
@ -52,7 +49,6 @@ private:
QColor ink_color_; QColor ink_color_;
QColor background_color_; QColor background_color_;
QColor label_color_; QColor label_color_;
QColor text_color_;
QColor underline_color_; QColor underline_color_;
QString label_text_; QString label_text_;
TextFieldLabel *label_; TextFieldLabel *label_;