Skip to content

Commit 48a01ae

Browse files
Add Topbar and pysys support
1 parent c591e5f commit 48a01ae

File tree

1 file changed

+140
-58
lines changed
  • packs/ir.pyabr.baran/data/usr/share/layouts

1 file changed

+140
-58
lines changed

packs/ir.pyabr.baran/data/usr/share/layouts/enter.qml

+140-58
Original file line numberDiff line numberDiff line change
@@ -13,81 +13,163 @@ ApplicationWindow {
1313
visible: true
1414
color: "purple"
1515

16-
Text {
17-
objectName: "keyless"
18-
id: keyless
19-
visible: false
20-
text: ''
21-
}
16+
/* Topbar */
17+
Rectangle {
18+
color: "#A0FFFFFF"
19+
anchors.top: parent.top
20+
width: parent.width
21+
height: 30
22+
id: topbar
2223

23-
menuBar: MenuBar {
24+
Row {
25+
anchors.verticalCenter: parent.verticalCenter
26+
anchors.left: parent.left
27+
ToolButton {
28+
icon.source: 'file:///stor/usr/share/icons/breeze-shutdown.svg'
29+
icon.color: 'white'
30+
onClicked: {
31+
popup_pysys.open()
32+
}
33+
}
34+
}
2435

25-
Menu {
26-
title: "منوی اصلی"
27-
id: submenu
28-
objectName: "submenu"
36+
Text {
37+
id: leClock
38+
anchors.centerIn: parent
39+
objectName: "leClock"
2940
font.family: "IRANSans"
41+
font.pixelSize: 16
42+
color: "white"
43+
ToolButton {
44+
anchors.fill: parent
45+
objectName: "btnClock"
46+
id: btnClock
47+
}
48+
}
49+
}
3050

31-
Menu {
32-
title: "حساب کاربری"
33-
id: account
34-
objectName: "account"
35-
font.family: "IRANSans"
51+
/* Popup PySys */
52+
Popup {
53+
id: popup_pysys
54+
objectName: "popup_pysys"
55+
anchors.centerIn: parent
56+
width: 440
57+
height: 200
58+
modal: true
59+
focus: true
60+
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
3661

37-
Action {
38-
text: "خروج از نشست"
39-
id: logout
40-
objectName: "logout"
41-
}
62+
ToolButton {
63+
anchors.top: parent.top
64+
anchors.right: parent.right
65+
anchors.rightMargin: 1
66+
anchors.leftMargin: 1
67+
width: 25
68+
height: 25
69+
70+
Image {
71+
source: "file:///stor/usr/share/icons/breeze-close.svg"
72+
fillMode: Image.PreserveAspectFit
73+
sourceSize: Qt.size( parent.width, parent.height )
4274
}
4375

44-
Menu {
45-
title: "خروج"
46-
id: exit
47-
objectName: "exit"
48-
font.family: "IRANSans"
76+
onClicked: {
77+
popup_pysys.close()
78+
}
79+
}
4980

50-
Action {
51-
text: "خاموش کردن"
52-
id: shutdown
53-
objectName: "shutdown"
81+
ToolButton {
82+
anchors.left: parent.left
83+
anchors.verticalCenter: parent.verticalCenter
84+
width: 100
85+
height: parent.height/2
86+
id: shutdown
87+
objectName: "shutdown"
88+
Image {
89+
anchors.fill: parent
90+
id: shutdown_img
91+
objectName: "shutdown_img"
92+
fillMode: Image.PreserveAspectFit
93+
sourceSize: Qt.size( shutdown.width, shutdown.height )
5494
}
55-
Action {
56-
text: "راه اندازی مجدد"
57-
id: restart
58-
objectName: "restart"
95+
}
96+
Text {
97+
text: "Shutdown"
98+
objectName: "txtShutdown"
99+
anchors.top: shutdown.bottom
100+
anchors.bottom: parent.bottom
101+
anchors.horizontalCenter: shutdown.horizontalCenter
102+
font.family: "IRANSans"
103+
}
104+
ToolButton {
105+
anchors.left: shutdown.right
106+
anchors.verticalCenter: parent.verticalCenter
107+
width: 100
108+
height: parent.height/2
109+
id: logout
110+
objectName: "logout"
111+
Image {
112+
anchors.fill: parent
113+
id: logout_img
114+
objectName: "logout_img"
115+
fillMode: Image.PreserveAspectFit
116+
sourceSize: Qt.size( logout.width, logout.height )
59117
}
60-
Action {
61-
text: "حالت خواب"
62-
id: sleep
63-
objectName: "sleep"
118+
}
119+
Text {
120+
text: "Logout"
121+
objectName: "txtLogout"
122+
anchors.top: logout.bottom
123+
anchors.bottom: parent.bottom
124+
anchors.horizontalCenter: logout.horizontalCenter
125+
font.family: "IRANSans"
126+
}
127+
ToolButton {
128+
anchors.left: logout.right
129+
anchors.verticalCenter: parent.verticalCenter
130+
width: 100
131+
height: parent.height/2
132+
id: reboot
133+
objectName: "reboot"
134+
Image {
135+
anchors.fill: parent
136+
id: reboot_img
137+
objectName: "reboot_img"
138+
fillMode: Image.PreserveAspectFit
139+
sourceSize: Qt.size( reboot.width, reboot.height )
64140
}
65141
}
66-
Menu {
67-
title: "زبان ها"
68-
id: lang
142+
Text {
143+
text: "Restart"
144+
objectName: "txtReboot"
145+
anchors.top: reboot.bottom
146+
anchors.bottom: parent.bottom
147+
anchors.horizontalCenter: reboot.horizontalCenter
69148
font.family: "IRANSans"
70-
objectName: "lang"
71-
Repeater{
72-
model: Lang
73-
MenuItem {
74-
objectName: model.name
75-
text: model.label
76-
onTriggered: {
77-
keyless.text = model.name
78-
}
79-
font.family: "IRANSans"
80-
}
149+
}
150+
ToolButton {
151+
anchors.left: reboot.right
152+
anchors.verticalCenter: parent.verticalCenter
153+
width: 100
154+
height: parent.height/2
155+
id: suspend
156+
objectName: "suspend"
157+
Image {
158+
anchors.fill: parent
159+
id: suspend_img
160+
objectName: "suspend_img"
161+
fillMode: Image.PreserveAspectFit
162+
sourceSize: Qt.size( suspend.width, suspend.height )
81163
}
82164
}
83-
CheckBox {
84-
id: virtualkeyboard
85-
objectName: "virtualkeyboard"
86-
visible: false
87-
text: "کیبورد مجازی"
165+
Text {
166+
text: "Sleep"
167+
objectName: "txtSuspend"
168+
anchors.top: suspend.bottom
169+
anchors.bottom: parent.bottom
170+
anchors.horizontalCenter: suspend.horizontalCenter
88171
font.family: "IRANSans"
89172
}
90-
}
91173
}
92174

93175
background: Rectangle {

0 commit comments

Comments
 (0)