Skip to content

Commit 978ffbd

Browse files
authored
Update settings.py
1 parent 47fef09 commit 978ffbd

File tree

1 file changed

+21
-22
lines changed

1 file changed

+21
-22
lines changed

settings.py

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# settings.py
21
import subprocess
32
import time
43
import os
@@ -22,17 +21,17 @@ def __init__(self, parent=None):
2221
self.setCentralWidget(self.central_widget)
2322
self.layout = QVBoxLayout(self.central_widget)
2423
self.layout.setAlignment(Qt.AlignCenter)
25-
self.layout.setSpacing(70) # Increased spacing
26-
self.layout.setContentsMargins(80, 80, 80, 80) # Larger margins
24+
self.layout.setSpacing(70)
25+
self.layout.setContentsMargins(80, 80, 80, 80)
2726

2827
self.title = QLabel(get_text('settings'))
29-
self.title.setFont(QFont('Hack', 55, QFont.Bold)) # Larger font
28+
self.title.setFont(QFont('Hack', 55, QFont.Bold))
3029
self.title.setObjectName('neon-text')
3130
self.layout.addWidget(self.title, alignment=Qt.AlignCenter)
3231

3332
self.grid_layout = QGridLayout()
34-
self.grid_layout.setSpacing(60) # Increased spacing
35-
self.grid_layout.setContentsMargins(60, 60, 60, 60) # Larger margins
33+
self.grid_layout.setSpacing(60)
34+
self.grid_layout.setContentsMargins(60, 60, 60, 60)
3635
self.layout.addLayout(self.grid_layout)
3736

3837
self.add_audio_panel()
@@ -44,9 +43,9 @@ def __init__(self, parent=None):
4443

4544
self.wifi_panel = QWidget(objectName='setting-panel')
4645
self.wifi_layout = QVBoxLayout(self.wifi_panel)
47-
self.wifi_layout.setSpacing(30) # Increased spacing
46+
self.wifi_layout.setSpacing(30)
4847
self.wifi_title = QLabel(get_text('wifi_settings'))
49-
self.wifi_title.setFont(QFont('Hack', 24, QFont.Bold)) # Larger font
48+
self.wifi_title.setFont(QFont('Hack', 24, QFont.Bold))
5049
self.wifi_layout.addWidget(self.wifi_title)
5150
self.wifi_list = QScrollArea()
5251
self.wifi_list.setWidgetResizable(True)
@@ -58,21 +57,21 @@ def __init__(self, parent=None):
5857
self.wifi_password = QLineEdit()
5958
self.wifi_password.setPlaceholderText('Password (if required)')
6059
self.wifi_password.setObjectName('input-field')
61-
self.wifi_password.setFixedHeight(70) # Larger input
60+
self.wifi_password.setFixedHeight(70)
6261
self.wifi_layout.addWidget(self.wifi_password)
6362
self.connect_btn = QPushButton(get_text('connect'))
6463
self.connect_btn.setObjectName('setting-btn')
65-
self.connect_btn.setFixedHeight(70) # Larger button
64+
self.connect_btn.setFixedHeight(70)
6665
self.connect_btn.clicked.connect(self.connect_wifi)
6766
self.wifi_layout.addWidget(self.connect_btn)
6867
self.wifi_panel.setHidden(True)
6968
self.layout.addWidget(self.wifi_panel)
7069

7170
self.bluetooth_panel = QWidget(objectName='setting-panel')
7271
self.bluetooth_layout = QVBoxLayout(self.bluetooth_panel)
73-
self.bluetooth_layout.setSpacing(30) # Increased spacing
72+
self.bluetooth_layout.setSpacing(30)
7473
self.bluetooth_title = QLabel(get_text('bluetooth'))
75-
self.bluetooth_title.setFont(QFont('Hack', 24, QFont.Bold)) # Larger font
74+
self.bluetooth_title.setFont(QFont('Hack', 24, QFont.Bold))
7675
self.bluetooth_layout.addWidget(self.bluetooth_title)
7776
self.bluetooth_list = QScrollArea()
7877
self.bluetooth_list.setWidgetResizable(True)
@@ -83,32 +82,32 @@ def __init__(self, parent=None):
8382
self.bluetooth_layout.addWidget(self.bluetooth_list)
8483
self.scan_btn = QPushButton(get_text('scan'))
8584
self.scan_btn.setObjectName('setting-btn')
86-
self.scan_btn.setFixedHeight(70) # Larger button
85+
self.scan_btn.setFixedHeight(70)
8786
self.scan_btn.clicked.connect(self.scan_bluetooth)
8887
self.bluetooth_layout.addWidget(self.scan_btn)
8988
self.pair_btn = QPushButton(get_text('pair'))
9089
self.pair_btn.setObjectName('setting-btn')
91-
self.pair_btn.setFixedHeight(70) # Larger button
90+
self.pair_btn.setFixedHeight(70)
9291
self.pair_btn.clicked.connect(self.pair_bluetooth)
9392
self.bluetooth_layout.addWidget(self.pair_btn)
9493
self.bluetooth_panel.setHidden(True)
9594
self.layout.addWidget(self.bluetooth_panel)
9695

9796
self.bottom_layout = QHBoxLayout()
9897
self.bottom_layout.setAlignment(Qt.AlignRight)
99-
self.bottom_layout.setSpacing(50) # Increased spacing
98+
self.bottom_layout.setSpacing(50)
10099
self.bottom_layout.addStretch()
101100
self.back_btn = QPushButton(get_text('back'))
102101
self.back_btn.setObjectName('action-btn')
103-
self.back_btn.setFixedSize(320, 110) # Larger button
104-
self.back_btn.setFont(QFont('Hack', 26, QFont.Bold)) # Larger font
102+
self.back_btn.setFixedSize(320, 110)
103+
self.back_btn.setFont(QFont('Hack', 26, QFont.Bold))
105104
self.back_btn.clicked.connect(self.back_to_main)
106105
self.bottom_layout.addWidget(self.back_btn)
107106
logging.info(f'Back button added to settings window at position: {self.back_btn.geometry().getRect()}')
108107
self.close_btn = QPushButton(get_text('close'))
109108
self.close_btn.setObjectName('action-btn')
110-
self.close_btn.setFixedSize(320, 110) # Larger button
111-
self.close_btn.setFont(QFont('Hack', 26, QFont.Bold)) # Larger font
109+
self.close_btn.setFixedSize(320, 110)
110+
self.close_btn.setFont(QFont('Hack', 26, QFont.Bold))
112111
self.close_btn.clicked.connect(self.close)
113112
self.bottom_layout.addWidget(self.close_btn)
114113
self.layout.addLayout(self.bottom_layout)
@@ -140,11 +139,11 @@ def animate_panels(self):
140139
for i, panel in enumerate(panels):
141140
anim = QPropertyAnimation(panel, b"geometry")
142141
rect = panel.geometry()
143-
anim.setStartValue(QRect(rect.x(), rect.y() + 300, rect.width(), rect.height())) # More dramatic
142+
anim.setStartValue(QRect(rect.x(), rect.y() + 300, rect.width(), rect.height()))
144143
anim.setEndValue(rect)
145-
anim.setDuration(2000) # Slower
144+
anim.setDuration(2000)
146145
anim.setEasingCurve(QEasingCurve.OutQuint)
147-
QTimer.singleShot(i * 400, anim.start) # More delay
146+
QTimer.singleShot(i * 400, anim.start)
148147

149148
def add_audio_panel(self):
150149
panel = QWidget(objectName='setting-panel')

0 commit comments

Comments
 (0)