Skip to content

Commit

Permalink
Пофиксил масштабируемость окон и кнопку удаления результата игры
Browse files Browse the repository at this point in the history
main.py
⠀- Установил активность кнопки удаления одного результата только при наличии самих результатов.

ui.py
⠀- Установил окнам фиксированный размер.

Пересобрал exe с новыми изменениями.
  • Loading branch information
snowlue committed Jun 5, 2021
1 parent 39810fe commit 6c20aca
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
Binary file modified bin/VCRUNTIME140_1.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions bin/main.exe
Git LFS file not shown
2 changes: 2 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,8 @@ def refreshTable(self):
results = sorted(results, key=lambda x: int(str(x[2]).replace(' ', '')), reverse=True)
results = [list(map(str, i[1:])) for i in results]
self.results = [list(map(str, [i + 1, results[i][2]])) for i in range(len(results))]

self.deleteButton.setEnabled(bool(results))

self.spinBox.setMinimum(1)
self.spinBox.setMaximum(len(results))
Expand Down
22 changes: 11 additions & 11 deletions ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def startFadeOutImage(self):
class Ui_StartDialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(361, 186)
Dialog.setFixedSize(361, 186)
font = QtGui.QFont()
font.setFamily("PT Sans")
font.setPointSize(8)
Expand Down Expand Up @@ -109,7 +109,7 @@ def setupUi(self, MainWindow):
fontName = QFontDatabase.applicationFontFamilies(fontId)[0]

MainWindow.setObjectName("MainWindow")
MainWindow.resize(1100, 705)
MainWindow.setFixedSize(1100, 705)
font = QtGui.QFont()
font.setFamily("PT Sans")
MainWindow.setFont(font)
Expand Down Expand Up @@ -582,7 +582,7 @@ def retranslateUi(self, MainWindow):
class Ui_Win(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(400, 150)
Dialog.setFixedSize(400, 150)
font = QtGui.QFont()
font.setFamily("PT Sans")
Dialog.setFont(font)
Expand Down Expand Up @@ -625,7 +625,7 @@ def retranslateUi(self, Dialog):
class Ui_GameOver(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(400, 150)
Dialog.setFixedSize(400, 150)
font = QtGui.QFont()
font.setFamily("PT Sans")
Dialog.setFont(font)
Expand Down Expand Up @@ -668,7 +668,7 @@ def retranslateUi(self, Dialog):
class Ui_ConfirmExit(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(400, 140)
Dialog.setFixedSize(400, 140)
font = QtGui.QFont()
font.setFamily("PT Sans")
Dialog.setFont(font)
Expand Down Expand Up @@ -752,7 +752,7 @@ def retranslateUi(self, Dialog):
class Ui_WinLeave(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(400, 150)
Dialog.setFixedSize(400, 150)
font = QtGui.QFont()
font.setFamily("PT Sans")
Dialog.setFont(font)
Expand Down Expand Up @@ -788,7 +788,7 @@ def retranslateUi(self, Dialog):
_translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "Вы выиграли, но не всё!"))
self.label.setText(_translate("Dialog",
"Вы покинули эту игру! Правильный ответ на этот вопрос: {0}.\n"
"Вы покинули игру! Правильный ответ на этот вопрос: {0}.\n"
"Ваш выигрыш составил {1} руб.\n"
"Начать новую игру?"))

Expand Down Expand Up @@ -838,7 +838,7 @@ def retranslateUi(self, Dialog):
class Ui_ResultsTable(object):
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(395, 385)
Form.setFixedSize(395, 385)
font = QtGui.QFont()
font.setFamily("PT Sans")
Form.setFont(font)
Expand Down Expand Up @@ -869,7 +869,7 @@ def retranslateUi(self, Form):
class Ui_DeleteResult(object):
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(442, 385)
Form.setFixedSize(442, 385)
self.verticalLayout = QtWidgets.QVBoxLayout(Form)
self.verticalLayout.setContentsMargins(10, 10, 10, 10)
self.verticalLayout.setObjectName("verticalLayout")
Expand Down Expand Up @@ -918,7 +918,7 @@ def retranslateUi(self, Form):
class Ui_ConfirmClearAll(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(400, 140)
Dialog.setFixedSize(400, 140)
font = QtGui.QFont()
font.setFamily("PT Sans")
Dialog.setFont(font)
Expand Down Expand Up @@ -960,7 +960,7 @@ def retranslateUi(self, Dialog):
class Ui_About(object):
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(380, 308)
Form.setFixedSize(380, 308)
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(Form)
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.verticalLayout = QtWidgets.QVBoxLayout()
Expand Down

0 comments on commit 6c20aca

Please sign in to comment.