feat: sorting
This commit is contained in:
+16
-3
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: Uyanide pywang0608@foxmail.com
|
||||
* @Date: 2025-08-05 01:34:52
|
||||
* @LastEditTime: 2025-08-05 20:12:47
|
||||
* @LastEditTime: 2025-08-06 00:23:45
|
||||
* @Description: Configuration manager.
|
||||
*/
|
||||
#ifndef CONFIG_H
|
||||
@@ -15,6 +15,13 @@ class Config : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum class SortType : int {
|
||||
None = 0,
|
||||
Name,
|
||||
Date,
|
||||
Size,
|
||||
};
|
||||
|
||||
Config(const QString& configDir, const QStringList& searchDirs = {}, QObject* parent = nullptr);
|
||||
|
||||
~Config();
|
||||
@@ -37,6 +44,10 @@ class Config : public QObject {
|
||||
|
||||
[[nodiscard]] int getStyleWindowHeight() const { return m_configItems.styleWindowHeight; }
|
||||
|
||||
[[nodiscard]] SortType getSortType() const { return m_configItems.sortType; }
|
||||
|
||||
[[nodiscard]] bool isSortReverse() const { return m_configItems.sortReverse; }
|
||||
|
||||
static const QString s_DefaultConfigFileName;
|
||||
|
||||
private:
|
||||
@@ -53,8 +64,10 @@ class Config : public QObject {
|
||||
double styleAspectRatio = 1.6;
|
||||
int styleImageWidth = 320;
|
||||
int styleImageFocusWidth = 480;
|
||||
int styleWindowWidth = 800;
|
||||
int styleWindowHeight = 600;
|
||||
int styleWindowWidth = 720;
|
||||
int styleWindowHeight = 500;
|
||||
SortType sortType = SortType::None;
|
||||
bool sortReverse = false;
|
||||
} m_configItems;
|
||||
|
||||
QStringList m_wallpapers;
|
||||
|
||||
Reference in New Issue
Block a user