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 @@ ...@@ -959,6 +959,9 @@
</item> </item>
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout_16"> <layout class="QVBoxLayout" name="verticalLayout_16">
<property name="spacing">
<number>14</number>
</property>
<property name="leftMargin"> <property name="leftMargin">
<number>20</number> <number>20</number>
</property> </property>
...@@ -1005,7 +1008,7 @@ ...@@ -1005,7 +1008,7 @@
<string>Toggle automatic updates</string> <string>Toggle automatic updates</string>
</property> </property>
<property name="text" stdset="0"> <property name="text" stdset="0">
<string>Check for updates automatically every</string> <string>Check for updates automatically</string>
</property> </property>
<property name="checked" stdset="0"> <property name="checked" stdset="0">
<bool>true</bool> <bool>true</bool>
......
...@@ -28,7 +28,7 @@ ToggleSwitch::ToggleSwitch(QWidget *parent) ...@@ -28,7 +28,7 @@ ToggleSwitch::ToggleSwitch(QWidget *parent)
switch_(false), switch_(false),
margin_(3), margin_(3),
thumb_("#d5d5d5"), thumb_("#d5d5d5"),
textMargin_(24), textMargin_(18),
anim_(new QPropertyAnimation(this, "offset", this)), anim_(new QPropertyAnimation(this, "offset", this)),
style_(SwitchStyle::UWP) style_(SwitchStyle::UWP)
{ {
...@@ -55,8 +55,6 @@ void ToggleSwitch::paintEvent(QPaintEvent *e) ...@@ -55,8 +55,6 @@ void ToggleSwitch::paintEvent(QPaintEvent *e)
{ {
Q_UNUSED(e); Q_UNUSED(e);
QPainter p(this); 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.setOpacity(isEnabled() ? (switch_ ? 1.0 : 0.5) : 0.12);
p.setRenderHint(QPainter::Antialiasing, true); p.setRenderHint(QPainter::Antialiasing, true);
...@@ -98,7 +96,7 @@ void ToggleSwitch::paintEvent(QPaintEvent *e) ...@@ -98,7 +96,7 @@ void ToggleSwitch::paintEvent(QPaintEvent *e)
} }
p.setOpacity(1.0); p.setOpacity(1.0);
p.setPen(isEnabled() ? Qt::black : Qt::gray); 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) 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