Skip to content

Commit 027dfa8

Browse files
committed
Merge branch 'sucksome-master'
2 parents 1cdef5d + 4eecde7 commit 027dfa8

6 files changed

+412
-417
lines changed

qt/DrawerTools.qml

+48-50
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
/* Drawer ToolBar Custom QML Type.
23
34
Copyright (C) 2023 Saksham Attri.
@@ -20,7 +21,7 @@ import QtQuick.Controls 2.5
2021
import QtQuick.Layouts 1.3
2122
import QtQuick.Dialogs
2223

23-
ToolBar{
24+
ToolBar {
2425

2526
anchors.fill: parent
2627

@@ -30,89 +31,88 @@ ToolBar{
3031
button: darkMode ? "#5C469C" : "white"
3132
}
3233

33-
ColumnLayout{
34+
ColumnLayout {
3435

35-
ToolButton{
36+
ToolButton {
3637
text: qsTr("New")
3738
icon.source: "assets/new.png"
3839

3940
onClicked: {
4041
if (Qt.platform.os === "wasm")
41-
Qt.openUrlExternally("https://matek.hu/zoltan/aris/");
42+
Qt.openUrlExternally("https://matek.hu/zoltan/aris/")
4243
else
43-
auxConnector.newWindow();
44+
auxConnector.newWindow()
4445
}
4546
}
4647

47-
ToolButton{
48+
ToolButton {
4849
text: qsTr("Open")
4950
icon.source: "assets/folder.png"
5051

5152
onClicked: {
52-
cConnector.evalText = "Evaluate Proof";
53+
cConnector.evalText = "Evaluate Proof"
5354

54-
if (Qt.platform.os === "wasm"){
55-
isExtFile = true;
56-
cConnector.wasmOpenProof(theData,theGoals);
57-
}
58-
else
59-
fileDialogID.open();
55+
if (Qt.platform.os === "wasm") {
56+
isExtFile = true
57+
cConnector.wasmOpenProof(theData, theGoals)
58+
computePremise = true
59+
} else
60+
fileDialogID.open()
6061

61-
menuOptions.close();
62+
menuOptions.close()
6263
}
6364
}
6465

65-
ToolButton{
66+
ToolButton {
6667
text: qsTr("Save")
6768
icon.source: "assets/save.png"
6869
visible: !(Qt.platform.os === "wasm")
6970

7071
onClicked: {
7172

7273
if (fileExists)
73-
cConnector.saveProof(filename,theData,theGoals);
74+
cConnector.saveProof(filename, theData, theGoals)
7475
else
75-
saveAsID.open();
76+
saveAsID.open()
7677

77-
menuOptions.close();
78+
menuOptions.close()
7879
}
79-
8080
}
8181

82-
ToolButton{
82+
ToolButton {
8383
text: qsTr("Save As")
8484
icon.source: "assets/saveas.png"
8585

8686
onClicked: {
8787

8888
if (Qt.platform.os === "wasm")
89-
cConnector.wasmSaveProof(theData,theGoals);
89+
cConnector.wasmSaveProof(theData, theGoals)
9090
else
91-
saveAsID.open();
91+
saveAsID.open()
9292

93-
menuOptions.close();
93+
menuOptions.close()
9494
}
9595
}
9696

97-
ToolButton{
97+
ToolButton {
9898
text: qsTr("Export To LaTeX")
9999
icon.source: "assets/export.png"
100100

101101
onClicked: {
102102
if (Qt.platform.os === "wasm")
103-
auxConnector.wasmLatex(theData,cConnector);
103+
auxConnector.wasmLatex(theData, cConnector)
104104
else
105105
latexID.open()
106106

107107
menuOptions.close()
108108
}
109109
}
110110

111-
ToolSeparator{
111+
ToolSeparator {
112112
orientation: Qt.Horizontal
113113
}
114114

115-
ToolButton{
115+
ToolButton {
116116
text: qsTr("Toggle Goals")
117117
icon.source: "assets/goal.png"
118118

@@ -122,63 +122,61 @@ ToolBar{
122122
}
123123
}
124124

125-
ToolButton{
125+
ToolButton {
126126
text: qsTr("Toggle Dark Mode")
127127
icon.source: "assets/boolean.png"
128128

129-
onClicked: darkMode = !darkMode;
130-
129+
onClicked: darkMode = !darkMode
131130
}
132131

133-
ToolButton{
132+
ToolButton {
134133
text: qsTr("Import Proof")
135134
icon.source: "assets/import.png"
136135

137136
onClicked: {
138-
cConnector.evalText = "Evaluate Proof";
139-
if (Qt.platform.os === "wasm"){
140-
isExtFile = true;
141-
auxConnector.wasmImportProof(theData,cConnector,proofModel)
142-
}
143-
else
137+
cConnector.evalText = "Evaluate Proof"
138+
if (Qt.platform.os === "wasm") {
139+
isExtFile = true
140+
auxConnector.wasmImportProof(theData, cConnector,
141+
proofModel)
142+
computePremise = true
143+
} else {
144144
importID.open()
145+
}
145146

146-
menuOptions.close();
147+
menuOptions.close()
147148
}
148149
}
149150

150-
ToolSeparator{
151+
ToolSeparator {
151152
orientation: Qt.Horizontal
152153
}
153154

154-
ToolButton{
155+
ToolButton {
155156
text: qsTr("Font")
156157
icon.source: "assets/font.png"
157158
visible: !(Qt.platform.os === "wasm")
158159

159160
onClicked: fontDialogID.open()
160-
161161
}
162162

163-
ToolSeparator{
163+
ToolSeparator {
164164
visible: !(Qt.platform.os === "wasm")
165165
orientation: Qt.Horizontal
166166
}
167167

168-
ToolButton{
168+
ToolButton {
169169
text: qsTr("Help")
170170
icon.source: "assets/help.png"
171-
onClicked: Qt.openUrlExternally("https://www.gnu.org/software/aris/manual/aris.pdf")
172-
171+
onClicked: Qt.openUrlExternally(
172+
"https://www.gnu.org/software/aris/manual/aris.pdf")
173173
}
174174

175-
ToolButton{
175+
ToolButton {
176176
text: qsTr("About")
177177
icon.source: "assets/about.png"
178-
onClicked: Qt.openUrlExternally("https://www.gnu.org/software/aris/")
179-
178+
onClicked: Qt.openUrlExternally(
179+
"https://www.gnu.org/software/aris/")
180180
}
181-
182181
}
183-
184182
}

qt/GoalLine.qml

+40-50
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
/* Goal Line Custom QML Type.
23
34
Copyright (C) 2023 Saksham Attri.
@@ -20,16 +21,18 @@ import QtQuick.Layouts 1.3
2021
import QtQuick.Controls 2.5
2122
import goal.model 1.0
2223

24+
RowLayout {
2325

24-
RowLayout{
25-
26-
property string toolTipText: (resNumID.color === Qt.color("green"))? "Goal was met at line " + line : ((resNumID.color === Qt.color("blue")) ? "Goal was met at line "+ line+"\n\t but the proof has errors": ((resNumID.color === Qt.color("red"))?"Goal was not met": "Not yet evaluated")) //aaaaaaaaaaaaaaaaaaaaaaaaaaa
26+
property string toolTipText: (resNumID.color === Qt.color(
27+
"green")) ? "Goal was met at line "
28+
+ line : ((resNumID.color === Qt.color(
29+
"blue")) ? "Goal was met at line " + line + "\n\t but the proof has errors" : ((resNumID.color === Qt.color("red")) ? "Goal was not met" : "Not yet evaluated")) //aaaaaaaaaaaaaaaaaaaaaaaaaaa
2730

2831
spacing: 10
29-
width: (parent)? parent.width: 0
32+
width: (parent) ? parent.width : 0
3033
Layout.fillWidth: true
3134

32-
Label{
35+
Label {
3336
id: goalLineNumID
3437

3538
height: goalTextID
@@ -38,32 +41,30 @@ RowLayout{
3841
ToolTip.visible: toolTipText ? moID.containsMouse : false
3942
ToolTip.text: toolTipText
4043

41-
MouseArea{
44+
MouseArea {
4245
id: moID
4346
anchors.fill: parent
4447
hoverEnabled: true
45-
onClicked: console.log(line);
48+
onClicked: console.log(line)
4649
}
4750

48-
Text{
51+
Text {
4952
id: resNumID
5053
anchors.centerIn: parent
5154
font.italic: true
52-
text: (line > 0) ? line: ((line === -3)? "X" : "?")
53-
color: (text === "?")? (darkMode?"yellow":"brown"): ((text === "X") ? "red": ((model.valid)? "green": "blue"))
54-
55+
text: (line > 0) ? line : ((line === -3) ? "X" : "?")
56+
color: (text === "?") ? (darkMode ? "yellow" : "brown") : ((text === "X") ? "red" : ((model.valid) ? "green" : "blue"))
5557
}
56-
5758
}
5859

59-
TextField{
60+
TextField {
6061
id: goalTextID
6162

6263
height: font.pointSize + 10
6364
width: 200
6465
Layout.fillWidth: true
65-
background: Rectangle{
66-
color: darkMode?"#332940":"lightgrey"
66+
background: Rectangle {
67+
color: darkMode ? "#332940" : "lightgrey"
6768
}
6869

6970
text: model.text
@@ -73,70 +74,59 @@ RowLayout{
7374
// Implementing Keyboard Macros
7475
onTextChanged: {
7576

76-
if (goalTextID.length >= 2){
77-
const last_two = text.slice(cursorPosition-2,cursorPosition)
78-
if (last_two.includes('/\\')){
79-
goalTextID.remove(cursorPosition-2, cursorPosition)
80-
goalTextID.insert(cursorPosition,"\u2227")
81-
}
82-
else if (last_two.includes('\\/')){
83-
goalTextID.remove(cursorPosition-2, cursorPosition)
84-
goalTextID.insert(cursorPosition,"\u2228")
85-
}
86-
else if (last_two.includes('->')){
87-
goalTextID.remove(cursorPosition-2, cursorPosition)
88-
goalTextID.insert(cursorPosition,"\u2192")
89-
}
90-
else if (last_two.includes('<'+"\u2192")){
91-
goalTextID.remove(cursorPosition-2, cursorPosition)
92-
goalTextID.insert(cursorPosition,"\u2194")
77+
if (goalTextID.length >= 2) {
78+
const last_two = text.slice(cursorPosition - 2, cursorPosition)
79+
if (last_two.includes('/\\')) {
80+
goalTextID.remove(cursorPosition - 2, cursorPosition)
81+
goalTextID.insert(cursorPosition, "\u2227")
82+
} else if (last_two.includes('\\/')) {
83+
goalTextID.remove(cursorPosition - 2, cursorPosition)
84+
goalTextID.insert(cursorPosition, "\u2228")
85+
} else if (last_two.includes('->')) {
86+
goalTextID.remove(cursorPosition - 2, cursorPosition)
87+
goalTextID.insert(cursorPosition, "\u2192")
88+
} else if (last_two.includes('<' + "\u2192")) {
89+
goalTextID.remove(cursorPosition - 2, cursorPosition)
90+
goalTextID.insert(cursorPosition, "\u2194")
9391
}
94-
9592
}
96-
9793
}
9894

9995
onEditingFinished: model.text = text
100-
10196
}
10297

103-
Button{
98+
Button {
10499
id: goalPlusID
105100

106101
height: goalTextID.height
107102

108103
onClicked: goalOptionsID.open()
109104

110-
Text{
105+
Text {
111106
anchors.centerIn: parent
112107
text: "+ / \u2013"
113-
color: darkMode? "white": "black"
108+
color: darkMode ? "white" : "black"
114109
}
115110

116-
Menu{
111+
Menu {
117112
id: goalOptionsID
118113

119-
Action{
114+
Action {
120115
text: "Add Goal"
121116
onTriggered: {
122-
theGoals.insertgLine(index + 1,-2,false,"");
117+
theGoals.insertgLine(index + 1, -2, false, "")
123118
}
124119
}
125120

126-
Action{
121+
Action {
127122
text: "Remove Goal"
128123
onTriggered: {
129-
if (goalDataID.rowCount() > 1){
130-
theGoals.removegLineAt(index);
131-
}
132-
else
124+
if (goalDataID.rowCount() > 1) {
125+
theGoals.removegLineAt(index)
126+
} else
133127
console.log("Invalid Operation: Cannot remove all Lines")
134128
}
135129
}
136-
137-
138130
}
139-
140131
}
141132
}
142-

0 commit comments

Comments
 (0)