Skip to content

Commit

Permalink
Merge branch 'sucksome-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
kovzol committed Nov 11, 2023
2 parents 1cdef5d + 4eecde7 commit 027dfa8
Show file tree
Hide file tree
Showing 6 changed files with 412 additions and 417 deletions.
98 changes: 48 additions & 50 deletions qt/DrawerTools.qml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

/* Drawer ToolBar Custom QML Type.
Copyright (C) 2023 Saksham Attri.
Expand All @@ -20,7 +21,7 @@ import QtQuick.Controls 2.5
import QtQuick.Layouts 1.3
import QtQuick.Dialogs

ToolBar{
ToolBar {

anchors.fill: parent

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

ColumnLayout{
ColumnLayout {

ToolButton{
ToolButton {
text: qsTr("New")
icon.source: "assets/new.png"

onClicked: {
if (Qt.platform.os === "wasm")
Qt.openUrlExternally("https://matek.hu/zoltan/aris/");
Qt.openUrlExternally("https://matek.hu/zoltan/aris/")
else
auxConnector.newWindow();
auxConnector.newWindow()
}
}

ToolButton{
ToolButton {
text: qsTr("Open")
icon.source: "assets/folder.png"

onClicked: {
cConnector.evalText = "Evaluate Proof";
cConnector.evalText = "Evaluate Proof"

if (Qt.platform.os === "wasm"){
isExtFile = true;
cConnector.wasmOpenProof(theData,theGoals);
}
else
fileDialogID.open();
if (Qt.platform.os === "wasm") {
isExtFile = true
cConnector.wasmOpenProof(theData, theGoals)
computePremise = true
} else
fileDialogID.open()

menuOptions.close();
menuOptions.close()
}
}

ToolButton{
ToolButton {
text: qsTr("Save")
icon.source: "assets/save.png"
visible: !(Qt.platform.os === "wasm")

onClicked: {

if (fileExists)
cConnector.saveProof(filename,theData,theGoals);
cConnector.saveProof(filename, theData, theGoals)
else
saveAsID.open();
saveAsID.open()

menuOptions.close();
menuOptions.close()
}

}

ToolButton{
ToolButton {
text: qsTr("Save As")
icon.source: "assets/saveas.png"

onClicked: {

if (Qt.platform.os === "wasm")
cConnector.wasmSaveProof(theData,theGoals);
cConnector.wasmSaveProof(theData, theGoals)
else
saveAsID.open();
saveAsID.open()

menuOptions.close();
menuOptions.close()
}
}

ToolButton{
ToolButton {
text: qsTr("Export To LaTeX")
icon.source: "assets/export.png"

onClicked: {
if (Qt.platform.os === "wasm")
auxConnector.wasmLatex(theData,cConnector);
auxConnector.wasmLatex(theData, cConnector)
else
latexID.open()

menuOptions.close()
}
}

ToolSeparator{
ToolSeparator {
orientation: Qt.Horizontal
}

ToolButton{
ToolButton {
text: qsTr("Toggle Goals")
icon.source: "assets/goal.png"

Expand All @@ -122,63 +122,61 @@ ToolBar{
}
}

ToolButton{
ToolButton {
text: qsTr("Toggle Dark Mode")
icon.source: "assets/boolean.png"

onClicked: darkMode = !darkMode;

onClicked: darkMode = !darkMode
}

ToolButton{
ToolButton {
text: qsTr("Import Proof")
icon.source: "assets/import.png"

onClicked: {
cConnector.evalText = "Evaluate Proof";
if (Qt.platform.os === "wasm"){
isExtFile = true;
auxConnector.wasmImportProof(theData,cConnector,proofModel)
}
else
cConnector.evalText = "Evaluate Proof"
if (Qt.platform.os === "wasm") {
isExtFile = true
auxConnector.wasmImportProof(theData, cConnector,
proofModel)
computePremise = true
} else {
importID.open()
}

menuOptions.close();
menuOptions.close()
}
}

ToolSeparator{
ToolSeparator {
orientation: Qt.Horizontal
}

ToolButton{
ToolButton {
text: qsTr("Font")
icon.source: "assets/font.png"
visible: !(Qt.platform.os === "wasm")

onClicked: fontDialogID.open()

}

ToolSeparator{
ToolSeparator {
visible: !(Qt.platform.os === "wasm")
orientation: Qt.Horizontal
}

ToolButton{
ToolButton {
text: qsTr("Help")
icon.source: "assets/help.png"
onClicked: Qt.openUrlExternally("https://www.gnu.org/software/aris/manual/aris.pdf")

onClicked: Qt.openUrlExternally(
"https://www.gnu.org/software/aris/manual/aris.pdf")
}

ToolButton{
ToolButton {
text: qsTr("About")
icon.source: "assets/about.png"
onClicked: Qt.openUrlExternally("https://www.gnu.org/software/aris/")

onClicked: Qt.openUrlExternally(
"https://www.gnu.org/software/aris/")
}

}

}
90 changes: 40 additions & 50 deletions qt/GoalLine.qml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

/* Goal Line Custom QML Type.
Copyright (C) 2023 Saksham Attri.
Expand All @@ -20,16 +21,18 @@ import QtQuick.Layouts 1.3
import QtQuick.Controls 2.5
import goal.model 1.0

RowLayout {

RowLayout{

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
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

spacing: 10
width: (parent)? parent.width: 0
width: (parent) ? parent.width : 0
Layout.fillWidth: true

Label{
Label {
id: goalLineNumID

height: goalTextID
Expand All @@ -38,32 +41,30 @@ RowLayout{
ToolTip.visible: toolTipText ? moID.containsMouse : false
ToolTip.text: toolTipText

MouseArea{
MouseArea {
id: moID
anchors.fill: parent
hoverEnabled: true
onClicked: console.log(line);
onClicked: console.log(line)
}

Text{
Text {
id: resNumID
anchors.centerIn: parent
font.italic: true
text: (line > 0) ? line: ((line === -3)? "X" : "?")
color: (text === "?")? (darkMode?"yellow":"brown"): ((text === "X") ? "red": ((model.valid)? "green": "blue"))

text: (line > 0) ? line : ((line === -3) ? "X" : "?")
color: (text === "?") ? (darkMode ? "yellow" : "brown") : ((text === "X") ? "red" : ((model.valid) ? "green" : "blue"))
}

}

TextField{
TextField {
id: goalTextID

height: font.pointSize + 10
width: 200
Layout.fillWidth: true
background: Rectangle{
color: darkMode?"#332940":"lightgrey"
background: Rectangle {
color: darkMode ? "#332940" : "lightgrey"
}

text: model.text
Expand All @@ -73,70 +74,59 @@ RowLayout{
// Implementing Keyboard Macros
onTextChanged: {

if (goalTextID.length >= 2){
const last_two = text.slice(cursorPosition-2,cursorPosition)
if (last_two.includes('/\\')){
goalTextID.remove(cursorPosition-2, cursorPosition)
goalTextID.insert(cursorPosition,"\u2227")
}
else if (last_two.includes('\\/')){
goalTextID.remove(cursorPosition-2, cursorPosition)
goalTextID.insert(cursorPosition,"\u2228")
}
else if (last_two.includes('->')){
goalTextID.remove(cursorPosition-2, cursorPosition)
goalTextID.insert(cursorPosition,"\u2192")
}
else if (last_two.includes('<'+"\u2192")){
goalTextID.remove(cursorPosition-2, cursorPosition)
goalTextID.insert(cursorPosition,"\u2194")
if (goalTextID.length >= 2) {
const last_two = text.slice(cursorPosition - 2, cursorPosition)
if (last_two.includes('/\\')) {
goalTextID.remove(cursorPosition - 2, cursorPosition)
goalTextID.insert(cursorPosition, "\u2227")
} else if (last_two.includes('\\/')) {
goalTextID.remove(cursorPosition - 2, cursorPosition)
goalTextID.insert(cursorPosition, "\u2228")
} else if (last_two.includes('->')) {
goalTextID.remove(cursorPosition - 2, cursorPosition)
goalTextID.insert(cursorPosition, "\u2192")
} else if (last_two.includes('<' + "\u2192")) {
goalTextID.remove(cursorPosition - 2, cursorPosition)
goalTextID.insert(cursorPosition, "\u2194")
}

}

}

onEditingFinished: model.text = text

}

Button{
Button {
id: goalPlusID

height: goalTextID.height

onClicked: goalOptionsID.open()

Text{
Text {
anchors.centerIn: parent
text: "+ / \u2013"
color: darkMode? "white": "black"
color: darkMode ? "white" : "black"
}

Menu{
Menu {
id: goalOptionsID

Action{
Action {
text: "Add Goal"
onTriggered: {
theGoals.insertgLine(index + 1,-2,false,"");
theGoals.insertgLine(index + 1, -2, false, "")
}
}

Action{
Action {
text: "Remove Goal"
onTriggered: {
if (goalDataID.rowCount() > 1){
theGoals.removegLineAt(index);
}
else
if (goalDataID.rowCount() > 1) {
theGoals.removegLineAt(index)
} else
console.log("Invalid Operation: Cannot remove all Lines")
}
}


}

}
}

Loading

0 comments on commit 027dfa8

Please sign in to comment.