Browse Source

Fonts and widgets styles global emprovements

Ivan Arkhipov 5 years ago
parent
commit
e923155fee

+ 11 - 5
src/Legacy/constants.h

@@ -3,19 +3,25 @@
 
 const double default_window_width = 1000;
 const double default_window_height = 648;
-
-const double default_pixels_in_11_pt = 13;
-const double default_pixels_in_10_pt = 12;
-const double default_pixels_in_9_pt = 11;
-const double default_pixels_in_8_pt = 9;
+//10   11   13   16   17   19   20
+const double default_pixels_in_12_pt = 20;//14;
+const double default_pixels_in_11_pt = 19;//13;
+const double default_pixels_in_10_pt = 17;//12;
+const double default_pixels_in_9_pt = 16;//11;
+const double default_pixels_in_8_pt = 14;//9;
+const double default_pixels_in_7_pt = 12;//8;
+const double default_pixels_in_6_pt = 10;//7;
 
 // Defined and should be updated only by MainWindow!!!
 extern double window_height;
 extern double window_width;
 
+extern int pixels_in_12_pt;
 extern int pixels_in_11_pt;
 extern int pixels_in_10_pt;
 extern int pixels_in_9_pt;
 extern int pixels_in_8_pt;
+extern int pixels_in_7_pt;
+extern int pixels_in_6_pt;
 
 #endif // CONSTANTS_H

+ 10 - 7
src/Legacy/main.cpp

@@ -14,10 +14,14 @@
 double window_height = 1000;
 double window_width = 648;
 
-int pixels_in_11_pt = 13;
-int pixels_in_10_pt = 12;
-int pixels_in_9_pt = 11;
-int pixels_in_8_pt = 9;
+//10   11   13   16   17   19   20
+int pixels_in_12_pt = 20;//14;
+int pixels_in_11_pt = 19;//13;
+int pixels_in_10_pt = 17;//12;
+int pixels_in_9_pt = 16;//11;
+int pixels_in_8_pt = 15;//9;
+int pixels_in_7_pt = 11;//8;
+int pixels_in_6_pt = 10;//7;
 
 int main(int argc, char *argv[])
 {
@@ -35,12 +39,11 @@ int main(int argc, char *argv[])
         return 1;
     }
 
-    qDebug() << "Registering resources";
+    qDebug() << "Initialising fonts and resources";
     QResource::registerResource(QApplication::applicationDirPath() + "/data01.gtr");
     QResource::registerResource(QApplication::applicationDirPath() + "/data02.gtr");
 
-    QFontDatabase::addApplicationFont("qrc:/fonts/trajan.ttf");
-    QFontDatabase::addApplicationFont("qrc:/fonts/trajan_bold.otf");
+    QFontDatabase::addApplicationFont(":/fonts/trajan.ttf");
 
     qDebug() << "Starting main frame initialisation...";
 

+ 0 - 23
src/Legacy/widgets/newslistwidget.cpp

@@ -62,19 +62,6 @@ void NewsListWidget::updateNews()
         QString news_date = news_piece[4];
 
         constructNewsPiece(i, news_title, news_desrc, news_src, news_date);
-
-//        QtConcurrent::run([i, this, img_src](){
-//            Downloader img_dwnld;
-//            QByteArray img = "";
-//            img_dwnld.setUrl(QUrl(img_src));
-//            img_dwnld.targetBytearray = &img;
-//            img_dwnld.start();
-//            img_dwnld.waitForDownloaded();
-//            qDebug() << "Downloaded " << img_src;
-//            QPixmap img_pixmap;
-//            img_pixmap.loadFromData(img);
-//            QMetaObject::invokeMethod(this, "setImgToNewsPiece", Qt::QueuedConnection, Q_ARG(int, i), Q_ARG(QPixmap, img_pixmap));
-//        });
     }
 
     QSpacerItem* verticalSpacer = new QSpacerItem(20, 0, QSizePolicy::Minimum, QSizePolicy::Expanding);
@@ -92,18 +79,8 @@ void NewsListWidget::constructNewsPiece(int piece_id, QString title, QString tex
 
     NewsPiece* news_piece = new NewsPiece(this);
     news_piece->setObjectName(QStringLiteral("news_piece_") + QString::number(piece_id));
-//    news_piece->setIcon(QPixmap(QString::fromUtf8(":/appicon.ico")).scaled(40, 40));
     news_piece->setTitle(title, news_src);
-//    news_piece->setContents(text);
     news_piece->setDate(news_date);
 
     news_layout->addWidget(news_piece, piece_id, 0);
 }
