Browse Source

Small style improvements

Ivan Arkhipov 3 years ago
parent
commit
3a4070e37b

+ 2 - 1
src/Legacy/widgets/mainwindow.cpp

@@ -417,7 +417,8 @@ void MainWindow::setEventFilterRecursive(QObject *widget)
         "QPushButton",
         "QCheckBox",
         "QComboBox",
-        "QLabel"
+        "QLabel",
+        "QWidget"
     };
 
     if (classes_to_set.contains(widget->metaObject()->className())) {

+ 19 - 13
src/Legacy/widgets/statuswidget.ui

@@ -239,10 +239,10 @@ QPushButton#game_button:disabled {
    </property>
    <property name="geometry">
     <rect>
-     <x>330</x>
-     <y>440</y>
-     <width>411</width>
-     <height>31</height>
+     <x>310</x>
+     <y>420</y>
+     <width>491</width>
+     <height>51</height>
     </rect>
    </property>
    <property name="font">
@@ -268,9 +268,9 @@ QPushButton#game_button:disabled {
   <widget class="QWidget" name="sub_entry_1" native="true">
    <property name="geometry">
     <rect>
-     <x>300</x>
+     <x>310</x>
      <y>10</y>
-     <width>481</width>
+     <width>471</width>
      <height>131</height>
     </rect>
    </property>
@@ -457,6 +457,12 @@ background-color: none;</string>
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
+         <property name="minimumSize">
+          <size>
+           <width>130</width>
+           <height>0</height>
+          </size>
+         </property>
          <property name="font">
           <font>
            <family>Crimson Text</family>
@@ -518,10 +524,10 @@ border-radius: 3px;</string>
   <widget class="QWidget" name="sub_entry_3" native="true">
    <property name="geometry">
     <rect>
-     <x>300</x>
+     <x>310</x>
      <y>150</y>
-     <width>481</width>
-     <height>281</height>
+     <width>471</width>
+     <height>251</height>
     </rect>
    </property>
    <property name="styleSheet">
@@ -692,7 +698,7 @@ border-radius: 3px;</string>
         <widget class="SwitchButton" name="graphics_block_switch" native="true">
          <property name="minimumSize">
           <size>
-           <width>64</width>
+           <width>110</width>
            <height>0</height>
           </size>
          </property>
@@ -765,7 +771,7 @@ border-radius: 3px;</string>
         <widget class="SwitchButton" name="video_block_switch" native="true">
          <property name="minimumSize">
           <size>
-           <width>64</width>
+           <width>110</width>
            <height>0</height>
           </size>
          </property>
@@ -838,7 +844,7 @@ border-radius: 3px;</string>
         <widget class="SwitchButton" name="audio_block_switch" native="true">
          <property name="minimumSize">
           <size>
-           <width>64</width>
+           <width>110</width>
            <height>0</height>
           </size>
          </property>
@@ -911,7 +917,7 @@ border-radius: 3px;</string>
         <widget class="SwitchButton" name="loadscreens_block_switch" native="true">
          <property name="minimumSize">
           <size>
-           <width>64</width>
+           <width>110</width>
            <height>0</height>
           </size>
          </property>

+ 10 - 11
src/Legacy/widgets/switchbutton.cpp

@@ -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));