Skip to content

Commit

Permalink
fix easy problem error and adjust spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
kv9898 committed Sep 23, 2024
1 parent d96dc14 commit 8b52dde
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions GUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,14 @@ def __init__(self):
self.result.setMargin(10)

hlayout = QHBoxLayout()
hlayout.addStretch()
#hlayout.addStretch()
hlayout.addSpacing(100)
vlayout = QVBoxLayout()
vlayout.addWidget(self.line_edit)
vlayout.addWidget(self.result)
hlayout.addLayout(vlayout)
hlayout.addStretch()
#hlayout.addStretch()
hlayout.addSpacing(100)

self.layout.addLayout(hlayout)

Expand All @@ -253,7 +255,8 @@ def keyPressEvent(self, event):
if '=' in self.line_edit.text() and not self.line_edit.text().endswith("="):
self.result.setText(compute(self.line_edit.text()))
elif self.line_edit.text()=='':
self.result.setText(get_outcome())
formula = input_sequence + '+x=' + output_sequence
self.result.setText(compute(formula))
else:
if self.line_edit.text().endswith("="):
formula = input_sequence + '+' + self.line_edit.text() + output_sequence
Expand Down

0 comments on commit 8b52dde

Please sign in to comment.