mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-05 11:13:18 +00:00
Switch from Qt6 to Slint
This commit is contained in:
parent
f8be14bcf8
commit
63bf267a22
107 changed files with 27532 additions and 2896 deletions
41
src/UiState.h
Normal file
41
src/UiState.h
Normal file
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* Mirai. Copyright (C) 2024 Vyn
|
||||
* This file is licensed under version 3 of the GNU General Public License (GPL-3.0-only)
|
||||
* The license can be found in the LICENSE file or at https://www.gnu.org/licenses/gpl-3.0.txt
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "appwindow.h"
|
||||
#include "mirai-core/Mirai.h"
|
||||
#include "mirai-core/TasksView.h"
|
||||
#include "slint.h"
|
||||
|
||||
class UiState
|
||||
{
|
||||
|
||||
public:
|
||||
UiState(mirai::Mirai *mirai);
|
||||
|
||||
void run();
|
||||
|
||||
void reloadResources();
|
||||
void reloadTags();
|
||||
void reloadTasks();
|
||||
|
||||
private:
|
||||
void setupCallbacks();
|
||||
void setupEventWindowCallbacks();
|
||||
void setupUtilsCallbacks();
|
||||
|
||||
std::shared_ptr<slint::VectorModel<slint::SharedString>> resources_;
|
||||
std::shared_ptr<slint::VectorModel<slint::SharedString>> tags_;
|
||||
std::shared_ptr<slint::VectorModel<Day>> days_;
|
||||
|
||||
slint::ComponentHandle<AppWindow> mainWindow_ = AppWindow::create();
|
||||
slint::ComponentHandle<TaskEdit> taskEditWindow_ = TaskEdit::create();
|
||||
slint::ComponentHandle<EventWindow> eventWindow_ = EventWindow::create();
|
||||
|
||||
mirai::Mirai *miraiInstance_;
|
||||
mirai::TasksView view_;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue