9 |
9 |
10 import enum |
10 import enum |
11 import os |
11 import os |
12 |
12 |
13 from PyQt6.QtCore import ( |
13 from PyQt6.QtCore import ( |
14 pyqtSlot, pyqtSignal, Qt, QTime, QUrl, QStandardPaths, QFileInfo, QDateTime |
14 pyqtSlot, pyqtSignal, QTime, QUrl, QStandardPaths, QFileInfo, QDateTime |
15 ) |
15 ) |
16 from PyQt6.QtGui import QPalette, QDesktopServices |
16 from PyQt6.QtGui import QDesktopServices |
17 from PyQt6.QtWidgets import QWidget, QStyle, QDialog |
17 from PyQt6.QtWidgets import QWidget, QStyle, QDialog |
18 from PyQt6.QtWebEngineCore import QWebEngineDownloadRequest |
18 from PyQt6.QtWebEngineCore import QWebEngineDownloadRequest |
19 |
19 |
20 from EricWidgets import EricFileDialog |
20 from EricWidgets import EricFileDialog |
|
21 from EricWidgets.EricApplication import ericApp |
21 |
22 |
22 from .Ui_DownloadItem import Ui_DownloadItem |
23 from .Ui_DownloadItem import Ui_DownloadItem |
23 |
24 |
24 from .DownloadUtilities import timeString, dataString, speedString |
25 from .DownloadUtilities import timeString, dataString, speedString |
25 from WebBrowser.WebBrowserWindow import WebBrowserWindow |
26 from WebBrowser.WebBrowserWindow import WebBrowserWindow |
62 @type QWidget |
63 @type QWidget |
63 """ |
64 """ |
64 super().__init__(parent) |
65 super().__init__(parent) |
65 self.setupUi(self) |
66 self.setupUi(self) |
66 |
67 |
67 # TODO: change to use style sheet |
68 self.fileIcon.setStyleSheet("background-color: transparent") |
68 p = self.infoLabel.palette() |
69 self.datetimeLabel.setStyleSheet("background-color: transparent") |
69 p.setColor(QPalette.ColorRole.Text, Qt.GlobalColor.darkGray) |
70 self.filenameLabel.setStyleSheet("background-color: transparent") |
70 self.infoLabel.setPalette(p) |
71 if ericApp().usesDarkPalette(): |
|
72 self.infoLabel.setStyleSheet( |
|
73 "color: #c0c0c0; background-color: transparent" |
|
74 ) # light gray |
|
75 else: |
|
76 self.infoLabel.setStyleSheet( |
|
77 "color: #808080; background-color: transparent" |
|
78 ) # dark gray |
71 |
79 |
72 self.progressBar.setMaximum(0) |
80 self.progressBar.setMaximum(0) |
73 |
81 |
74 self.pauseButton.setIcon(UI.PixmapCache.getIcon("pause")) |
82 self.pauseButton.setIcon(UI.PixmapCache.getIcon("pause")) |
75 self.stopButton.setIcon(UI.PixmapCache.getIcon("stopLoading")) |
83 self.stopButton.setIcon(UI.PixmapCache.getIcon("stopLoading")) |