Skip to content

Commit 3416671

Browse files
committed
feat(gui): add Overview scheduler
1 parent 95d5bb5 commit 3416671

File tree

17 files changed

+35501
-246
lines changed

17 files changed

+35501
-246
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414

1515
ui库目前还没完善,先做device
1616

17-
![image-20230517184432630](https://runhey-img-stg1.oss-cn-chengdu.aliyuncs.com/img2/202305171844003.png)
17+
![image-20230526205041711](https://runhey-img-stg1.oss-cn-chengdu.aliyuncs.com/img2/202305262050939.png)

module/gui/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
where python
77
cd module/gui
88
pyside6-rcc -o qml_rcc.py qml.qrc
9-
pyside6-rcc -o rec_rcc.py res.qrc
9+
pyside6-rcc -o res_rcc.py res.qrc
1010
```
1111

1212
即可生成rcc文件。当然当你每修改一次qrc指向的资源文件时候就需要运行一次

module/gui/qml.qrc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
<file>qml/Component/FItemDelegate.qml</file>
1818
<file>qml/Page/ScriptView.qml</file>
1919
<file>qml/Component/ScriptItem.qml</file>
20-
<file>qml/Component/OverView.qml</file>
20+
<file>qml/Component/Overview.qml</file>
21+
<file>qml/Page/Home.qml</file>
22+
<file>qml/Page/Update.qml</file>
23+
<file>qml/Component/Args.qml</file>
24+
<file>qml/Component/Taskmini.qml</file>
2125
</qresource>
2226
</RCC>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ import FluentUI
33

44
Item {
55
FluText{
6-
text: "i kdow this overview"
6+
text: 'this args '
77
}
88
}
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
import QtQuick
2+
import QtQuick.Layouts
3+
import FluentUI
4+
5+
Item {
6+
7+
8+
9+
Item{
10+
id: leftScheduler
11+
width: 260
12+
anchors{
13+
left: parent.left
14+
top: parent.top
15+
bottom: parent.bottom
16+
}
17+
FluArea{
18+
id: schedulerOpen
19+
anchors.top: parent.top
20+
width: parent.width
21+
height: 50
22+
RowLayout{
23+
anchors.fill: parent
24+
FluText{
25+
text: 'Scheduler'
26+
Layout.leftMargin: 16
27+
font: FluTextStyle.Subtitle
28+
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
29+
}
30+
FluToggleButton{
31+
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
32+
Layout.rightMargin: 16
33+
text:"Start"
34+
onClicked: {
35+
selected = !selected
36+
if(selected){
37+
text = "Start"
38+
}else{
39+
text = "Stop"
40+
}
41+
}
42+
}
43+
}
44+
}
45+
FluArea{
46+
id: schedulerRunning
47+
anchors.top: schedulerOpen.bottom
48+
anchors.topMargin: 10
49+
width: parent.width
50+
height: 120
51+
ColumnLayout{
52+
width: parent.width
53+
spacing: 8
54+
FluText{
55+
text: 'Running'
56+
Layout.leftMargin: 16
57+
Layout.topMargin: 6
58+
font: FluTextStyle.Subtitle
59+
}
60+
Rectangle{
61+
width: schedulerRunning.width - 20
62+
height: 2
63+
Layout.alignment: Qt.AlignHCenter
64+
color: FluTheme.dark ? Qt.rgba(64/255, 68/255, 75/255, 1) : Qt.rgba(234/255, 236/255, 239/255, 1)
65+
radius: 2
66+
}
67+
Taskmini{
68+
Layout.leftMargin: 16
69+
}
70+
}
71+
}
72+
FluArea{
73+
id: schedulerPending
74+
anchors.top: schedulerRunning.bottom
75+
anchors.topMargin: 10
76+
width: parent.width
77+
height: 240
78+
ColumnLayout{
79+
width: parent.width
80+
spacing: 8
81+
FluText{
82+
text: 'Pending'
83+
Layout.leftMargin: 16
84+
Layout.topMargin: 6
85+
font: FluTextStyle.Subtitle
86+
}
87+
Rectangle{
88+
width: schedulerRunning.width - 20
89+
height: 2
90+
Layout.alignment: Qt.AlignHCenter
91+
color: FluTheme.dark ? Qt.rgba(64/255, 68/255, 75/255, 1) : Qt.rgba(234/255, 236/255, 239/255, 1)
92+
radius: 2
93+
}
94+
Taskmini{
95+
Layout.leftMargin: 16
96+
}
97+
Taskmini{
98+
Layout.leftMargin: 16
99+
}
100+
Taskmini{
101+
Layout.leftMargin: 16
102+
}
103+
Taskmini{
104+
Layout.leftMargin: 16
105+
}
106+
}
107+
}
108+
FluArea{
109+
id: schedulerWaiting
110+
anchors.top: schedulerPending.bottom
111+
anchors.topMargin: 10
112+
anchors.bottom: parent.bottom
113+
anchors.bottomMargin: 0
114+
width: parent.width
115+
ColumnLayout{
116+
width: parent.width
117+
spacing: 8
118+
FluText{
119+
Layout.fillHeight: false
120+
text: 'Waiting'
121+
Layout.leftMargin: 16
122+
Layout.topMargin: 6
123+
font: FluTextStyle.Subtitle
124+
}
125+
Rectangle{
126+
Layout.fillHeight: false
127+
width: schedulerPending.width - 20
128+
height: 2
129+
Layout.alignment: Qt.AlignHCenter
130+
color: FluTheme.dark ? Qt.rgba(64/255, 68/255, 75/255, 1) : Qt.rgba(234/255, 236/255, 239/255, 1)
131+
radius: 2
132+
}
133+
Taskmini{
134+
Layout.leftMargin: 16
135+
Layout.fillHeight: false
136+
}
137+
}
138+
}
139+
}
140+
FluArea{
141+
anchors.left: leftScheduler.right
142+
anchors.leftMargin: 10
143+
height: parent.height
144+
anchors.right: parent.right
145+
}
146+
}

module/gui/qml/Component/SplitPanel.qml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import QtQuick
22
import QtQuick.Controls
33
import FluentUI
4+
import "../Global"
45

56
Item {
6-
signal clickMessage(string text)
7+
id: splitPanel
8+
property string title: ""
79

810
// 左边菜单
911
FluArea{
@@ -17,7 +19,8 @@ Item {
1719
selectionMode: FluTabView.SizeToContent
1820

1921
onItemClicked:(model)=>{
20-
clickMessage(model.text)
22+
MainEvent.menuTitle = model.text
23+
splitPanel.title = model.text
2124
showSuccess(model.text)
2225
}
2326
}
@@ -67,19 +70,6 @@ Item {
6770
}
6871
}
6972
menu_tree.updateData(datas)
70-
71-
// for(let items of data){
72-
// if(items.length === 'string'){
73-
// datas.push(menu_tree.createItem(items,false))
74-
// }else{
75-
// var da = []
76-
// for(let item of items){
77-
// da.push(menu_tree.createItem(item,false))
78-
// }
79-
// datas.push(menu_tree.createItem(items, true, da))
80-
// }
81-
82-
// }
8373
}
8474

8575
//右侧的分为两个部分一个部分是contentDefalut表示固定的不动的
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import QtQuick
2+
import QtQuick.Layouts
3+
import FluentUI
4+
// 这个组件是在总览那儿小小的显示
5+
// 任务的名称 + 时间 以及一个设置的入口
6+
7+
Item {
8+
width: 225
9+
height: 40
10+
FluText{
11+
id: taskName
12+
anchors{
13+
left: parent.left
14+
leftMargin: 0
15+
top: parent.top
16+
topMargin: 0
17+
}
18+
text: "taskName"
19+
font: FluTextStyle.BodyStrong
20+
}
21+
FluText{
22+
id: taskTime
23+
anchors{
24+
left: parent.left
25+
leftMargin: 0
26+
bottom: parent.bottom
27+
bottomMargin: 0
28+
}
29+
text: "2023-05-26 18:33:55"
30+
font: FluTextStyle.Caption
31+
}
32+
FluButton{
33+
id: settingButton
34+
anchors{
35+
right: parent.right
36+
rightMargin: 0
37+
verticalCenter: parent.verticalCenter
38+
}
39+
text:"setting"
40+
onClicked: {
41+
showSuccess("setting")
42+
}
43+
}
44+
}

module/gui/qml/Global/MainEvent.qml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ QtObject {
3939
"language": "zh-CN"}
4040
}
4141

42-
console.debug(displayMode, darkMode, primaryColor, nativeText, language)
4342
mainEvent.displayMode = set["displayMode"]
4443
mainEvent.darkMode = set["darkMode"]
4544
mainEvent.nativeText = set["nativeText"]
@@ -54,7 +53,6 @@ QtObject {
5453
else if(primary_color === "Blue"){mainEvent.primaryColor = FluColors.Blue}
5554
else if(primary_color === "Teal"){mainEvent.primaryColor = FluColors.Teal}
5655
else if(primary_color === "Green"){mainEvent.primaryColor = FluColors.Green}
57-
console.debug(displayMode, darkMode, primaryColor, nativeText, language)
5856
}
5957
onDisplayModeChanged: {
6058
if(mainEvent.settings === ""){

module/gui/qml/MainWindow.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import "./Component/"
1111
FluWindow {
1212
id:window
1313
title: "oas"
14-
width: 1000
14+
width: 1100
1515
height: 720
1616
closeDestory:false
1717
minimumWidth: 520

module/gui/qml/Page/Home.qml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import QtQuick
2+
import QtQuick.Layouts
3+
import FluentUI
4+
5+
FluScrollablePage{
6+
spacing: 6
7+
Image {
8+
id: name
9+
Layout.preferredHeight: 40
10+
Layout.preferredWidth: 40
11+
Layout.alignment: Qt.AlignHCenter
12+
source: "qrc:/res/icon.png"
13+
}
14+
FluText{
15+
// Layout.fillWidth: true
16+
text: "OAS是一款致力于全自动化的阴阳师脚本"
17+
font: FluTextStyle.Title
18+
Layout.alignment: Qt.AlignHCenter
19+
}
20+
FluText{
21+
text: "https://github.com/runhey/OnmyojiAutoScript"
22+
font: FluTextStyle.Body
23+
Layout.alignment: Qt.AlignHCenter
24+
}
25+
26+
}

0 commit comments

Comments
 (0)