forked from quickshell/quickshell
refactor(wayland): seperate cmake files for modularity
This commit is contained in:
parent
5bbd0333ef
commit
c6dde9ca9d
28 changed files with 32 additions and 33 deletions
37
src/core/shell.hpp
Normal file
37
src/core/shell.hpp
Normal file
|
@ -0,0 +1,37 @@
|
|||
#pragma once
|
||||
|
||||
#include <qcontainerfwd.h>
|
||||
#include <qlist.h>
|
||||
#include <qqmlengine.h>
|
||||
#include <qtmetamacros.h>
|
||||
|
||||
#include "reload.hpp"
|
||||
|
||||
class ShellConfig {
|
||||
Q_GADGET;
|
||||
Q_PROPERTY(bool watchFiles MEMBER mWatchFiles);
|
||||
|
||||
public:
|
||||
bool mWatchFiles = true;
|
||||
};
|
||||
|
||||
///! Root config element
|
||||
class ShellRoot: public ReloadPropagator {
|
||||
Q_OBJECT;
|
||||
/// If `config.watchFiles` is true the configuration will be reloaded whenever it changes.
|
||||
/// Defaults to true.
|
||||
Q_PROPERTY(ShellConfig config READ config WRITE setConfig);
|
||||
QML_ELEMENT;
|
||||
|
||||
public:
|
||||
explicit ShellRoot(QObject* parent = nullptr): ReloadPropagator(parent) {}
|
||||
|
||||
void setConfig(ShellConfig config);
|
||||
[[nodiscard]] ShellConfig config() const;
|
||||
|
||||
signals:
|
||||
void configChanged();
|
||||
|
||||
private:
|
||||
ShellConfig mConfig;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue