feat: some may not want the loading screen
This commit is contained in:
+3
-2
@@ -14,14 +14,15 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"actions": {
|
"actions": {
|
||||||
"confirm": "~/.scripts/change-wallpaper.fish \"%1\""
|
"confirm": "~/.scripts/change-wallpaper.sh \"%1\""
|
||||||
},
|
},
|
||||||
"style": {
|
"style": {
|
||||||
"aspect_ratio": 1.6,
|
"aspect_ratio": 1.6,
|
||||||
"image_width": 320,
|
"image_width": 320,
|
||||||
"image_focus_width": 480,
|
"image_focus_width": 480,
|
||||||
"window_width": 750,
|
"window_width": 750,
|
||||||
"window_height": 500
|
"window_height": 500,
|
||||||
|
"no_loading_screen": true
|
||||||
},
|
},
|
||||||
"sort": {
|
"sort": {
|
||||||
"type": "name",
|
"type": "name",
|
||||||
|
|||||||
+7
-1
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* @Author: Uyanide pywang0608@foxmail.com
|
* @Author: Uyanide pywang0608@foxmail.com
|
||||||
* @Date: 2025-08-05 01:34:52
|
* @Date: 2025-08-05 01:34:52
|
||||||
* @LastEditTime: 2025-08-07 21:27:26
|
* @LastEditTime: 2025-08-07 22:02:55
|
||||||
* @Description: Configuration manager.
|
* @Description: Configuration manager.
|
||||||
*/
|
*/
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
@@ -99,6 +99,12 @@ void Config::_loadConfig(const QString &configPath) {
|
|||||||
info(QString("Window height: %1").arg(m_configItems.styleWindowHeight), GeneralLogger::STEP);
|
info(QString("Window height: %1").arg(m_configItems.styleWindowHeight), GeneralLogger::STEP);
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
|
{"style.no_loading_screen", "no_loading_screen", [this](const QJsonValue &val) {
|
||||||
|
if (val.isBool()) {
|
||||||
|
m_configItems.styleNoLoadingScreen = val.toBool();
|
||||||
|
info(QString("No loading screen: %1").arg(m_configItems.styleNoLoadingScreen), GeneralLogger::STEP);
|
||||||
|
}
|
||||||
|
}},
|
||||||
{"sort.type", "type", [this](const QJsonValue &val) {
|
{"sort.type", "type", [this](const QJsonValue &val) {
|
||||||
if (val.isString()) {
|
if (val.isString()) {
|
||||||
QString type = val.toString().toLower();
|
QString type = val.toString().toLower();
|
||||||
|
|||||||
+4
-1
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* @Author: Uyanide pywang0608@foxmail.com
|
* @Author: Uyanide pywang0608@foxmail.com
|
||||||
* @Date: 2025-08-05 01:34:52
|
* @Date: 2025-08-05 01:34:52
|
||||||
* @LastEditTime: 2025-08-06 00:23:45
|
* @LastEditTime: 2025-08-07 22:03:05
|
||||||
* @Description: Configuration manager.
|
* @Description: Configuration manager.
|
||||||
*/
|
*/
|
||||||
#ifndef CONFIG_H
|
#ifndef CONFIG_H
|
||||||
@@ -44,6 +44,8 @@ class Config : public QObject {
|
|||||||
|
|
||||||
[[nodiscard]] int getStyleWindowHeight() const { return m_configItems.styleWindowHeight; }
|
[[nodiscard]] int getStyleWindowHeight() const { return m_configItems.styleWindowHeight; }
|
||||||
|
|
||||||
|
[[nodiscard]] bool isStyleNoLoadingScreen() const { return m_configItems.styleNoLoadingScreen; }
|
||||||
|
|
||||||
[[nodiscard]] SortType getSortType() const { return m_configItems.sortType; }
|
[[nodiscard]] SortType getSortType() const { return m_configItems.sortType; }
|
||||||
|
|
||||||
[[nodiscard]] bool isSortReverse() const { return m_configItems.sortReverse; }
|
[[nodiscard]] bool isSortReverse() const { return m_configItems.sortReverse; }
|
||||||
@@ -66,6 +68,7 @@ class Config : public QObject {
|
|||||||
int styleImageFocusWidth = 480;
|
int styleImageFocusWidth = 480;
|
||||||
int styleWindowWidth = 720;
|
int styleWindowWidth = 720;
|
||||||
int styleWindowHeight = 500;
|
int styleWindowHeight = 500;
|
||||||
|
bool styleNoLoadingScreen = false;
|
||||||
SortType sortType = SortType::None;
|
SortType sortType = SortType::None;
|
||||||
bool sortReverse = false;
|
bool sortReverse = false;
|
||||||
} m_configItems;
|
} m_configItems;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* @Author: Uyanide pywang0608@foxmail.com
|
* @Author: Uyanide pywang0608@foxmail.com
|
||||||
* @Date: 2025-08-05 01:22:53
|
* @Date: 2025-08-05 01:22:53
|
||||||
* @LastEditTime: 2025-08-07 02:01:23
|
* @LastEditTime: 2025-08-07 22:06:44
|
||||||
* @Description: Animated carousel widget for displaying and selecting images.
|
* @Description: Animated carousel widget for displaying and selecting images.
|
||||||
*/
|
*/
|
||||||
#include "images_carousel.h"
|
#include "images_carousel.h"
|
||||||
@@ -77,7 +77,6 @@ void ImagesCarousel::_onInitImagesLoaded() {
|
|||||||
if (m_loadedImages.isEmpty()) {
|
if (m_loadedImages.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_currentIndex = 0;
|
|
||||||
_focusCurrImage();
|
_focusCurrImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* @Author: Uyanide pywang0608@foxmail.com
|
* @Author: Uyanide pywang0608@foxmail.com
|
||||||
* @Date: 2025-08-05 00:37:58
|
* @Date: 2025-08-05 00:37:58
|
||||||
* @LastEditTime: 2025-08-07 21:25:43
|
* @LastEditTime: 2025-08-07 21:38:26
|
||||||
* @Description: Entry point.
|
* @Description: Entry point.
|
||||||
*/
|
*/
|
||||||
#include <qapplication.h>
|
#include <qapplication.h>
|
||||||
|
|||||||
+4
-1
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* @Author: Uyanide pywang0608@foxmail.com
|
* @Author: Uyanide pywang0608@foxmail.com
|
||||||
* @Date: 2025-08-05 00:37:58
|
* @Date: 2025-08-05 00:37:58
|
||||||
* @LastEditTime: 2025-08-07 01:08:55
|
* @LastEditTime: 2025-08-07 22:03:58
|
||||||
* @Description: MainWindow implementation.
|
* @Description: MainWindow implementation.
|
||||||
*/
|
*/
|
||||||
#include "main_window.h"
|
#include "main_window.h"
|
||||||
@@ -140,6 +140,9 @@ void MainWindow::_onImageFocused(const QString &path, const int index, const int
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::_onLoadingStarted(const qsizetype amount) {
|
void MainWindow::_onLoadingStarted(const qsizetype amount) {
|
||||||
|
if (m_config.isStyleNoLoadingScreen()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
m_loadingIndicator->setMaximum(amount);
|
m_loadingIndicator->setMaximum(amount);
|
||||||
ui->stackedWidget->setCurrentIndex(m_loadingIndicatorIndex);
|
ui->stackedWidget->setCurrentIndex(m_loadingIndicatorIndex);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user