Commit f7add23a authored by Andreas Traczyk's avatar Andreas Traczyk

settings: fix auto update string and custom toggleswitch margins

Change-Id: Ib9aec88b5b2e857c76c06fc096e2fa41d0e3d8ed
parent 4c87947d
......@@ -959,6 +959,9 @@
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_16">
<property name="spacing">
<number>14</number>
</property>
<property name="leftMargin">
<number>20</number>
</property>
......@@ -1005,7 +1008,7 @@
<string>Toggle automatic updates</string>
</property>
<property name="text" stdset="0">
<string>Check for updates automatically every</string>
<string>Check for updates automatically</string>
</property>
<property name="checked" stdset="0">
<bool>true</bool>
......
......@@ -28,7 +28,7 @@ ToggleSwitch::ToggleSwitch(QWidget *parent)
switch_(false),
margin_(3),
thumb_("#d5d5d5"),
textMargin_(24),
textMargin_(18),
anim_(new QPropertyAnimation(this, "offset", this)),
style_(SwitchStyle::UWP)
{
......@@ -55,8 +55,6 @@ void ToggleSwitch::paintEvent(QPaintEvent *e)
{
Q_UNUSED(e);
QPainter p(this);
//p.setOpacity(isEnabled() ? (switch_ ? 0.5 : 0.38) : 0.12);
//p.setOpacity(isEnabled() ? 1.0 : 0.12);
p.setOpacity(isEnabled() ? (switch_ ? 1.0 : 0.5) : 0.12);
p.setRenderHint(QPainter::Antialiasing, true);
......@@ -98,7 +96,7 @@ void ToggleSwitch::paintEvent(QPaintEvent *e)
}
p.setOpacity(1.0);
p.setPen(isEnabled() ? Qt::black : Qt::gray);
p.drawText(width_ + textMargin_, height_ - margin_, text_);
p.drawText(width_ + textMargin_, height_ - margin_ - 1, text_);
}
void ToggleSwitch::mouseReleaseEvent(QMouseEvent *e)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment