diff --git a/core/interface/dialogs/settings.py b/core/interface/dialogs/settings.py index c6b48a3..6b4c604 100644 --- a/core/interface/dialogs/settings.py +++ b/core/interface/dialogs/settings.py @@ -60,6 +60,21 @@ def settings_dialog(self): autoresume_layout.addWidget(autoresume_checkbox) dialog.layout().addWidget(autoresume_container) + + # transparent window checkbox + transparent_window_container = QWidget() + transparent_window_layout = QHBoxLayout() + + transparent_window_checkbox = QCheckBox() + transparent_window_container.setLayout(transparent_window_layout) + transparent_window_layout.addWidget(QLabel("Window Transparency (requires restart): ")) + + transparent_window_layout.addStretch() + transparent_window_checkbox.setChecked(state.window_transparency) + transparent_window_checkbox.toggled.connect(lambda checked: setattr(state, 'window_transparency', checked)) + transparent_window_layout.addWidget(transparent_window_checkbox) + dialog.layout().addWidget(transparent_window_container) + ################## # SERVER SETTING # ################## diff --git a/core/interface/gui.py b/core/interface/gui.py index de14123..e6baee2 100644 --- a/core/interface/gui.py +++ b/core/interface/gui.py @@ -6,7 +6,6 @@ from PySide6.QtWidgets import ( QWidget, QVBoxLayout, QListWidget, - QToolBar, QLabel, QHBoxLayout, QComboBox, @@ -16,13 +15,10 @@ from PySide6.QtWidgets import ( QMessageBox, QTableWidget, QTextEdit, - QStyle, - QStyleOptionButton, QStyledItemDelegate, - QApplication, ) -from PySide6.QtGui import QIcon, QAction, QCloseEvent, QImage, QPixmap +from PySide6.QtGui import QIcon, QCloseEvent, QImage, QPixmap import darkdetect import threading import platform @@ -523,4 +519,4 @@ class MainWindow(QtWidgets.QMainWindow, QWidget): def resizeEvent(self, event): super().resizeEvent(event) table_width = self.qtablewidget.viewport().width() - self.qtablewidget.setColumnWidth(1, int(table_width * 0.3)) \ No newline at end of file + self.qtablewidget.setColumnWidth(1, int(table_width * 0.3)) diff --git a/core/utils/config/config.py b/core/utils/config/config.py index a144743..ea38ac8 100644 --- a/core/utils/config/config.py +++ b/core/utils/config/config.py @@ -6,8 +6,19 @@ from core.utils.data.state import state def create_config(): config = configparser.ConfigParser() - config["General"] = {"debug": True, "api_url": f"{state.api_url}", "download_path": f"{state.download_path}", f"download_speed_limit": f"{state.down_speed_limit}", f"upload_speed_limit": f"{state.up_speed_limit}", - "ignore_updates": f"{state.ignore_updates}", "image_path": f"{state.image_path}", "autoresume": f"{state.autoresume}", "max_connections": f"{state.max_connections}", "max_downloads": f"{state.max_downloads}"} + config["General"] = { + "debug": True, + "api_url": f"{state.api_url}", + "download_path": f"{state.download_path}", + "download_speed_limit": f"{state.down_speed_limit}", + "upload_speed_limit": f"{state.up_speed_limit}", + "ignore_updates": f"{state.ignore_updates}", + "image_path": f"{state.image_path}", + "autoresume": f"{state.autoresume}", + "max_connections": f"{state.max_connections}", + "max_downloads": f"{state.max_downloads}", + "window_transparency": f"{state.window_transparency}", + } if platform.system() == "Windows": config_dir = os.environ.get("APPDATA", os.path.expanduser("~\\AppData\\Roaming")) @@ -48,5 +59,6 @@ def read_config(): state.autoresume = config.getboolean("General", "autoresume", fallback=state.autoresume) state.max_connections = config.getint("General", "max_connections", fallback=state.max_connections) state.max_downloads = config.getint("General", "max_downloads", fallback=state.max_downloads) + state.window_transparency = config.getboolean("General", "window_transparency", fallback=state.window_transparency) - create_config() \ No newline at end of file + create_config() diff --git a/core/utils/data/state.py b/core/utils/data/state.py index 553b49e..7d40269 100644 --- a/core/utils/data/state.py +++ b/core/utils/data/state.py @@ -26,6 +26,7 @@ class AppState(QObject): self.settings_path: str = None self.dl_session: Any = None self.active_downloads: List[str] = {} + self.window_transparency: bool = False @property def image_path(self) -> str: diff --git a/main.py b/main.py index bc1d890..596dd45 100644 --- a/main.py +++ b/main.py @@ -8,8 +8,8 @@ from core.utils.general.wrappers import run_thread from core.utils.general.loghandler import split_data, check_completed from core.utils.config.config import read_config from PySide6 import QtWidgets +from PySide6.QtCore import Qt import qdarktheme -import darkdetect import threading import signal import argparse @@ -22,11 +22,13 @@ args = parser.parse_args() def run_gui(): app = QtWidgets.QApplication([]) - if darkdetect.isDark: - app.setStyleSheet(qdarktheme.load_stylesheet("dark")) - else: - app.setStyleSheet(qdarktheme.load_stylesheet("light")) widget = MainWindow() + if state.window_transparency is True: + qdarktheme.setup_theme("auto", custom_colors={"background": "#00000000"}) + widget.setWindowFlags(Qt.WindowType.FramelessWindowHint) + widget.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground) + else: + qdarktheme.setup_theme("auto") from core.utils.general.logs import set_main_window set_main_window(widget) diff --git a/requirements.txt b/requirements.txt index e0d7f51..4074a7d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,11 +1,11 @@ requests==2.32.2 PySide6==6.10.1 beautifulsoup4==4.13.5 -darkdetect==0.8.0 +darkdetect==0.7.1 pyinstaller==6.15.0 -pyqtdarktheme==0.1.7 +pyqtdarktheme==2.1.0 aiohttp==3.13.0 plyer==2.1.0 psutil==7.1.0 libtorrent==2.0.11 -libtorrent-windows-dll==0.0.3 \ No newline at end of file +libtorrent-windows-dll==0.0.3