Compare commits

..

2 Commits

Author SHA1 Message Date
KeksNino d4005d7e86 fix: disable transparency on windows as it is broken 2026-01-31 19:17:30 +01:00
KeksNino 08a45cb422 feat: add qt window transparency 2026-01-31 18:46:40 +01:00
6 changed files with 44 additions and 17 deletions
+15
View File
@@ -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) (Linux/MacOS only): "))
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 #
##################
+2 -6
View File
@@ -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))
self.qtablewidget.setColumnWidth(1, int(table_width * 0.3))
+15 -3
View File
@@ -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()
create_config()
+1
View File
@@ -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:
+8 -5
View File
@@ -8,9 +8,10 @@ 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 platform
import signal
import argparse
import sys
@@ -22,11 +23,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:
if platform.system() != "Windows":
qdarktheme.setup_theme("auto", custom_colors={"background": "#00000000"})
widget.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground)
else:
qdarktheme.setup_theme("auto")
from core.utils.general.logs import set_main_window
set_main_window(widget)
+3 -3
View File
@@ -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
libtorrent-windows-dll==0.0.3