Skip to content

Commit 02f93e3

Browse files
committed
refactor:删除设置中的透明度
1 parent 46fc456 commit 02f93e3

File tree

6 files changed

+2
-207
lines changed

6 files changed

+2
-207
lines changed

src/gameSettings.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ def __init__(self, mainWindow):
1616
# config = configparser.ConfigParser()
1717
# config.read(self.game_setting_path, encoding='utf-8')
1818
self.gameMode = mainWindow.gameMode
19-
self.transparency = self.game_setting.value('DEFAULT/transparency', None, int)
20-
# self.transparency = config.getint('DEFAULT','transparency')
2119
self.pixSize = mainWindow.pixSize
2220
self.row = mainWindow.row
2321
self.column = mainWindow.column
@@ -101,8 +99,6 @@ def setParameter(self):
10199
self.comboBox_country.setCurrentText(self.country)
102100
self.checkBox_end_then_flag.setChecked(self.end_then_flag)
103101
self.checkBox_cursor_limit.setChecked(self.cursor_limit)
104-
self.horizontalSlider_transparency.setValue (self.transparency)
105-
self.label_transparency_percent_value.setText(str(self.transparency))
106102

107103
if not self.checkBox_auto_replay.isChecked():
108104
self.spinBox_auto_replay.setEnabled(False)
@@ -122,7 +118,6 @@ def processParameter(self):
122118
#只有点确定才能进来
123119

124120
self.alter = True
125-
self.transparency = self.horizontalSlider_transparency.value()
126121
self.pixSize = self.spinBox_pixsize.value()
127122
v = self.spinBox_auto_replay.value()
128123
self.auto_replay = v if self.checkBox_auto_replay.isChecked() else -v
@@ -142,7 +137,6 @@ def processParameter(self):
142137
# 标准、win7、经典无猜、强无猜、弱无猜、准无猜、强可猜、弱可猜
143138

144139

145-
self.game_setting.set_value("DEFAULT/transparency", self.transparency)
146140
self.game_setting.set_value("DEFAULT/auto_replay", self.auto_replay)
147141
self.game_setting.set_value("DEFAULT/end_then_flag", self.end_then_flag)
148142
self.game_setting.set_value("DEFAULT/cursor_limit", self.cursor_limit)

src/mineSweeperGUI.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,11 +1212,6 @@ def action_NEvent(self):
12121212
self.predefinedBoardPara[0]['board_constraint'] = self.board_constraint
12131213
self.predefinedBoardPara[0]['gamemode'] = ui.gameMode
12141214