-
-void NewsListWidget::setImgToNewsPiece(int piece_id, QPixmap img)
-{
-    NewsPiece* piece = findChild<NewsPiece*>("news_piece_" + QString::number(piece_id));
-    if (!piece)
-        return;
-//    piece->setIcon(img);
-}

+ 0 - 2
src/Legacy/widgets/newslistwidget.h

@@ -25,8 +25,6 @@ signals:
 
 public slots:
     void updateNews();
-private slots:
-    void setImgToNewsPiece(int piece_id, QPixmap img);
 
 private:
     void constructNewsPiece(int piece_id, QString title, QString text, QString news_src, QString news_date);

+ 18 - 1
src/Legacy/widgets/newspiece.cpp

@@ -1,5 +1,7 @@
+
 #include "newspiece.h"
 #include "ui_newspiece.h"
+#include "constants.h"
 #include <QDebug>
 
 NewsPiece::NewsPiece(QWidget *parent) :
@@ -13,7 +15,7 @@ void NewsPiece::setTitle(const QString &title, const QString &url)
 {
     _title = title;
     _url = url;
-    ui->news_title->setText("<a style=\"color: #cfa644; text-decoration:none;\" href = '" + QString(url).remove("\n") + "'>" + QString(title).remove("\n") + "</a>");
+    ui->news_title->setText("<a style=\"color: #ffaa5e; text-decoration:none;\" href = '" + QString(url).remove("\n") + "'>" + QString(title).remove("\n") + "</a>");
     resize(sizeHint());
 }
 
@@ -42,3 +44,18 @@ NewsPiece::~NewsPiece()
 {
     delete ui;
 }
+
+void NewsPiece::updateFontsSizes()
+{
+    QFont font8pt = QFont(ui->news_title->font());
+    QFont font7pt = QFont(ui->news_date->font());
+    font8pt.setPixelSize(pixels_in_8_pt);
+    font7pt.setPixelSize(pixels_in_7_pt);
+    ui->news_title->setFont(font8pt);
+    ui->news_date->setFont(font7pt);
+}
+
+void NewsPiece::resizeEvent(QResizeEvent *event)
+{
+    updateFontsSizes();
+}

+ 6 - 0
src/Legacy/widgets/newspiece.h

@@ -23,6 +23,12 @@ public:
 
     ~NewsPiece();
 
+public slots:
+    void updateFontsSizes();
+
+protected:
+    void resizeEvent(QResizeEvent *event) override;
+
 private:
     QString _title;
     QString _url;

+ 3 - 5
src/Legacy/widgets/newspiece.ui

@@ -91,10 +91,8 @@ color:white;
         <property name="font">
          <font>
           <family>Trajan Pro 3</family>
-          <pointsize>8</pointsize>
-          <weight>50</weight>
+          <pointsize>9</pointsize>
           <italic>false</italic>
-          <bold>false</bold>
           <kerning>false</kerning>
          </font>
         </property>
@@ -126,12 +124,12 @@ color:white;
         <property name="font">
          <font>
           <family>Trajan Pro 3</family>
-          <pointsize>6</pointsize>
+          <pointsize>8</pointsize>
           <italic>false</italic>
          </font>
         </property>
         <property name="styleSheet">
-         <string notr="true">color: rgb(215, 215, 215);</string>
+         <string notr="true"/>
         </property>
         <property name="text">
          <string>02.04.2019</string>

File diff suppressed because it is too large
+ 160 - 830
src/Legacy/widgets/rusificationwidget.ui


+ 30 - 0
src/Legacy/widgets/serverstatuswidget.cpp

@@ -2,6 +2,7 @@
 #include "ui_serverstatuswidget.h"
 
 #include <QDebug>
+#include "constants.h"
 
 ServerStatusWidget::ServerStatusWidget(QWidget *parent) :
     QWidget(parent),
@@ -24,6 +25,35 @@ ServerStatusWidget::~ServerStatusWidget()
     delete ui;
 }
 
+void ServerStatusWidget::updateFontsSizes()
+{
+    QFont font9pt = QFont(ui->anor->font());
+    font9pt.setPixelSize(pixels_in_9_pt);
+    QStringList servers_list = {"Anor",
+                                "Arkenstone",
+                                "Belegaer",
+                                "Brandywine",
+                                "Bullroarer",
+                                "Crickhollow",
+                                "Evernight",
+                                "Gladden",
+                                "Gwaihir",
+                                "Ithil",
+                                "Landroval",
+                                "Laurelin",
+                                "Sirannon"};
+
+    foreach (QString server_name, servers_list) {
+        QLabel* label = ui->servers_list->findChild<QLabel*>(server_name.toLower());
+        label->setFont(font9pt);
+    }
+}
+
+void ServerStatusWidget::resizeEvent(QResizeEvent *event)
+{
+    updateFontsSizes();
+}
+
 void ServerStatusWidget::updateStatus()
 {
     QStringList servers = QString(downloaded_data).split("|||");

+ 6 - 0
src/Legacy/widgets/serverstatuswidget.h

@@ -18,6 +18,12 @@ public:
     explicit ServerStatusWidget(QWidget *parent = 0);
     ~ServerStatusWidget();
 
+public slots:
+    void updateFontsSizes();
+
+protected:
+    void resizeEvent(QResizeEvent *event) override;
+
 public slots:
     void updateStatus();
 

+ 1 - 1
src/Legacy/widgets/serverstatuswidget.ui

@@ -39,7 +39,7 @@
     <number>0</number>
    </property>
    <item row="0" column="0">
-    <widget class="QWidget" name="other_servers" native="true">
+    <widget class="QWidget" name="servers_list" native="true">
      <property name="styleSheet">
       <string notr="true">color:white;</string>
      </property>

+ 69 - 29
src/Legacy/widgets/statuswidget.cpp

@@ -28,6 +28,33 @@ StatusWidget::StatusWidget(QSettings* settings, PatchDownloader* patch_downloade
     connect(ui->news_list, &NewsListWidget::showHelpToolTip, this, &StatusWidget::setToolTipToNewsHelp);
     connect(ui->news_list, &NewsListWidget::showNoToolTip, this, &StatusWidget::resetToolTip);
 
+    tooltip_effects[ui->news_tooltip->objectName()] = new QGraphicsOpacityEffect(ui->news_tooltip);
+    tooltip_effects[ui->weekly_code_tooltip_1->objectName()] = new QGraphicsOpacityEffect(ui->weekly_code_tooltip_1);
+    tooltip_effects[ui->weekly_code_tooltip_2->objectName()] = new QGraphicsOpacityEffect(ui->weekly_code_tooltip_2);
+    tooltip_effects[ui->patches_status->objectName()] = new QGraphicsOpacityEffect(ui->patches_status);
+
+    tooltip_animations[ui->news_tooltip->objectName()] = new QPropertyAnimation(tooltip_effects[ui->news_tooltip->objectName()], "opacity");
+    tooltip_animations[ui->weekly_code_tooltip_1->objectName()] = new QPropertyAnimation(tooltip_effects[ui->weekly_code_tooltip_1->objectName()], "opacity");
+    tooltip_animations[ui->weekly_code_tooltip_2->objectName()] = new QPropertyAnimation(tooltip_effects[ui->weekly_code_tooltip_2->objectName()], "opacity");
+    tooltip_animations[ui->patches_status->objectName()] = new QPropertyAnimation(tooltip_effects[ui->patches_status->objectName()], "opacity");
+
+    ui->news_tooltip->setGraphicsEffect(tooltip_effects[ui->news_tooltip->objectName()]);
+    ui->weekly_code_tooltip_1->setGraphicsEffect(tooltip_effects[ui->weekly_code_tooltip_1->objectName()]);
+    ui->weekly_code_tooltip_2->setGraphicsEffect(tooltip_effects[ui->weekly_code_tooltip_2->objectName()]);
+    ui->patches_status->setGraphicsEffect(tooltip_effects[ui->patches_status->objectName()]);
+
+    foreach (QPropertyAnimation* animation, tooltip_animations) {
+        animation->setDuration(250);
+        animation->setStartValue(0);
+        animation->setEndValue(1);
+        animation->setDirection(QAbstractAnimation::Forward);
+    }
+
+    foreach (QGraphicsOpacityEffect* effect, tooltip_effects) {
+        effect->setOpacity(0);
+    }
+
+    active_tooltip = nullptr;
     resetToolTip();
 }
 
@@ -47,10 +74,11 @@ void StatusWidget::updateFontsSizes()
     QFont pt8_font = QFont(ui->images_label->font());
     pt8_font.setPixelSize(pixels_in_8_pt);
 
-    ui->progress_label->setFont(pt8_font);
+    ui->progress_label->setFont(pt9_font);
     ui->game_button->setFont(pt11_font);
     ui->news_label->setFont(pt10_font);
-    ui->news_tooltip->setFont(pt9_font);
+    ui->news_tooltip->setFont(pt10_font);
+
     ui->images_label->setFont(pt8_font);
     ui->images_status->setFont(pt8_font);
     ui->sounds_label->setFont(pt8_font);
@@ -59,8 +87,9 @@ void StatusWidget::updateFontsSizes()
     ui->texts_status->setFont(pt8_font);
     ui->videos_label->setFont(pt8_font);
     ui->videos_status->setFont(pt8_font);
-    ui->weekly_code_tooltip_1->setFont(pt9_font);
-    ui->weekly_code_tooltip_2->setFont(pt9_font);
+
+    ui->weekly_code_tooltip_1->setFont(pt10_font);
+    ui->weekly_code_tooltip_2->setFont(pt10_font);
 }
 
 void StatusWidget::resizeEvent(QResizeEvent *event)
