update: updated screen resolution
This commit is contained in:
parent
d9f0b1ee6c
commit
de61ed63f3
1 changed files with 49 additions and 5 deletions
|
|
@ -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.QtGui import QIcon, QPixmap, QTransform, QPainter, QColor, QFont, QFontDatabase
|
||||||
from PyQt6 import QtGui
|
from PyQt6 import QtGui
|
||||||
from PyQt6 import QtCore
|
from PyQt6 import QtCore
|
||||||
|
|
@ -348,9 +348,10 @@ class CustomWindow(QMainWindow):
|
||||||
self.setWindowTitle('HydraVeil')
|
self.setWindowTitle('HydraVeil')
|
||||||
|
|
||||||
screen = QApplication.primaryScreen()
|
screen = QApplication.primaryScreen()
|
||||||
size = screen.size()
|
|
||||||
self.host_screen_width = size.width()
|
ratio = screen.devicePixelRatio()
|
||||||
self.host_screen_height = size.height()
|
self.host_screen_width = int(screen.size().width() * ratio)
|
||||||
|
self.host_screen_height = int(screen.size().height() * ratio)
|
||||||
|
|
||||||
self._data = {"Profile_1": {}}
|
self._data = {"Profile_1": {}}
|
||||||
|
|
||||||
|
|
@ -5049,6 +5050,7 @@ class EditorPage(Page):
|
||||||
|
|
||||||
self.temp_changes = {}
|
self.temp_changes = {}
|
||||||
self.original_values = {}
|
self.original_values = {}
|
||||||
|
self.res_hint_shown = False
|
||||||
self.display.setGeometry(QtCore.QRect(0, 60, 540, 405))
|
self.display.setGeometry(QtCore.QRect(0, 60, 540, 405))
|
||||||
self.display.hide()
|
self.display.hide()
|
||||||
|
|
||||||
|
|
@ -5102,6 +5104,7 @@ class EditorPage(Page):
|
||||||
|
|
||||||
def showEvent(self, event):
|
def showEvent(self, event):
|
||||||
super().showEvent(event)
|
super().showEvent(event)
|
||||||
|
self.res_hint_shown = False
|
||||||
self.extraccion()
|
self.extraccion()
|
||||||
|
|
||||||
def extraccion(self):
|
def extraccion(self):
|
||||||
|
|
@ -5350,9 +5353,50 @@ class EditorPage(Page):
|
||||||
label.setGeometry(565, 90 + i * 80, 185, 75)
|
label.setGeometry(565, 90 + i * 80, 185, 75)
|
||||||
label.setFlat(True)
|
label.setFlat(True)
|
||||||
label.setStyleSheet("border: none; background: transparent;")
|
label.setStyleSheet("border: none; background: transparent;")
|
||||||
label.setIcon(QIcon(base_image))
|
original_icon = QIcon(base_image)
|
||||||
label.setIconSize(QSize(185, 75))
|
label.setIconSize(QSize(185, 75))
|
||||||
|
label.setCursor(QtCore.Qt.CursorShape.PointingHandCursor)
|
||||||
label.clicked.connect(self.show_custom_res_dialog)
|
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:
|
else:
|
||||||
label = QLabel(key, self)
|
label = QLabel(key, self)
|
||||||
label.setGeometry(565, 90 + i * 80, 185, 75)
|
label.setGeometry(565, 90 + i * 80, 185, 75)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue