From de61ed63f3a40364b48a8bbe19dd69c57bcd3388 Mon Sep 17 00:00:00 2001 From: John Date: Mon, 23 Mar 2026 19:12:15 +0100 Subject: [PATCH] update: updated screen resolution --- gui/__main__.py | 54 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 49 insertions(+), 5 deletions(-) diff --git a/gui/__main__.py b/gui/__main__.py index a03e9c6..e01a9f8 100755 --- a/gui/__main__.py +++ b/gui/__main__.py @@ -1,4 +1,4 @@ -from PyQt6.QtWidgets import QComboBox, QButtonGroup, QLineEdit, QMainWindow, QLabel, QWidget, QStackedWidget, QApplication, QPushButton, QTextEdit, QFrame, QHBoxLayout, QVBoxLayout, QScrollArea, QSystemTrayIcon, QMessageBox, QGridLayout, QCheckBox, QStackedLayout, QGroupBox, QDialog +from PyQt6.QtWidgets import QComboBox, QButtonGroup, QLineEdit, QMainWindow, QLabel, QWidget, QStackedWidget, QApplication, QPushButton, QTextEdit, QFrame, QHBoxLayout, QVBoxLayout, QScrollArea, QSystemTrayIcon, QMessageBox, QGraphicsDropShadowEffect, QGridLayout, QCheckBox, QStackedLayout, QGroupBox, QDialog from PyQt6.QtGui import QIcon, QPixmap, QTransform, QPainter, QColor, QFont, QFontDatabase from PyQt6 import QtGui from PyQt6 import QtCore @@ -348,9 +348,10 @@ class CustomWindow(QMainWindow): self.setWindowTitle('HydraVeil') screen = QApplication.primaryScreen() - size = screen.size() - self.host_screen_width = size.width() - self.host_screen_height = size.height() + + ratio = screen.devicePixelRatio() + self.host_screen_width = int(screen.size().width() * ratio) + self.host_screen_height = int(screen.size().height() * ratio) self._data = {"Profile_1": {}} @@ -5049,6 +5050,7 @@ class EditorPage(Page): self.temp_changes = {} self.original_values = {} + self.res_hint_shown = False self.display.setGeometry(QtCore.QRect(0, 60, 540, 405)) self.display.hide() @@ -5102,6 +5104,7 @@ class EditorPage(Page): def showEvent(self, event): super().showEvent(event) + self.res_hint_shown = False self.extraccion() def extraccion(self): @@ -5350,9 +5353,50 @@ class EditorPage(Page): label.setGeometry(565, 90 + i * 80, 185, 75) label.setFlat(True) label.setStyleSheet("border: none; background: transparent;") - label.setIcon(QIcon(base_image)) + original_icon = QIcon(base_image) label.setIconSize(QSize(185, 75)) + label.setCursor(QtCore.Qt.CursorShape.PointingHandCursor) label.clicked.connect(self.show_custom_res_dialog) + + template_path = os.path.join( + self.btn_path, "resolution_template_button.png") + template_pixmap = QPixmap(template_path).scaled( + 187, 75) if os.path.exists(template_path) else None + + if not getattr(self, 'res_hint_shown', False) and connection != 'system-wide': + self.res_hint_shown = True + if template_pixmap: + label.setIcon(QIcon(template_pixmap)) + else: + label.setIcon(QIcon()) + + hint_label = QLabel("Click here to customize", label) + hint_label.setGeometry(15, 0, 155, 75) + hint_label.setWordWrap(True) + hint_label.setAlignment( + QtCore.Qt.AlignmentFlag.AlignCenter) + hint_label.setStyleSheet( + "color: #00ffff; font-weight: bold; font-size: 16px; background: transparent;") + hint_label.setCursor( + QtCore.Qt.CursorShape.PointingHandCursor) + hint_label.setAttribute( + QtCore.Qt.WidgetAttribute.WA_TransparentForMouseEvents) + shadow = QGraphicsDropShadowEffect(hint_label) + shadow.setBlurRadius(20) + shadow.setColor(QColor(0, 255, 255)) + shadow.setOffset(0, 0) + hint_label.setGraphicsEffect(shadow) + + def restore(): + try: + if hint_label and not hint_label.isHidden(): + hint_label.hide() + label.setIcon(original_icon) + except: + pass + QTimer.singleShot(3500, restore) + else: + label.setIcon(original_icon) else: label = QLabel(key, self) label.setGeometry(565, 90 + i * 80, 185, 75)