@@ -80,12 +109,15 @@ void StatusWidget::resizeEvent(QResizeEvent *event)
     ui->server_status_widget->resize(QSize(155, 320) * coefficient);
     ui->weekly_code_widget->move(QPoint(810, 13) * coefficient);
     ui->weekly_code_widget->resize(QSize(173, 57) * coefficient);
-    ui->witch_king_widget->move(QPoint(315, 20) * coefficient);
-    ui->witch_king_widget->resize(QSize(511, 421) * coefficient);
-    ui->witch_king_text_content->move(QPoint(50, 30) * coefficient);
-    ui->witch_king_text_content->resize(QSize(331, 101) * coefficient);
-
-
+    ui->galadriel_widget->move(QPoint(305, 20) * coefficient);
+    ui->galadriel_widget->resize(QSize(531, 461) * coefficient);
+
+    ui->news_tooltip->move(QPoint(70, 30) * coefficient);
+    ui->news_tooltip->resize(QSize(371, 101) * coefficient);
+    ui->patches_status->move(QPoint(70, 30) * coefficient);
+    ui->patches_status->resize(QSize(371, 101) * coefficient);
+    ui->weekly_code_tooltip_1->move(QPoint(70, 30) * coefficient);
+    ui->weekly_code_tooltip_2->resize(QSize(371, 101) * coefficient);
     updateFontsSizes();
 }
 
@@ -120,36 +152,44 @@ void StatusWidget::on_game_button_clicked()
 
 void StatusWidget::setToolTipToWeeklyCodeHelp()
 {
-    ui->patches_status->hide();
-    ui->weekly_code_tooltip_2->hide();
-    ui->news_tooltip->hide();
-
-    ui->weekly_code_tooltip_1->show();
+    fadeBetweenToolTips(ui->weekly_code_tooltip_1);
 }
 
 void StatusWidget::setToolTipToWeeklyCodeComplete()
 {
-    ui->patches_status->hide();
-    ui->weekly_code_tooltip_1->hide();
-    ui->news_tooltip->hide();
-
-    ui->weekly_code_tooltip_2->show();
+    fadeBetweenToolTips(ui->weekly_code_tooltip_2);
 }
 
 void StatusWidget::setToolTipToNewsHelp()
 {
-    ui->patches_status->hide();
-    ui->weekly_code_tooltip_1->hide();
-    ui->weekly_code_tooltip_2->hide();
-
-    ui->news_tooltip->show();
+    fadeBetweenToolTips(ui->news_tooltip);
 }
 
 void StatusWidget::resetToolTip()
 {
-    ui->weekly_code_tooltip_1->hide();
-    ui->weekly_code_tooltip_2->hide();
-    ui->news_tooltip->hide();
+    fadeBetweenToolTips(ui->patches_status);
+}
+
+void StatusWidget::fadeBetweenToolTips(QWidget* next_tooltip)
+{
+    if (active_tooltip) {
+        QPropertyAnimation* active_tooltip_anim = tooltip_animations[active_tooltip->objectName()];
+    //    if (active_tooltip_anim->state() == QAbstractAnimation::Running) {
+    //        active_tooltip_anim->pause();
+    //    }
+
+        active_tooltip_anim->setDirection(QAbstractAnimation::Backward);
+
+        if (active_tooltip_anim->state() == QAbstractAnimation::Stopped)
+            active_tooltip_anim->start();
+    }
+
+    QPropertyAnimation* next_active_tooltip_anim = tooltip_animations[next_tooltip->objectName()];
+    next_active_tooltip_anim->setDirection(QAbstractAnimation::Forward);
+
+    if (next_active_tooltip_anim->state() == QAbstractAnimation::Stopped)
+        next_active_tooltip_anim->start();
+
 
-    ui->patches_status->show();
+    active_tooltip = next_tooltip;
 }

+ 8 - 8
src/Legacy/widgets/statuswidget.h

@@ -3,6 +3,9 @@
 
 #include <QWidget>
 #include <QSettings>
+#include <QPropertyAnimation>
+#include <QMap>
+#include <QGraphicsOpacityEffect>
 
 namespace Ui {
 class StatusWidget;
@@ -39,6 +42,8 @@ private slots:
     void setToolTipToNewsHelp();
     void resetToolTip();
 
+    void fadeBetweenToolTips(QWidget* next_tooltip);
+
 
 
 private:
@@ -48,14 +53,9 @@ private:
     PatchDownloader* patch_updater;
     LotroDatManager* lotro_manager;
 
-    const QColor inWorkColor = QColor(85, 170, 255);
-    const QColor readyColor = QColor(0, 170, 0);
-    const QColor errorColor = QColor(255, 85, 0);
-
-    const QString inWorkIconStyle = "image: url(:/assets/info.png);";
-    const QString readyIconStyle = "image: url(:/assets/ok.png);";
-    const QString criticalIconStyle = "image: url(:/assets/critical.png);";
-    const QString warningIconStyle = "image: url(:/assets/warning.png);";
+    QMap<QString, QGraphicsOpacityEffect*> tooltip_effects;
+    QMap<QString, QPropertyAnimation*> tooltip_animations;
+    QWidget* active_tooltip;
 };
 
 #endif // STATUSWIDGET_H

+ 194 - 180
src/Legacy/widgets/statuswidget.ui

