update: updated edit page

This commit is contained in:
John 2026-02-28 00:57:24 +01:00
parent bb53320b67
commit de777558ed
2 changed files with 117 additions and 6 deletions

View file

@ -4472,6 +4472,9 @@ class ScreenPage(Page):
ok_button.clicked.connect(validate_and_accept) ok_button.clicked.connect(validate_and_accept)
cancel_button.clicked.connect(dialog.reject) cancel_button.clicked.connect(dialog.reject)
width_input.returnPressed.connect(validate_and_accept)
height_input.returnPressed.connect(validate_and_accept)
dialog.exec() dialog.exec()
def update_swarp_json(self): def update_swarp_json(self):
@ -5282,10 +5285,20 @@ class EditorPage(Page):
current_value = data_profile.get(key, '') current_value = data_profile.get(key, '')
base_image = QPixmap(image_path) base_image = QPixmap(image_path)
label = QLabel(key, self) if key == 'dimentions':
label.setGeometry(565, 90 + i * 80, 185, 75) label = QPushButton(self)
label.setPixmap(base_image) label.setGeometry(565, 90 + i * 80, 185, 75)
label.setScaledContents(True) label.setFlat(True)
label.setStyleSheet("border: none; background: transparent;")
label.setIcon(QIcon(base_image))
label.setIconSize(QSize(185, 75))
label.clicked.connect(self.show_custom_res_dialog)
else:
label = QLabel(key, self)
label.setGeometry(565, 90 + i * 80, 185, 75)
label.setPixmap(base_image)
label.setScaledContents(True)
label.show() label.show()
self.labels.append(label) self.labels.append(label)
@ -5455,6 +5468,100 @@ class EditorPage(Page):
self.temp_changes[selected_profiles_str][key] = new_value self.temp_changes[selected_profiles_str][key] = new_value
self.extraccion() self.extraccion()
def show_custom_res_dialog(self):
dialog = QDialog(self)
dialog.setWindowTitle("Custom Resolution")
dialog.setFixedSize(300, 150)
dialog.setModal(True)
dialog.setStyleSheet("""
QDialog {
background-color: #2c3e50;
border: 2px solid #00ffff;
border-radius: 10px;
}
QLabel {
color: white;
font-size: 12px;
}
QLineEdit {
background-color: #34495e;
color: white;
border: 1px solid #00ffff;
border-radius: 5px;
padding: 5px;
font-size: 12px;
}
QPushButton {
background-color: #2c3e50;
color: white;
border: 2px solid #00ffff;
border-radius: 5px;
padding: 8px;
font-size: 12px;
}
QPushButton:hover {
background-color: #34495e;
}
""")
layout = QVBoxLayout()
input_layout = QHBoxLayout()
width_label = QLabel("Width:")
width_input = QLineEdit()
width_input.setPlaceholderText("1920")
height_label = QLabel("Height:")
height_input = QLineEdit()
height_input.setPlaceholderText("1080")
input_layout.addWidget(width_label)
input_layout.addWidget(width_input)
input_layout.addWidget(height_label)
input_layout.addWidget(height_input)
button_layout = QHBoxLayout()
ok_button = QPushButton("OK")
cancel_button = QPushButton("Cancel")
button_layout.addWidget(cancel_button)
button_layout.addWidget(ok_button)
layout.addLayout(input_layout)
layout.addLayout(button_layout)
dialog.setLayout(layout)
def validate_and_accept():
try:
width = int(width_input.text())
height = int(height_input.text())
if width <= 0 or height <= 0:
return
host_w = self.custom_window.host_screen_width
host_h = self.custom_window.host_screen_height
adjusted = False
if width > host_w:
width = host_w - 50
adjusted = True
if height > host_h:
height = host_h - 50
adjusted = True
if adjusted:
QMessageBox.information(
dialog, "Notice", "Adjusted to fit host size")
self.update_temp_value('dimentions', f"{width}x{height}")
dialog.accept()
except ValueError:
pass
ok_button.clicked.connect(validate_and_accept)
cancel_button.clicked.connect(dialog.reject)
width_input.returnPressed.connect(validate_and_accept)
height_input.returnPressed.connect(validate_and_accept)
dialog.exec()
def has_unsaved_changes(self, profile_str: str) -> bool: def has_unsaved_changes(self, profile_str: str) -> bool:
return profile_str in self.temp_changes and bool(self.temp_changes[profile_str]) return profile_str in self.temp_changes and bool(self.temp_changes[profile_str])
@ -8005,7 +8112,7 @@ class IdPage(Page):
"Note: Billing IDs are tied to a single location", self) "Note: Billing IDs are tied to a single location", self)
self.note_label.setGeometry(1, 100, 500, 20) self.note_label.setGeometry(1, 100, 500, 20)
self.note_label.setStyleSheet( self.note_label.setStyleSheet(
"color: white; font-size: 15px; font-style: italic;") "color: white; font-size: 17px; font-style: italic; font-weight: bold;")
self.note_label.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) self.note_label.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
self.note_label.show() self.note_label.show()
@ -10064,6 +10171,10 @@ class FastRegistrationPage(Page):
ok_button.clicked.connect(validate_and_accept) ok_button.clicked.connect(validate_and_accept)
cancel_button.clicked.connect(dialog.reject) cancel_button.clicked.connect(dialog.reject)
width_input.returnPressed.connect(validate_and_accept)
height_input.returnPressed.connect(validate_and_accept)
dialog.exec() dialog.exec()
def update_ui_state_for_connection(self): def update_ui_state_for_connection(self):

View file

@ -1,6 +1,6 @@
[project] [project]
name = "sp-hydra-veil-gui" name = "sp-hydra-veil-gui"
version = "2.2.3" version = "2.2.4"
authors = [ authors = [
{ name = "Simplified Privacy" }, { name = "Simplified Privacy" },
] ]