diff --git a/settingswidget.ui b/settingswidget.ui index 5bc12eed2a2c422813117070dade03f8ba69fdd1..9a77f378947b012df8aa42fa52f15663e17dd94f 100644 --- a/settingswidget.ui +++ b/settingswidget.ui @@ -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> diff --git a/toggleswitch.cpp b/toggleswitch.cpp index f7554a9ec361fe04bb5874ca31a024b26e436d87..f20885d12614258bdff756ccd732649a1393007f 100644 --- a/toggleswitch.cpp +++ b/toggleswitch.cpp @@ -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)