From de777558ed86e25526cef8f132cd9b615e8ad4ab Mon Sep 17 00:00:00 2001 From: John Date: Sat, 28 Feb 2026 00:57:24 +0100 Subject: [PATCH] update: updated edit page --- gui/__main__.py | 121 ++++++++++++++++++++++++++++++++++++++++++++++-- pyproject.toml | 2 +- 2 files changed, 117 insertions(+), 6 deletions(-) diff --git a/gui/__main__.py b/gui/__main__.py index 1188f90..96390ba 100755 --- a/gui/__main__.py +++ b/gui/__main__.py @@ -4472,6 +4472,9 @@ class ScreenPage(Page): 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 update_swarp_json(self): @@ -5282,10 +5285,20 @@ class EditorPage(Page): current_value = data_profile.get(key, '') base_image = QPixmap(image_path) - label = QLabel(key, self) - label.setGeometry(565, 90 + i * 80, 185, 75) - label.setPixmap(base_image) - label.setScaledContents(True) + if key == 'dimentions': + label = QPushButton(self) + label.setGeometry(565, 90 + i * 80, 185, 75) + 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() self.labels.append(label) @@ -5455,6 +5468,100 @@ class EditorPage(Page): self.temp_changes[selected_profiles_str][key] = new_value 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: 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) self.note_label.setGeometry(1, 100, 500, 20) 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.show() @@ -10064,6 +10171,10 @@ class FastRegistrationPage(Page): 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 update_ui_state_for_connection(self): diff --git a/pyproject.toml b/pyproject.toml index 07eb28e..dad42bc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "sp-hydra-veil-gui" -version = "2.2.3" +version = "2.2.4" authors = [ { name = "Simplified Privacy" }, ]