Ver código fonte

added 4 more backgrounds (9 in total)

Ivan Arkhipov 5 anos atrás
pai
commit
c936b9b9b3
7 arquivos alterados com 7 adições e 2 exclusões
  1. BIN
      assets/bg6.png
  2. BIN
      assets/bg7.png
  3. BIN
      assets/bg8.png
  4. BIN
      assets/bg9.png
  5. 2 1
      gui/mainwindow.cpp
  6. 1 1
      gui/mainwindow.h
  7. 4 0
      res.qrc

BIN
assets/bg6.png


BIN
assets/bg7.png


BIN
assets/bg8.png


BIN
assets/bg9.png


+ 2 - 1
gui/mainwindow.cpp

@@ -42,7 +42,8 @@ void MainWindow::Init() {
     changeFontSizeRecursive(100, this);
     updateGeometry();
 
-    background = new QPixmap(":/assets/bg1.png");
+    qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));
+    background = new QPixmap(":/assets/bg" + QString::number(qrand() % MAX_PIXMAP_ID + 1) + ".png");
     setupWindowBackgroundAndMask();
     setupMenuHoverWidget();
 

+ 1 - 1
gui/mainwindow.h

@@ -91,7 +91,7 @@ private:
     QTimer fade_animation_timer;
     double next_pixmap_opacity;
 
-    const int MAX_PIXMAP_ID = 5;
+    const int MAX_PIXMAP_ID = 9;
 
     const size_t common_font_size = 15;
     const size_t title_font_size = 16;

+ 4 - 0
res.qrc

@@ -19,5 +19,9 @@
         <file>assets/bg3.png</file>
         <file>assets/bg4.png</file>
         <file>assets/bg5.png</file>
+        <file>assets/bg6.png</file>
+        <file>assets/bg7.png</file>
+        <file>assets/bg8.png</file>
+        <file>assets/bg9.png</file>
     </qresource>
 </RCC>