|
@@ -6,7 +6,7 @@
|
|
|
SwitchButton::SwitchButton(QWidget* parent, Style style)
|
|
|
: QWidget(parent)
|
|
|
, _value(false)
|
|
|
- , _duration(100)
|
|
|
+ , _duration(200)
|
|
|
, _enabled(true)
|
|
|
{
|
|
|
_pencolor = QColor(120, 120, 120);
|
|
@@ -35,7 +35,7 @@ SwitchButton::SwitchButton(QWidget* parent, Style style)
|
|
|
_borderradius = 12;
|
|
|
_labeloff = new QLabel(this);
|
|
|
_background = new SwitchBackground(this, _oncolor);
|
|
|
- _labelon = new QLabel(this);
|
|
|
+ _labelon = new QLabel(_background);
|
|
|
_circle = new SwitchCircle(this, _offcolor);
|
|
|
__btn_move = new QPropertyAnimation(this);
|
|
|
__back_move = new QPropertyAnimation(this);
|
|
@@ -48,11 +48,11 @@ SwitchButton::SwitchButton(QWidget* parent, Style style)
|
|
|
setWindowFlags(Qt::FramelessWindowHint);
|
|
|
setAttribute(Qt::WA_TranslucentBackground);
|
|
|
|
|
|
- _labeloff->setText("Off");
|
|
|
- _labelon->setText("On");
|
|
|
- _labeloff->move(31, 5);
|
|
|
- _labelon->move(15, 5);
|
|
|
- setFixedSize(QSize(60, 24));
|
|
|
+ _labeloff->setText("Оригинал");
|
|
|
+ _labelon->setText("Перевод");
|
|
|
+ _labeloff->move(31, 3);
|
|
|
+ _labelon->move(20, 2);
|
|
|
+ setFixedSize(QSize(100, 24));
|
|
|
if (style == Style::YESNO)
|
|
|
{
|
|
|
_labeloff->setText("No");
|
|
@@ -247,10 +247,9 @@ SwitchButton::SwitchBackground::SwitchBackground(QWidget* parent, QColor color,
|
|
|
setFixedHeight(20);
|
|
|
|
|
|
_lg = QLinearGradient(0, 25, 70, 0);
|
|
|
- _lg.setColorAt(0, QColor(154, 194, 50));
|
|
|
- _lg.setColorAt(0.25, QColor(154, 210, 50));
|
|
|
- _lg.setColorAt(0.95, QColor(154, 194, 50));
|
|
|
-
|
|
|
+ _lg.setColorAt(0, QColor(0, 170, 0));
|
|
|
+ _lg.setColorAt(0.25, QColor(0, 194, 0));
|
|
|
+ _lg.setColorAt(0.95, QColor(0, 170, 50));
|
|
|
_lg_disabled = QLinearGradient(0, 25, 70, 0);
|
|
|
_lg_disabled.setColorAt(0, QColor(190, 190, 190));
|
|
|
_lg_disabled.setColorAt(0.25, QColor(230, 230, 230));
|