feat: some may not want the loading screen

This commit is contained in:
2025-08-07 22:08:22 +02:00
parent 8a8d967a58
commit 94fb258f2f
6 changed files with 27 additions and 15 deletions
+3 -2
View File
@@ -14,14 +14,15 @@
]
},
"actions": {
"confirm": "~/.scripts/change-wallpaper.fish \"%1\""
"confirm": "~/.scripts/change-wallpaper.sh \"%1\""
},
"style": {
"aspect_ratio": 1.6,
"image_width": 320,
"image_focus_width": 480,
"window_width": 750,
"window_height": 500
"window_height": 500,
"no_loading_screen": true
},
"sort": {
"type": "name",
+7 -1
View File
@@ -1,7 +1,7 @@
/*
* @Author: Uyanide pywang0608@foxmail.com
* @Date: 2025-08-05 01:34:52
* @LastEditTime: 2025-08-07 21:27:26
* @LastEditTime: 2025-08-07 22:02:55
* @Description: Configuration manager.
*/
#include "config.h"
@@ -99,6 +99,12 @@ void Config::_loadConfig(const QString &configPath) {
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) {
if (val.isString()) {
QString type = val.toString().toLower();
+11 -8
View File
@@ -1,7 +1,7 @@
/*
* @Author: Uyanide pywang0608@foxmail.com
* @Date: 2025-08-05 01:34:52
* @LastEditTime: 2025-08-06 00:23:45
* @LastEditTime: 2025-08-07 22:03:05
* @Description: Configuration manager.
*/
#ifndef CONFIG_H
@@ -44,6 +44,8 @@ class Config : public QObject {
[[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]] bool isSortReverse() const { return m_configItems.sortReverse; }
@@ -61,13 +63,14 @@ class Config : public QObject {
QStringList wallpaperDirs;
QStringList wallpaperExcludes;
QString actionsConfirm;
double styleAspectRatio = 1.6;
int styleImageWidth = 320;
int styleImageFocusWidth = 480;
int styleWindowWidth = 720;
int styleWindowHeight = 500;
SortType sortType = SortType::None;
bool sortReverse = false;
double styleAspectRatio = 1.6;
int styleImageWidth = 320;
int styleImageFocusWidth = 480;
int styleWindowWidth = 720;
int styleWindowHeight = 500;
bool styleNoLoadingScreen = false;
SortType sortType = SortType::None;
bool sortReverse = false;
} m_configItems;
QStringList m_wallpapers;
+1 -2
View File
@@ -1,7 +1,7 @@
/*
* @Author: Uyanide pywang0608@foxmail.com
* @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.
*/
#include "images_carousel.h"
@@ -77,7 +77,6 @@ void ImagesCarousel::_onInitImagesLoaded() {
if (m_loadedImages.isEmpty()) {
return;
}
m_currentIndex = 0;
_focusCurrImage();
}
+1 -1
View File
@@ -1,7 +1,7 @@
/*
* @Author: Uyanide pywang0608@foxmail.com
* @Date: 2025-08-05 00:37:58
* @LastEditTime: 2025-08-07 21:25:43
* @LastEditTime: 2025-08-07 21:38:26
* @Description: Entry point.
*/
#include <qapplication.h>
+4 -1
View File
@@ -1,7 +1,7 @@
/*
* @Author: Uyanide pywang0608@foxmail.com
* @Date: 2025-08-05 00:37:58
* @LastEditTime: 2025-08-07 01:08:55
* @LastEditTime: 2025-08-07 22:03:58
* @Description: MainWindow implementation.
*/
#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) {
if (m_config.isStyleNoLoadingScreen()) {
return;
}
m_loadingIndicator->setMaximum(amount);
ui->stackedWidget->setCurrentIndex(m_loadingIndicatorIndex);
}