@@ -64,7 +64,7 @@ QScrollBar:vertical {
      border: 0px solid grey;
      background: transparent;
      width: 10px;
-     margin: 22px 0 22px 0;
+     margin: 10px 0 10px 0;
  }
 
  QScrollBar::handle:vertical {
@@ -91,8 +91,8 @@ QScrollBar:vertical {
  }
  QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical {
      border: 0px;
-     width: 3px;
-     height: 3px;
+     width: 0px;
+     height: 0px;
      background: transparent;
  }
 
@@ -143,33 +143,111 @@ QScrollBar:vertical {
     <string notr="true"/>
    </property>
   </widget>
-  <widget class="QWidget" name="witch_king_widget" native="true">
+  <widget class="QWidget" name="galadriel_widget" native="true">
    <property name="geometry">
     <rect>
-     <x>315</x>
+     <x>305</x>
      <y>20</y>
-     <width>511</width>
-     <height>421</height>
+     <width>531</width>
+     <height>461</height>
     </rect>
    </property>
    <property name="styleSheet">
-    <string notr="true">QWidget#witch_king_widget{
-border-image: url(:/characters/witch_king_with_text.png);
+    <string notr="true">QWidget#galadriel_widget{
+border-image: url(:/characters/galadriel_with_text.png);
 }</string>
    </property>
-   <widget class="QWidget" name="witch_king_text_content" native="true">
+   <widget class="QLabel" name="weekly_code_tooltip_1">
     <property name="geometry">
      <rect>
-      <x>50</x>
+      <x>60</x>
       <y>30</y>
-      <width>331</width>
+      <width>381</width>
       <height>101</height>
      </rect>
     </property>
-    <layout class="QVBoxLayout" name="verticalLayout">
-     <property name="spacing">
-      <number>0</number>
-     </property>
+    <property name="font">
+     <font>
+      <family>Trajan Pro 3</family>
+      <pointsize>11</pointsize>
+      <italic>true</italic>
+     </font>
+    </property>
+    <property name="text">
+     <string>Кликните по еженедельному коду, чтобы скопировать его в буфер обмена</string>
+    </property>
+    <property name="alignment">
+     <set>Qt::AlignCenter</set>
+    </property>
+    <property name="wordWrap">
+     <bool>true</bool>
+    </property>
+   </widget>
+   <widget class="QLabel" name="news_tooltip">
+    <property name="geometry">
+     <rect>
+      <x>60</x>
+      <y>30</y>
+      <width>381</width>
+      <height>101</height>
+     </rect>
+    </property>
+    <property name="font">
+     <font>
+      <family>Trajan Pro 3</family>
+      <pointsize>11</pointsize>
+      <italic>true</italic>
+     </font>
+    </property>
+    <property name="styleSheet">
+     <string notr="true">o</string>
+    </property>
+    <property name="text">
+     <string>Кликайте по заголовку новости, чтобы открыть её в браузере</string>
+    </property>
+    <property name="alignment">
+     <set>Qt::AlignCenter</set>
+    </property>
+    <property name="wordWrap">
+     <bool>true</bool>
+    </property>
+   </widget>
+   <widget class="QLabel" name="weekly_code_tooltip_2">
+    <property name="geometry">
+     <rect>
+      <x>60</x>
+      <y>30</y>
+      <width>381</width>
+      <height>101</height>
+     </rect>
+    </property>
+    <property name="font">
+     <font>
+      <family>Trajan Pro 3</family>
+      <pointsize>11</pointsize>
+      <italic>false</italic>
+     </font>
+    </property>
+    <property name="text">
+     <string>Еженедельный код успешно скопирован в буфер обмена!</string>
+    </property>
+    <property name="alignment">
+     <set>Qt::AlignCenter</set>
+    </property>
+    <property name="wordWrap">
+     <bool>true</bool>
+    </property>
+   </widget>
+   <widget class="QWidget" name="patches_status" native="true">
+    <property name="geometry">
+     <rect>
+      <x>70</x>
+      <y>30</y>
+      <width>371</width>
+      <height>101</height>
+     </rect>
+    </property>
+    <layout class="QGridLayout" name="gridLayout">
      <property name="leftMargin">
       <number>0</number>
      </property>
@@ -182,154 +260,27 @@ border-image: url(:/characters/witch_king_with_text.png);
      <property name="bottomMargin">
       <number>0</number>
      </property>
-     <item>
-      <widget class="QWidget" name="patches_status" native="true">
-       <layout class="QGridLayout" name="gridLayout">
-        <property name="leftMargin">
-         <number>0</number>
-        </property>
-        <property name="topMargin">
-         <number>0</number>
-        </property>
-        <property name="rightMargin">
-         <number>0</number>
-        </property>
-        <property name="bottomMargin">
-         <number>0</number>
-        </property>
-        <item row="0" column="0">
-         <widget class="QLabel" name="texts_label">
-          <property name="sizePolicy">
-           <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
-            <horstretch>0</horstretch>
-            <verstretch>0</verstretch>
-           </sizepolicy>
-          </property>
-          <property name="font">
-           <font>
-            <family>Trajan Pro 3</family>
-            <pointsize>7</pointsize>
-           </font>
-          </property>
-          <property name="text">
-           <string>Тексты:</string>
-          </property>
-         </widget>
-        </item>
-        <item row="0" column="1">
-         <widget class="QLabel" name="texts_status">
-          <property name="font">
-           <font>
-            <family>Trajan Pro 3</family>
-            <pointsize>7</pointsize>
-           </font>
-          </property>
-          <property name="text">
-           <string>скачивание 95.6% (956.2кб/с)</string>
-          </property>
-         </widget>
-        </item>
-        <item row="1" column="0">
-         <widget class="QLabel" name="images_label">
-          <property name="sizePolicy">
-           <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
-            <horstretch>0</horstretch>
-            <verstretch>0</verstretch>
-           </sizepolicy>
-          </property>
-          <property name="font">
-           <font>
-            <family>Trajan Pro 3</family>
-            <pointsize>7</pointsize>
-           </font>
-          </property>
-          <property name="text">
-           <string>Картинки:</string>
-          </property>
-         </widget>
-        </item>
-        <item row="1" column="1">
-         <widget class="QLabel" name="images_status">
-          <property name="font">
-           <font>
-            <family>Trajan Pro 3</family>
-            <pointsize>7</pointsize>
-           </font>
-          </property>
-          <property name="text">
-           <string>Установка: 32.2%</string>
-          </property>
-         </widget>
-        </item>
-        <item row="2" column="0">
-         <widget class="QLabel" name="sounds_label">
-          <property name="sizePolicy">
-           <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
-            <horstretch>0</horstretch>
-            <verstretch>0</verstretch>
-           </sizepolicy>
-          </property>
-          <property name="font">
-           <font>
-            <family>Trajan Pro 3</family>
-            <pointsize>7</pointsize>
-           </font>
-          </property>
-          <property name="text">
-           <string>Озвучка:</string>
-          </property>
-         </widget>
-        </item>
-        <item row="2" column="1">
-         <widget class="QLabel" name="sounds_status">
-          <property name="font">
-           <font>
-            <family>Trajan Pro 3</family>
-            <pointsize>7</pointsize>
-           </font>
-          </property>
-          <property name="text">
-           <string>Ожидание установки...</string>
-          </property>
-         </widget>
-        </item>
-        <item row="3" column="0">
-         <widget class="QLabel" name="videos_label">
-          <property name="sizePolicy">
-           <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
-            <horstretch>0</horstretch>
-            <verstretch>0</verstretch>
-           </sizepolicy>
-          </property>
-          <property name="font">
-           <font>
-            <family>Trajan Pro 3</family>
-            <pointsize>7</pointsize>
-           </font>
-          </property>
-          <property name="text">
-           <string>Ролики:</string>
-          </property>
-         </widget>
-        </item>
-        <item row="3" column="1">
-         <widget class="QLabel" name="videos_status">
-          <property name="font">
-           <font>
-            <family>Trajan Pro 3</family>
-            <pointsize>7</pointsize>
-           </font>
-          </property>
-          <property name="text">
-           <string>скачивание 35.6% (956.кб/с)</string>
-          </property>
-         </widget>
-        </item>
-       </layout>
+     <item row="0" column="0">
+      <widget class="QLabel" name="texts_label">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="font">
+        <font>
+         <family>Trajan Pro 3</family>
+         <pointsize>9</pointsize>
+        </font>
+       </property>
+       <property name="text">
+        <string>Тексты:</string>
+       </property>
       </widget>
      </item>
-     <item>
-      <widget class="QLabel" name="news_tooltip">
+     <item row="0" column="1">
+      <widget class="QLabel" name="texts_status">
        <property name="font">
         <font>
          <family>Trajan Pro 3</family>
@@ -337,18 +288,31 @@ border-image: url(:/characters/witch_king_with_text.png);
         </font>
        </property>
        <property name="text">
-        <string>Кликайте по заголовку новости, чтобы открыть её в браузере</string>
+        <string>скачивание 95.6% (956.2кб/с)</string>
        </property>
-       <property name="alignment">
-        <set>Qt::AlignCenter</set>
+      </widget>
+     </item>
+     <item row="1" column="0">
+      <widget class="QLabel" name="images_label">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
        </property>
-       <property name="wordWrap">
-        <bool>true</bool>
+       <property name="font">
+        <font>
+         <family>Trajan Pro 3</family>
+         <pointsize>9</pointsize>
+        </font>
+       </property>
+       <property name="text">
+        <string>Картинки:</string>
        </property>
       </widget>
      </item>
-     <item>
-      <widget class="QLabel" name="weekly_code_tooltip_2">
+     <item row="1" column="1">
+      <widget class="QLabel" name="images_status">
        <property name="font">
         <font>
          <family>Trajan Pro 3</family>
@@ -356,15 +320,50 @@ border-image: url(:/characters/witch_king_with_text.png);
         </font>
        </property>
        <property name="text">
-        <string>Еженедельный код успешно скопирован в буфер обмена!</string>
+        <string>Установка: 32.2%</string>
        </property>
-       <property name="wordWrap">
-        <bool>true</bool>
+      </widget>
+     </item>
+     <item row="2" column="0">
+      <widget class="QLabel" name="sounds_label">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="font">
+        <font>
+         <family>Trajan Pro 3</family>
+         <pointsize>9</pointsize>
+        </font>
+       </property>
+       <property name="text">
+        <string>Озвучка:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="2" column="1">
+      <widget class="QLabel" name="sounds_status">
+       <property name="font">
+        <font>
+         <family>Trajan Pro 3</family>
+         <pointsize>9</pointsize>
+        </font>
+       </property>
+       <property name="text">
+        <string>Ожидание установки...</string>
        </property>
       </widget>
      </item>
-     <item>
-      <widget class="QLabel" name="weekly_code_tooltip_1">
+     <item row="3" column="0">
+      <widget class="QLabel" name="videos_label">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
        <property name="font">
         <font>
          <family>Trajan Pro 3</family>
@@ -372,13 +371,20 @@ border-image: url(:/characters/witch_king_with_text.png);
         </font>
        </property>
        <property name="text">
-        <string>Кликните по еженедельному коду, чтобы скопировать его в буфер обмена</string>
+        <string>Ролики:</string>
        </property>
-       <property name="alignment">
-        <set>Qt::AlignCenter</set>
+      </widget>
+     </item>
+     <item row="3" column="1">
+      <widget class="QLabel" name="videos_status">
+       <property name="font">
+        <font>
+         <family>Trajan Pro 3</family>
+         <pointsize>9</pointsize>
+        </font>
        </property>
-       <property name="wordWrap">
-        <bool>true</bool>
+       <property name="text">
+        <string>скачивание 35.6% (956.кб/с)</string>
        </property>
       </widget>
      </item>
@@ -470,7 +476,7 @@ QPushButton#game_button:pressed {
     </font>
    </property>
    <property name="text">
-    <string>Скачивание и установка обновлений... 72.6%</string>
+    <string>Русификация... 72.6%</string>
    </property>
    <property name="alignment">
     <set>Qt::AlignCenter</set>
@@ -525,6 +531,14 @@ margin-bottom:7px;
     <bool>false</bool>
    </property>
   </widget>
+  <zorder>galadriel_widget</zorder>
+  <zorder>news_label</zorder>
+  <zorder>news_scroll_area</zorder>
+  <zorder>game_button</zorder>
+  <zorder>progress_label</zorder>
+  <zorder>progressBar</zorder>
+  <zorder>server_status_widget</zorder>
+  <zorder>weekly_code_widget</zorder>
  </widget>
  <customwidgets>
   <customwidget>

+ 18 - 0
src/Legacy/widgets/weeklycodewidget.cpp

@@ -6,6 +6,7 @@
 #include <QPainter>
 #include <QPaintEvent>
 #include <QClipboard>
+#include "constants.h"
 
 WeeklyCodeWidget::WeeklyCodeWidget(QWidget *parent) :
     QWidget(parent), ui(new Ui::WeeklyCodeWidget)
@@ -31,6 +32,23 @@ WeeklyCodeWidget::~WeeklyCodeWidget()
     delete ui;
 }
 
+void WeeklyCodeWidget::updateFontsSizes()
+{
+    QFont font9pt = QFont(ui->title->font());
+    QFont font10pt = QFont(ui->code->font());
+
+    font9pt.setPixelSize(pixels_in_9_pt);
+    font10pt.setPixelSize(pixels_in_10_pt);
+
+    ui->title->setFont(font9pt);
+    ui->code->setFont(font10pt);
+}
+
+void WeeklyCodeWidget::resizeEvent(QResizeEvent *event)
+{
+    updateFontsSizes();
+}
+
 void WeeklyCodeWidget::enterEvent(QEvent * event)
 {
     QWidget::enterEvent(event);

+ 4 - 0
src/Legacy/widgets/weeklycodewidget.h

@@ -18,7 +18,11 @@ public:
     explicit WeeklyCodeWidget(QWidget *parent = 0);
     ~WeeklyCodeWidget();
 
+public slots:
+    void updateFontsSizes();
+
 protected:
+    void resizeEvent(QResizeEvent *event) override;
     virtual void leaveEvent(QEvent * event) override;
     virtual void enterEvent(QEvent * event) override;
     virtual void mousePressEvent(QMouseEvent *ev) override;

Some files were not shown because too many files changed in this diff