1215-
self.mainWindow.setWindowOpacity(ui.transparency / 100)
1216-
for child in self.mainWindow.findChildren(QWidget):
1217-
# 设置子窗口的透明度
1218-
child.setWindowOpacity(ui.transparency / 100)
1219-
12201215
self.score_board_manager.with_namespace({
12211216
"race_identifier": ui.race_identifier,
12221217
"mode": self.gameMode,

src/ui/ui_gameSettings.py

Lines changed: 1 addition & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Ui_Form(object):
1515
def setupUi(self, Form):
1616
Form.setObjectName("Form")
1717
Form.setWindowModality(QtCore.Qt.NonModal)
18-
Form.resize(554, 638)
18+
Form.resize(554, 605)
1919
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred)
2020
sizePolicy.setHorizontalStretch(0)
2121
sizePolicy.setVerticalStretch(0)
@@ -561,57 +561,6 @@ def setupUi(self, Form):
561561
spacerItem2 = QtWidgets.QSpacerItem(0, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
562562
self.horizontalLayout_8.addItem(spacerItem2)
563563
self.verticalLayout_2.addWidget(self.widget_6)
564-
self.horizontalWidget_transparency = QtWidgets.QWidget(self.widget_2)
565-
self.horizontalWidget_transparency.setObjectName("horizontalWidget_transparency")
566-
self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.horizontalWidget_transparency)
567-
self.horizontalLayout_3.setContentsMargins(0, 0, 0, 0)
568-
self.horizontalLayout_3.setSpacing(2)
569-
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
570-
self.label_transparency = QtWidgets.QLabel(self.horizontalWidget_transparency)
571-
font = QtGui.QFont()
572-
font.setFamily("微软雅黑")
573-
font.setPointSize(12)
574-
self.label_transparency.setFont(font)
575-
self.label_transparency.setScaledContents(False)
576-
self.label_transparency.setWordWrap(False)
577-
self.label_transparency.setObjectName("label_transparency")
578-
self.horizontalLayout_3.addWidget(self.label_transparency)
579-
self.horizontalSlider_transparency = QtWidgets.QSlider(self.horizontalWidget_transparency)
580-
self.horizontalSlider_transparency.setMinimum(1)
581-
self.horizontalSlider_transparency.setMaximum(100)
582-
self.horizontalSlider_transparency.setSingleStep(1)
583-
self.horizontalSlider_transparency.setOrientation(QtCore.Qt.Horizontal)
584-
self.horizontalSlider_transparency.setObjectName("horizontalSlider_transparency")
585-
self.horizontalLayout_3.addWidget(self.horizontalSlider_transparency)
586-
self.label_transparency_percent_value = QtWidgets.QLabel(self.horizontalWidget_transparency)
587-
self.label_transparency_percent_value.setMinimumSize(QtCore.QSize(30, 0))
588-
font = QtGui.QFont()
589-
font.setFamily("微软雅黑")
590-
font.setPointSize(12)
591-
self.label_transparency_percent_value.setFont(font)
592-
self.label_transparency_percent_value.setLayoutDirection(QtCore.Qt.LeftToRight)
593-
self.label_transparency_percent_value.setText("")
594-
self.label_transparency_percent_value.setScaledContents(False)
595-
self.label_transparency_percent_value.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
596-
self.label_transparency_percent_value.setWordWrap(False)
597-
self.label_transparency_percent_value.setObjectName("label_transparency_percent_value")
598-
self.horizontalLayout_3.addWidget(self.label_transparency_percent_value)
599-
self.label_transparency_percent = QtWidgets.QLabel(self.horizontalWidget_transparency)
600-
font = QtGui.QFont()
601-
font.setFamily("微软雅黑")
602-
font.setPointSize(12)
603-
self.label_transparency_percent.setFont(font)
604-
self.label_transparency_percent.setToolTip("")
605-
self.label_transparency_percent.setStatusTip("")
606-
self.label_transparency_percent.setWhatsThis("")
607-
self.label_transparency_percent.setAccessibleName("")
608-
self.label_transparency_percent.setAccessibleDescription("")
609-
self.label_transparency_percent.setText("%")
610-
self.label_transparency_percent.setScaledContents(False)
611-
self.label_transparency_percent.setWordWrap(False)
612-
self.label_transparency_percent.setObjectName("label_transparency_percent")
613-
self.horizontalLayout_3.addWidget(self.label_transparency_percent)
614-
self.verticalLayout_2.addWidget(self.horizontalWidget_transparency)
615564
self.verticalLayout.addWidget(self.widget_2)
616565
self.line_2 = QtWidgets.QFrame(Form)
617566
self.line_2.setFrameShape(QtWidgets.QFrame.HLine)
@@ -683,7 +632,6 @@ def setupUi(self, Form):
683632
self.checkBox_auto_replay.toggled['bool'].connect(self.spinBox_auto_replay.setEnabled) # type: ignore
684633
self.checkBox_auto_replay.toggled['bool'].connect(self.label_auto_replay_percent.setEnabled) # type: ignore
685634
self.pushButton_no.clicked.connect(Form.close) # type: ignore
686-
self.horizontalSlider_transparency.valueChanged['int'].connect(self.label_transparency_percent_value.setNum) # type: ignore
687635
QtCore.QMetaObject.connectSlotsByName(Form)
688636

689637
def retranslateUi(self, Form):
@@ -714,7 +662,6 @@ def retranslateUi(self, Form):
714662
self.checkBox_auto_notification.setText(_translate("Form", "允许纪录弹窗(推荐)"))
715663
self.label_constraint.setText(_translate("Form", "局面约束:"))
716664
self.label_attempt_times_limit.setText(_translate("Form", "尝试次数:"))
717-
self.label_transparency.setText(_translate("Form", "窗口透明度:"))
718665
self.pushButton_yes.setText(_translate("Form", "确定"))
719666
self.pushButton_yes.setShortcut(_translate("Form", "Return"))
720667
self.pushButton_no.setText(_translate("Form", "取消"))

src/ui/ui_main_board.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ def setupUi(self, MainWindow):
237237
font.setFamily("微软雅黑")
238238
font.setPointSize(12)
239239
self.menu.setFont(font)
240-
self.menu.setStyleSheet("")
241240
self.menu.setObjectName("menu")
242241
self.menu_2 = QtWidgets.QMenu(self.menubar)
243242
font = QtGui.QFont()

uiFiles/main_board.ui

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -622,9 +622,6 @@
622622
<pointsize>12</pointsize>
623623
</font>
624624
</property>
625-
<property name="styleSheet">
626-
<string notr="true"/>
627-
</property>
628625
<property name="title">
629626
<string>游戏</string>
630627
</property>

uiFiles/ui_gs.ui

Lines changed: 1 addition & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<x>0</x>
1111
<y>0</y>
1212
<width>554</width>
13-
<height>638</height>
13+
<height>605</height>
1414
</rect>
1515
</property>
1616
<property name="sizePolicy">
@@ -1276,127 +1276,6 @@ color: #3d3d3d;</string>
12761276
</layout>
12771277
</widget>
12781278
</item>
1279-
<item>
1280-
<widget class="QWidget" name="horizontalWidget_transparency" native="true">
1281-
<layout class="QHBoxLayout" name="horizontalLayout_3">
1282-
<property name="spacing">
1283-
<number>2</number>
1284-
</property>
1285-
<property name="leftMargin">
1286-
<number>0</number>
1287-
</property>
1288-
<property name="topMargin">
1289-
<number>0</number>
1290-
</property>
1291-
<property name="rightMargin">
1292-
<number>0</number>
1293-
</property>
1294-
<property name="bottomMargin">
1295-
<number>0</number>
1296-
</property>
1297-
<item>
1298-
<widget class="QLabel" name="label_transparency">
1299-
<property name="font">
1300-
<font>
1301-
<family>微软雅黑</family>
1302-
<pointsize>12</pointsize>
1303-
</font>
1304-
</property>
1305-
<property name="text">
1306-
<string>窗口透明度:</string>
1307-
</property>
1308-
<property name="scaledContents">
1309-
<bool>false</bool>
1310-
</property>
1311-
<property name="wordWrap">
1312-
<bool>false</bool>
1313-
</property>
1314-
</widget>
1315-
</item>
1316-
<item>
1317-
<widget class="QSlider" name="horizontalSlider_transparency">
1318-
<property name="minimum">
1319-
<number>1</number>
1320-
</property>
1321-
<property name="maximum">
1322-
<number>100</number>
1323-
</property>
1324-
<property name="singleStep">
1325-
<number>1</number>
1326-
</property>
1327-
<property name="orientation">
1328-
<enum>Qt::Horizontal</enum>
1329-
</property>
1330-
</widget>
1331-
</item>
1332-
<item>
1333-
<widget class="QLabel" name="label_transparency_percent_value">
1334-
<property name="minimumSize">
1335-
<size>
1336-
<width>30</width>
1337-
<height>0</height>
1338-
</size>
1339-
</property>
1340-
<property name="font">
1341-
<font>
1342-
<family>微软雅黑</family>
1343-
<pointsize>12</pointsize>
1344-
</font>
1345-
</property>
1346-
<property name="layoutDirection">
1347-
<enum>Qt::LeftToRight</enum>
1348-
</property>
1349-
<property name="text">
1350-
<string/>
1351-
</property>
1352-
<property name="scaledContents">
1353-
<bool>false</bool>
1354-
</property>
1355-
<property name="alignment">
1356-
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
1357-
</property>
1358-
<property name="wordWrap">
1359-
<bool>false</bool>
1360-
</property>
1361-
</widget>
1362-
</item>
1363-
<item>
1364-
<widget class="QLabel" name="label_transparency_percent">
1365-
<property name="font">
1366-
<font>
1367-
<family>微软雅黑</family>
1368-
<pointsize>12</pointsize>
1369-
</font>
1370-
</property>
1371-
<property name="toolTip">
1372-
<string notr="true"/>
1373-
</property>
1374-
<property name="statusTip">
1375-
<string notr="true"/>
1376-
</property>
1377-
<property name="whatsThis">
1378-
<string notr="true"/>
1379-
</property>
1380-
<property name="accessibleName">
1381-
<string notr="true"/>
1382-
</property>
1383-
<property name="accessibleDescription">
1384-
<string notr="true"/>
1385-
</property>
1386-
<property name="text">
1387-
<string notr="true">%</string>
1388-
</property>
1389-
<property name="scaledContents">
1390-
<bool>false</bool>
1391-
</property>
1392-
<property name="wordWrap">
1393-
<bool>false</bool>
1394-
</property>
1395-
</widget>
1396-
</item>
1397-
</layout>
1398-
</widget>
1399-
</item>
14001279
</layout>
14011280
</widget>
14021281
</item>
@@ -1587,21 +1466,5 @@ color:white;</string>
15871466
</hint>
15881467
</hints>
15891468
</connection>
1590-
<connection>
1591-
<sender>horizontalSlider_transparency</sender>
1592-
<signal>valueChanged(int)</signal>
1593-
<receiver>label_transparency_percent_value</receiver>
1594-
<slot>setNum(int)</slot>
1595-
<hints>
1596-
<hint type="sourcelabel">
1597-
<x>354</x>
1598-
<y>504</y>
1599-
</hint>
1600-
<hint type="destinationlabel">
1601-
<x>530</x>
1602-
<y>495</y>
1603-
</hint>
1604-
</hints>
1605-
</connection>
16061469
</connections>
16071470
</ui>

0 commit comments

Comments
 (0)