Skip to content

Commit

Permalink
feat(DSettingsDialog): follow the system font size
Browse files Browse the repository at this point in the history
Change-Id: I52e8999c3aac0ebc7cc83a8166ede273631ae79f
  • Loading branch information
zccrs committed Aug 12, 2018
1 parent ebcf2b1 commit 115febe
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 62 deletions.
4 changes: 1 addition & 3 deletions src/widgets/dsettingswidgetfactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ QWidget *DSettingsWidgetFactory::createTwoColumWidget(const QByteArray &translat
optionLayout->setSpacing(0);

rightWidget->setMinimumWidth(240);
rightWidget->setStyleSheet("QWidget{font-size: 12px;}");

if (!option->name().isEmpty()) {
optionLayout->setColumnMinimumWidth(0, 110);
Expand All @@ -81,7 +80,6 @@ QWidget *DSettingsWidgetFactory::createTwoColumWidget(const QByteArray &translat
labelWidget->setMinimumWidth(150);
labelWidget->setFixedWidth(160);
labelWidget->setObjectName("OptionLabel");
labelWidget->setStyleSheet("#OptionLabel{font-size: 12px; }");
optionLayout->addWidget(labelWidget, 0, 0, Qt::AlignLeft | Qt::AlignVCenter);
optionLayout->addWidget(rightWidget, 0, 1, Qt::AlignLeft | Qt::AlignVCenter);
} else {
Expand Down Expand Up @@ -378,7 +376,7 @@ QWidget *createRadioGroupOptionHandle(QObject *opt)
buttonList.value(index)->setChecked(true);
}

rightWidget->setStyleSheet("QGroupBox{border: none;} QRadioButton{font-size:12px;}");
rightWidget->setStyleSheet("QGroupBox{border: none;}");
return optionWidget;
}

Expand Down
4 changes: 2 additions & 2 deletions src/widgets/private/settings/content.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <DSettings>
#include <DSettingsGroup>
#include <DSettingsOption>
#include <DSuggestButton>

#include "dsettingswidgetfactory.h"

Expand Down Expand Up @@ -169,7 +170,6 @@ void Content::updateSettings(const QByteArray &translateContext, QPointer<DTK_CO
title->setProperty("key", subgroup->key());
title->setStyleSheet("#ContentSubTitleText{font-weight: 520; "
// "border: 1px solid red; "
"font-size: 12px;"
"}");
d->contentLayout->addWidget(title);
d->contentLayout->addSpacing(10);
Expand All @@ -192,7 +192,7 @@ void Content::updateSettings(const QByteArray &translateContext, QPointer<DTK_CO
}
}

auto resetBt = new QPushButton(QObject::tr("Restore Defaults"));
auto resetBt = new DSuggestButton(QObject::tr("Restore Defaults"));
resetBt->setObjectName("SettingsContentReset");
resetBt->setFixedSize(310, 36);

Expand Down
1 change: 0 additions & 1 deletion src/widgets/private/settings/navigationdelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ void NavigationDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op
auto pen = isSelected ? QColor("#2ca7f8") : QColor("#303030");
painter->setPen(pen);
auto font = painter->font();
font.setPixelSize(12);
painter->setFont(font);

QFontMetrics fm(font);
Expand Down
28 changes: 0 additions & 28 deletions src/widgets/themes/dark/Dtk--Widget--DSettingsDialog.theme
Original file line number Diff line number Diff line change
Expand Up @@ -45,34 +45,6 @@
border: solid 1px rgba(0, 90, 224, 0.22);
}


#SettingsContentReset {
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #FFFFFF, stop:1 #FBFBFB);
border-color: rgba(0, 131, 255, 0.4);
border-radius: 4;
border-style: solid;
border-width: 1;
outline: none;
padding: 3px 24px 4px 24px;
color: #0699ff;
font-size: 14px;
}

#SettingsContentReset:hover {
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #8ccfff, stop:1 #4bb8ff);
color: #FFFFFF;
border-color: rgba(0, 117, 243, 0.2);
}

#SettingsContentReset:pressed {
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #0b8cff, stop:1 #0aa1ff);
color: #FFFFFF;
border-color: rgba(29, 129, 255, 0.3);
}

#DSettingsDialogClose{
qproperty-normalPic: url(:/images/light/images/window/close_normal.svg);
qproperty-hoverPic: url(:/images/light/images/window/close_hover.svg);
Expand Down
28 changes: 0 additions & 28 deletions src/widgets/themes/light/Dtk--Widget--DSettingsDialog.theme
Original file line number Diff line number Diff line change
Expand Up @@ -45,34 +45,6 @@
border: solid 1px rgba(0, 90, 224, 0.22);
}


#SettingsContentReset {
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #FFFFFF, stop:1 #FBFBFB);
border-color: rgba(0, 131, 255, 0.4);
border-radius: 4;
border-style: solid;
border-width: 1;
outline: none;
padding: 3px 24px 4px 24px;
color: #0699ff;
font-size: 14px;
}

#SettingsContentReset:hover {
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #8ccfff, stop:1 #4bb8ff);
color: #FFFFFF;
border-color: rgba(0, 117, 243, 0.2);
}

#SettingsContentReset:pressed {
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #0b8cff, stop:1 #0aa1ff);
color: #FFFFFF;
border-color: rgba(29, 129, 255, 0.3);
}

#DSettingsDialogClose{
qproperty-normalPic: url(:/images/light/images/window/close_normal.svg);
qproperty-hoverPic: url(:/images/light/images/window/close_hover.svg);
Expand Down

0 comments on commit 115febe

Please sign in to comment.