commit
5b6df91be9
|
@ -258,10 +258,12 @@ class InstallDialog(ActionDialog):
|
||||||
def action_handler(self):
|
def action_handler(self):
|
||||||
self.error_box()
|
self.error_box()
|
||||||
message = self.tr("Updating...")
|
message = self.tr("Updating...")
|
||||||
|
font = self.font()
|
||||||
|
font.setItalic(True)
|
||||||
self.ui.download_size_text.setText(message)
|
self.ui.download_size_text.setText(message)
|
||||||
self.ui.download_size_text.setStyleSheet("font-style: italic; font-weight: normal")
|
self.ui.download_size_text.setFont(font)
|
||||||
self.ui.install_size_text.setText(message)
|
self.ui.install_size_text.setText(message)
|
||||||
self.ui.install_size_text.setStyleSheet("font-style: italic; font-weight: normal")
|
self.ui.install_size_text.setFont(font)
|
||||||
self.setActive(True)
|
self.setActive(True)
|
||||||
self.options_changed = False
|
self.options_changed = False
|
||||||
self.get_options()
|
self.get_options()
|
||||||
|
@ -309,15 +311,19 @@ class InstallDialog(ActionDialog):
|
||||||
download_size = download.analysis.dl_size
|
download_size = download.analysis.dl_size
|
||||||
install_size = download.analysis.install_size
|
install_size = download.analysis.install_size
|
||||||
# install_size = self.dl_item.download.analysis.disk_space_delta
|
# install_size = self.dl_item.download.analysis.disk_space_delta
|
||||||
|
bold_font = self.font()
|
||||||
|
bold_font.setBold(True)
|
||||||
|
italic_font = self.font()
|
||||||
|
italic_font.setItalic(True)
|
||||||
if download_size or (not download_size and (download.game.is_dlc or download.repair)):
|
if download_size or (not download_size and (download.game.is_dlc or download.repair)):
|
||||||
self.ui.download_size_text.setText(format_size(download_size))
|
self.ui.download_size_text.setText(format_size(download_size))
|
||||||
self.ui.download_size_text.setStyleSheet("font-style: normal; font-weight: bold")
|
self.ui.download_size_text.setFont(bold_font)
|
||||||
self.accept_button.setEnabled(not self.options_changed)
|
self.accept_button.setEnabled(not self.options_changed)
|
||||||
else:
|
else:
|
||||||
self.ui.install_size_text.setText(self.tr("Game already installed"))
|
self.ui.download_size_text.setText(self.tr("Game already installed"))
|
||||||
self.ui.install_size_text.setStyleSheet("font-style: italics; font-weight: normal")
|
self.ui.download_size_text.setFont(italic_font)
|
||||||
self.ui.install_size_text.setText(format_size(install_size))
|
self.ui.install_size_text.setText(format_size(install_size))
|
||||||
self.ui.install_size_text.setStyleSheet("font-style: normal; font-weight: bold")
|
self.ui.install_size_text.setFont(bold_font)
|
||||||
self.action_button.setEnabled(self.options_changed)
|
self.action_button.setEnabled(self.options_changed)
|
||||||
has_prereqs = bool(download.igame.prereq_info) and not download.igame.prereq_info.get("installed", False)
|
has_prereqs = bool(download.igame.prereq_info) and not download.igame.prereq_info.get("installed", False)
|
||||||
if has_prereqs:
|
if has_prereqs:
|
||||||
|
|
|
@ -61,6 +61,8 @@ class DownloadsTab(QWidget):
|
||||||
queue_contents = QWidget(self.queue_scrollarea)
|
queue_contents = QWidget(self.queue_scrollarea)
|
||||||
queue_contents.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
|
queue_contents.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
|
||||||
self.queue_scrollarea.setWidget(queue_contents)
|
self.queue_scrollarea.setWidget(queue_contents)
|
||||||
|
self.queue_scrollarea.widget().setAutoFillBackground(False)
|
||||||
|
self.queue_scrollarea.viewport().setAutoFillBackground(False)
|
||||||
|
|
||||||
queue_contents_layout = QVBoxLayout(queue_contents)
|
queue_contents_layout = QVBoxLayout(queue_contents)
|
||||||
queue_contents_layout.setContentsMargins(0, 0, 3, 0)
|
queue_contents_layout.setContentsMargins(0, 0, 3, 0)
|
||||||
|
|
|
@ -59,11 +59,11 @@ class DownloadWidget(ImageWidget):
|
||||||
def paint_image_empty(self, painter: QPainter, a0: QPaintEvent) -> None:
|
def paint_image_empty(self, painter: QPainter, a0: QPaintEvent) -> None:
|
||||||
# when pixmap object is not available yet, show a gray rectangle
|
# when pixmap object is not available yet, show a gray rectangle
|
||||||
painter.setOpacity(0.5 * self._opacity)
|
painter.setOpacity(0.5 * self._opacity)
|
||||||
painter.fillRect(a0.rect(), self.palette().color(QPalette.Background))
|
painter.fillRect(a0.rect(), self.palette().color(QPalette.Window))
|
||||||
|
|
||||||
def paint_image_cover(self, painter: QPainter, a0: QPaintEvent) -> None:
|
def paint_image_cover(self, painter: QPainter, a0: QPaintEvent) -> None:
|
||||||
painter.setOpacity(self._opacity)
|
painter.setOpacity(self._opacity)
|
||||||
color = self.palette().color(QPalette.Background).darker(75)
|
color = self.palette().color(QPalette.Window).darker(75)
|
||||||
painter.fillRect(self.rect(), color)
|
painter.fillRect(self.rect(), color)
|
||||||
brush = QBrush(self._pixmap)
|
brush = QBrush(self._pixmap)
|
||||||
brush.setTransform(self._transform)
|
brush.setTransform(self._transform)
|
||||||
|
|
|
@ -99,7 +99,7 @@ class ListGameWidget(GameWidget):
|
||||||
|
|
||||||
def paint_image_cover(self, painter: QPainter, a0: QPaintEvent) -> None:
|
def paint_image_cover(self, painter: QPainter, a0: QPaintEvent) -> None:
|
||||||
painter.setOpacity(self._opacity)
|
painter.setOpacity(self._opacity)
|
||||||
color = self.palette().color(QPalette.Background).darker(75)
|
color = self.palette().color(QPalette.Window).darker(75)
|
||||||
painter.fillRect(self.rect(), color)
|
painter.fillRect(self.rect(), color)
|
||||||
brush = QBrush(self._pixmap)
|
brush = QBrush(self._pixmap)
|
||||||
brush.setTransform(self._transform)
|
brush.setTransform(self._transform)
|
||||||
|
|
|
@ -22,12 +22,14 @@ class SettingsTab(SideTabWidget):
|
||||||
self.settings_index = self.addTab(game_settings, self.tr("Defaults"))
|
self.settings_index = self.addTab(game_settings, self.tr("Defaults"))
|
||||||
|
|
||||||
self.about = About(self)
|
self.about = About(self)
|
||||||
self.about_index = self.addTab(self.about, "About", "About")
|
title = self.tr("About")
|
||||||
|
self.about_index = self.addTab(self.about, title, title)
|
||||||
self.about.update_available_ready.connect(
|
self.about.update_available_ready.connect(
|
||||||
lambda: self.tabBar().setTabText(self.about_index, "About (!)")
|
lambda: self.tabBar().setTabText(self.about_index, "About (!)")
|
||||||
)
|
)
|
||||||
|
|
||||||
if self.args.debug:
|
if self.args.debug:
|
||||||
self.debug_index = self.addTab(DebugSettings(self), "Debug")
|
title = self.tr("Debug")
|
||||||
|
self.debug_index = self.addTab(DebugSettings(self), title, title)
|
||||||
|
|
||||||
self.setCurrentIndex(self.rare_index)
|
self.setCurrentIndex(self.rare_index)
|
||||||
|
|
|
@ -4,8 +4,17 @@ import shutil
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
from typing import Optional, Tuple, Iterable
|
from typing import Optional, Tuple, Iterable
|
||||||
|
|
||||||
from PyQt5.QtCore import pyqtSignal, QSize, Qt, QMimeData, pyqtSlot
|
from PyQt5.QtCore import pyqtSignal, QSize, Qt, QMimeData, pyqtSlot, QObject, QEvent
|
||||||
from PyQt5.QtGui import QDrag, QDropEvent, QDragEnterEvent, QDragMoveEvent, QFont, QMouseEvent, QShowEvent
|
from PyQt5.QtGui import (
|
||||||
|
QDrag,
|
||||||
|
QDropEvent,
|
||||||
|
QDragEnterEvent,
|
||||||
|
QDragMoveEvent,
|
||||||
|
QFont,
|
||||||
|
QMouseEvent,
|
||||||
|
QShowEvent,
|
||||||
|
QResizeEvent,
|
||||||
|
)
|
||||||
from PyQt5.QtWidgets import (
|
from PyQt5.QtWidgets import (
|
||||||
QHBoxLayout,
|
QHBoxLayout,
|
||||||
QLabel,
|
QLabel,
|
||||||
|
@ -15,7 +24,11 @@ from PyQt5.QtWidgets import (
|
||||||
QWidget,
|
QWidget,
|
||||||
QScrollArea,
|
QScrollArea,
|
||||||
QAction,
|
QAction,
|
||||||
QMenu, QStackedWidget, QPushButton, QLineEdit, QVBoxLayout, QComboBox,
|
QMenu,
|
||||||
|
QPushButton,
|
||||||
|
QLineEdit,
|
||||||
|
QVBoxLayout,
|
||||||
|
QComboBox,
|
||||||
)
|
)
|
||||||
|
|
||||||
from rare.models.wrapper import Wrapper
|
from rare.models.wrapper import Wrapper
|
||||||
|
@ -172,46 +185,75 @@ class WrapperWidget(QFrame):
|
||||||
drag.exec_(Qt.MoveAction)
|
drag.exec_(Qt.MoveAction)
|
||||||
|
|
||||||
|
|
||||||
|
class WrapperSettingsScroll(QScrollArea):
|
||||||
|
def __init__(self, parent=None):
|
||||||
|
super(WrapperSettingsScroll, self).__init__(parent=parent)
|
||||||
|
self.setFrameShape(QFrame.StyledPanel)
|
||||||
|
self.setSizeAdjustPolicy(QScrollArea.AdjustToContents)
|
||||||
|
self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
||||||
|
self.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
|
||||||
|
self.setWidgetResizable(True)
|
||||||
|
self.setProperty("no_kinetic_scroll", True)
|
||||||
|
|
||||||
|
self.setObjectName(type(self).__name__)
|
||||||
|
self.horizontalScrollBar().setObjectName(f"{self.objectName()}Bar")
|
||||||
|
self.verticalScrollBar().setObjectName(f"{self.objectName()}Bar")
|
||||||
|
|
||||||
|
def setWidget(self, w):
|
||||||
|
super().setWidget(w)
|
||||||
|
w.installEventFilter(self)
|
||||||
|
|
||||||
|
def eventFilter(self, a0: QObject, a1: QEvent) -> bool:
|
||||||
|
if a0 is self.widget() and a1.type() == QEvent.Resize:
|
||||||
|
self.__resize(a0)
|
||||||
|
return a0.event(a1)
|
||||||
|
return False
|
||||||
|
|
||||||
|
def __resize(self, e: QResizeEvent):
|
||||||
|
minh = self.horizontalScrollBar().minimum()
|
||||||
|
maxh = self.horizontalScrollBar().maximum()
|
||||||
|
# lk: when the scrollbar is not visible, min and max are 0
|
||||||
|
if maxh > minh:
|
||||||
|
height = (
|
||||||
|
e.size().height()
|
||||||
|
+ self.rect().height() // 2
|
||||||
|
- self.contentsRect().height() // 2
|
||||||
|
+ self.widget().layout().spacing()
|
||||||
|
+ self.horizontalScrollBar().sizeHint().height()
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
height = e.size().height() + self.rect().height() - self.contentsRect().height()
|
||||||
|
self.setMaximumHeight(max(height, self.minimumHeight()))
|
||||||
|
|
||||||
|
|
||||||
class WrapperSettings(QWidget):
|
class WrapperSettings(QWidget):
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super(WrapperSettings, self).__init__(parent=parent)
|
super(WrapperSettings, self).__init__(parent=parent)
|
||||||
self.widget_stack = QStackedWidget(self)
|
|
||||||
|
|
||||||
self.wrapper_scroll = QScrollArea(self.widget_stack)
|
self.wrapper_label = QLabel(self.tr("No wrappers defined"), self)
|
||||||
self.wrapper_scroll.setSizeAdjustPolicy(QScrollArea.AdjustToContents)
|
self.wrapper_label.setFrameStyle(QLabel.StyledPanel | QLabel.Plain)
|
||||||
self.wrapper_scroll.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
self.wrapper_label.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
|
||||||
self.wrapper_scroll.setWidgetResizable(True)
|
|
||||||
self.wrapper_scroll.setProperty("no_kinetic_scroll", True)
|
|
||||||
self.wrapper_container = WrapperContainer(parent=self.wrapper_scroll)
|
|
||||||
self.wrapper_container.orderChanged.connect(self.__on_order_changed)
|
|
||||||
self.wrapper_scroll.setWidget(self.wrapper_container)
|
|
||||||
|
|
||||||
self.no_wrapper_label = QLabel(self.tr("No wrappers defined"), self.widget_stack)
|
|
||||||
|
|
||||||
self.widget_stack.addWidget(self.wrapper_scroll)
|
|
||||||
self.widget_stack.addWidget(self.no_wrapper_label)
|
|
||||||
|
|
||||||
self.add_button = QPushButton(self.tr("Add wrapper"), self)
|
self.add_button = QPushButton(self.tr("Add wrapper"), self)
|
||||||
self.add_button.clicked.connect(self.__on_add)
|
self.add_button.clicked.connect(self.__on_add)
|
||||||
|
|
||||||
self.wrapper_scroll.horizontalScrollBar().rangeChanged.connect(self.adjust_scrollarea)
|
self.wrapper_scroll = WrapperSettingsScroll(self)
|
||||||
|
self.wrapper_scroll.setMinimumHeight(self.add_button.minimumSizeHint().height())
|
||||||
|
|
||||||
|
self.wrapper_container = WrapperContainer(self.wrapper_label, self.wrapper_scroll)
|
||||||
|
self.wrapper_container.orderChanged.connect(self.__on_order_changed)
|
||||||
|
self.wrapper_scroll.setWidget(self.wrapper_container)
|
||||||
|
|
||||||
# lk: set object names for the stylesheet
|
# lk: set object names for the stylesheet
|
||||||
self.setObjectName("WrapperSettings")
|
self.setObjectName("WrapperSettings")
|
||||||
self.no_wrapper_label.setObjectName(f"{self.objectName()}Label")
|
self.wrapper_label.setObjectName(f"{self.objectName()}Label")
|
||||||
self.wrapper_scroll.setObjectName(f"{self.objectName()}Scroll")
|
|
||||||
self.wrapper_scroll.horizontalScrollBar().setObjectName(
|
|
||||||
f"{self.wrapper_scroll.objectName()}Bar")
|
|
||||||
self.wrapper_scroll.verticalScrollBar().setObjectName(
|
|
||||||
f"{self.wrapper_scroll.objectName()}Bar")
|
|
||||||
|
|
||||||
main_layout = QHBoxLayout(self)
|
main_layout = QHBoxLayout(self)
|
||||||
main_layout.addWidget(self.widget_stack)
|
|
||||||
main_layout.addWidget(self.add_button, alignment=Qt.AlignTop)
|
|
||||||
main_layout.setContentsMargins(0, 0, 0, 0)
|
main_layout.setContentsMargins(0, 0, 0, 0)
|
||||||
main_layout.setAlignment(Qt.AlignTop)
|
main_layout.addWidget(self.wrapper_scroll, alignment=Qt.AlignTop)
|
||||||
|
main_layout.addWidget(self.add_button, alignment=Qt.AlignTop)
|
||||||
|
|
||||||
self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
|
self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
|
||||||
|
|
||||||
self.app_name: str = "default"
|
self.app_name: str = "default"
|
||||||
self.core = RareCore.instance().core()
|
self.core = RareCore.instance().core()
|
||||||
|
@ -223,27 +265,6 @@ class WrapperSettings(QWidget):
|
||||||
self.update_state()
|
self.update_state()
|
||||||
return super().showEvent(a0)
|
return super().showEvent(a0)
|
||||||
|
|
||||||
@pyqtSlot(int, int)
|
|
||||||
def adjust_scrollarea(self, minh: int, maxh: int):
|
|
||||||
wrapper_widget = self.wrapper_container.findChild(WrapperWidget)
|
|
||||||
if not wrapper_widget:
|
|
||||||
return
|
|
||||||
# lk: when the scrollbar is not visible, min and max are 0
|
|
||||||
if maxh > minh:
|
|
||||||
self.wrapper_scroll.setMaximumHeight(
|
|
||||||
wrapper_widget.sizeHint().height()
|
|
||||||
+ self.wrapper_scroll.rect().height() // 2
|
|
||||||
- self.wrapper_scroll.contentsRect().height() // 2
|
|
||||||
+ self.wrapper_container.layout().spacing()
|
|
||||||
+ self.wrapper_scroll.horizontalScrollBar().sizeHint().height()
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
self.wrapper_scroll.setMaximumHeight(
|
|
||||||
wrapper_widget.sizeHint().height()
|
|
||||||
+ self.wrapper_scroll.rect().height()
|
|
||||||
- self.wrapper_scroll.contentsRect().height()
|
|
||||||
)
|
|
||||||
|
|
||||||
@pyqtSlot(QWidget, int)
|
@pyqtSlot(QWidget, int)
|
||||||
def __on_order_changed(self, widget: WrapperWidget, new_index: int):
|
def __on_order_changed(self, widget: WrapperWidget, new_index: int):
|
||||||
wrapper = widget.data()
|
wrapper = widget.data()
|
||||||
|
@ -266,16 +287,12 @@ class WrapperSettings(QWidget):
|
||||||
self.add_user_wrapper(wrapper)
|
self.add_user_wrapper(wrapper)
|
||||||
|
|
||||||
def __add_wrapper(self, wrapper: Wrapper, position: int = -1):
|
def __add_wrapper(self, wrapper: Wrapper, position: int = -1):
|
||||||
self.widget_stack.setCurrentWidget(self.wrapper_scroll)
|
self.wrapper_label.setVisible(False)
|
||||||
widget = WrapperWidget(wrapper, self.wrapper_container)
|
widget = WrapperWidget(wrapper, self.wrapper_container)
|
||||||
if position < 0:
|
if position < 0:
|
||||||
self.wrapper_container.addWidget(widget)
|
self.wrapper_container.addWidget(widget)
|
||||||
else:
|
else:
|
||||||
self.wrapper_container.insertWidget(position, widget)
|
self.wrapper_container.insertWidget(position, widget)
|
||||||
self.adjust_scrollarea(
|
|
||||||
self.wrapper_scroll.horizontalScrollBar().minimum(),
|
|
||||||
self.wrapper_scroll.horizontalScrollBar().maximum(),
|
|
||||||
)
|
|
||||||
widget.update_wrapper.connect(self.__update_wrapper)
|
widget.update_wrapper.connect(self.__update_wrapper)
|
||||||
widget.delete_wrapper.connect(self.__delete_wrapper)
|
widget.delete_wrapper.connect(self.__delete_wrapper)
|
||||||
|
|
||||||
|
@ -304,7 +321,9 @@ class WrapperSettings(QWidget):
|
||||||
|
|
||||||
if wrapper.checksum in self.wrappers.get_game_md5sum_list(self.app_name):
|
if wrapper.checksum in self.wrappers.get_game_md5sum_list(self.app_name):
|
||||||
QMessageBox.warning(
|
QMessageBox.warning(
|
||||||
self, self.tr("Warning"), self.tr("Wrapper <b>{0}</b> is already in the list").format(wrapper.as_str)
|
self,
|
||||||
|
self.tr("Warning"),
|
||||||
|
self.tr("Wrapper <b>{0}</b> is already in the list").format(wrapper.as_str),
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -314,7 +333,7 @@ class WrapperSettings(QWidget):
|
||||||
self.tr("Warning"),
|
self.tr("Warning"),
|
||||||
self.tr("Wrapper <b>{0}</b> is not in $PATH. Add it anyway?").format(wrapper.executable),
|
self.tr("Wrapper <b>{0}</b> is not in $PATH. Add it anyway?").format(wrapper.executable),
|
||||||
QMessageBox.Yes | QMessageBox.No,
|
QMessageBox.Yes | QMessageBox.No,
|
||||||
QMessageBox.No
|
QMessageBox.No,
|
||||||
)
|
)
|
||||||
if ans == QMessageBox.No:
|
if ans == QMessageBox.No:
|
||||||
return
|
return
|
||||||
|
@ -327,8 +346,7 @@ class WrapperSettings(QWidget):
|
||||||
wrappers.remove(wrapper)
|
wrappers.remove(wrapper)
|
||||||
self.wrappers.set_game_wrapper_list(self.app_name, wrappers)
|
self.wrappers.set_game_wrapper_list(self.app_name, wrappers)
|
||||||
if not wrappers:
|
if not wrappers:
|
||||||
self.wrapper_scroll.setMaximumHeight(self.no_wrapper_label.sizeHint().height())
|
self.wrapper_label.setVisible(True)
|
||||||
self.widget_stack.setCurrentWidget(self.no_wrapper_label)
|
|
||||||
|
|
||||||
@pyqtSlot(object, object)
|
@pyqtSlot(object, object)
|
||||||
def __update_wrapper(self, old: Wrapper, new: Wrapper):
|
def __update_wrapper(self, old: Wrapper, new: Wrapper):
|
||||||
|
@ -345,10 +363,7 @@ class WrapperSettings(QWidget):
|
||||||
w.deleteLater()
|
w.deleteLater()
|
||||||
wrappers = self.wrappers.get_game_wrapper_list(self.app_name)
|
wrappers = self.wrappers.get_game_wrapper_list(self.app_name)
|
||||||
if not wrappers:
|
if not wrappers:
|
||||||
self.wrapper_scroll.setMaximumHeight(self.no_wrapper_label.sizeHint().height())
|
self.wrapper_label.setVisible(True)
|
||||||
self.widget_stack.setCurrentWidget(self.no_wrapper_label)
|
|
||||||
else:
|
|
||||||
self.widget_stack.setCurrentWidget(self.wrapper_scroll)
|
|
||||||
for wrapper in wrappers:
|
for wrapper in wrappers:
|
||||||
self.__add_wrapper(wrapper)
|
self.__add_wrapper(wrapper)
|
||||||
|
|
||||||
|
@ -357,15 +372,19 @@ class WrapperContainer(QWidget):
|
||||||
# QWidget: moving widget, int: new index
|
# QWidget: moving widget, int: new index
|
||||||
orderChanged: pyqtSignal = pyqtSignal(QWidget, int)
|
orderChanged: pyqtSignal = pyqtSignal(QWidget, int)
|
||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, label: QLabel, parent=None):
|
||||||
super(WrapperContainer, self).__init__(parent=parent)
|
super(WrapperContainer, self).__init__(parent=parent)
|
||||||
self.setAcceptDrops(True)
|
self.setAcceptDrops(True)
|
||||||
self.__layout = QHBoxLayout(self)
|
self.__layout = QHBoxLayout()
|
||||||
self.__layout.setContentsMargins(0, 0, 0, 0)
|
|
||||||
self.__layout.setAlignment(Qt.AlignLeft | Qt.AlignTop)
|
|
||||||
|
|
||||||
self.__drag_widget: Optional[QWidget] = None
|
self.__drag_widget: Optional[QWidget] = None
|
||||||
|
|
||||||
|
main_layout = QHBoxLayout(self)
|
||||||
|
main_layout.addWidget(label)
|
||||||
|
main_layout.addLayout(self.__layout)
|
||||||
|
main_layout.setContentsMargins(0, 0, 0, 0)
|
||||||
|
main_layout.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
|
||||||
|
main_layout.setSizeConstraint(QHBoxLayout.SetFixedSize)
|
||||||
|
|
||||||
# lk: set object names for the stylesheet
|
# lk: set object names for the stylesheet
|
||||||
self.setObjectName(type(self).__name__)
|
self.setObjectName(type(self).__name__)
|
||||||
|
|
||||||
|
|
|
@ -2,22 +2,22 @@
|
||||||
Active\AlternateBase=#fff7f7f7
|
Active\AlternateBase=#fff7f7f7
|
||||||
Active\Base=#ff333344
|
Active\Base=#ff333344
|
||||||
Active\BrightText=#ffffffff
|
Active\BrightText=#ffffffff
|
||||||
Active\Button=#ff3c3f41
|
Active\Button=#ff272a2e
|
||||||
Active\ButtonText=#ffeeeeee
|
Active\ButtonText=#ffeeeeee
|
||||||
Active\Dark=#ff9f0910
|
Active\Dark=#ff232529
|
||||||
Active\Highlight=#ff2f4f4f
|
Active\Highlight=#ff385e5e
|
||||||
Active\HighlightedText=#ffeeeeee
|
Active\HighlightedText=#ffeeeeee
|
||||||
Active\Light=#ffffffff
|
Active\Light=#ff2c2f33
|
||||||
Active\Link=#ff0000ff
|
Active\Link=#ff0000dd
|
||||||
Active\LinkVisited=#ffff00ff
|
Active\LinkVisited=#ffff00ff
|
||||||
Active\Mid=#ffb80e35
|
Active\Mid=#ff25272b
|
||||||
Active\Midlight=#ffca0651
|
Active\Midlight=#ff292c30
|
||||||
Active\PlaceholderText=#80eeeeee
|
Active\PlaceholderText=#80eeeeee
|
||||||
Active\Shadow=#ff767676
|
Active\Shadow=#ff0b0c0d
|
||||||
Active\Text=#ffeeeeee
|
Active\Text=#ffeeeeee
|
||||||
Active\ToolTipBase=#ffffffdc
|
Active\ToolTipBase=#ffffffdc
|
||||||
Active\ToolTipText=#ffeeeeee
|
Active\ToolTipText=#ffeeeeee
|
||||||
Active\Window=#ff202225
|
Active\Window=#ff212226
|
||||||
Active\WindowText=#ffeeeeee
|
Active\WindowText=#ffeeeeee
|
||||||
Disabled\ButtonText=#ff808080
|
Disabled\ButtonText=#ff808080
|
||||||
Disabled\HighlightedText=#ff808080
|
Disabled\HighlightedText=#ff808080
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -77,6 +77,7 @@ QScrollBar {
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
QHeaderView::section,
|
QHeaderView::section,
|
||||||
QTableView QTableCornerButton::section,
|
QTableView QTableCornerButton::section,
|
||||||
QLineEdit,
|
QLineEdit,
|
||||||
|
@ -104,21 +105,16 @@ QComboBox,
|
||||||
QSpinBox,
|
QSpinBox,
|
||||||
QDoubleSpinBox,
|
QDoubleSpinBox,
|
||||||
QProgressBar,
|
QProgressBar,
|
||||||
|
QScrollArea,
|
||||||
QPushButton {
|
QPushButton {
|
||||||
min-height: 1.30em;
|
min-height: 3.00ex;
|
||||||
}
|
/* min-height: 1.30em; */
|
||||||
QLineEdit,
|
/* min-height: 18px; */
|
||||||
QTextEdit
|
|
||||||
QTimeEdit,
|
|
||||||
QDateEdit,
|
|
||||||
QDateTimeEdit,
|
|
||||||
QSpinBox,
|
|
||||||
QDoubleSpinBox,
|
|
||||||
QProgressBar {
|
|
||||||
max-height: 1.30em;
|
|
||||||
}
|
}
|
||||||
QToolButton {
|
QToolButton {
|
||||||
min-height: 1.10em;
|
min-height: 3.00ex;
|
||||||
|
/* min-height: 1.10em; */
|
||||||
|
/* min-height: 15px; */
|
||||||
}
|
}
|
||||||
|
|
||||||
QFrame[frameShape="0"] {
|
QFrame[frameShape="0"] {
|
||||||
|
@ -188,14 +184,19 @@ QComboBox QAbstractItemView {
|
||||||
border-top-width: 1;
|
border-top-width: 1;
|
||||||
image: url(":/stylesheets/ChildOfMetropolis/sort-down.svg");
|
image: url(":/stylesheets/ChildOfMetropolis/sort-down.svg");
|
||||||
}
|
}
|
||||||
|
|
||||||
QProgressBar {
|
QProgressBar {
|
||||||
|
padding: 0px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
QProgressBar::chunk {
|
QProgressBar::chunk {
|
||||||
|
padding: 0px;
|
||||||
|
border-width: 0px;
|
||||||
width: 2%;
|
width: 2%;
|
||||||
margin: 0%;
|
margin: 0px;
|
||||||
background-color: #71DA7E;
|
background-color: #71DA7E;
|
||||||
}
|
}
|
||||||
|
|
||||||
QScrollBar {
|
QScrollBar {
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
padding: 1px;
|
padding: 1px;
|
||||||
|
@ -673,7 +674,7 @@ QTabBar#MainTabBar::tab {
|
||||||
margin-right: 3px;
|
margin-right: 3px;
|
||||||
border-top-color: transparent;
|
border-top-color: transparent;
|
||||||
border-bottom-color: #5CD3FF;
|
border-bottom-color: #5CD3FF;
|
||||||
padding: 5px;
|
padding: 3px 5px;
|
||||||
}/*
|
}/*
|
||||||
QTabBar#MainTabBar::tab:top:first,
|
QTabBar#MainTabBar::tab:top:first,
|
||||||
QTabBar#MainTabBar::tab:bottom:first {
|
QTabBar#MainTabBar::tab:bottom:first {
|
||||||
|
@ -749,6 +750,7 @@ QLineEdit#SearchBar {
|
||||||
/* Wrapper settings styling */
|
/* Wrapper settings styling */
|
||||||
QPushButton#WrapperWidgetButton,
|
QPushButton#WrapperWidgetButton,
|
||||||
QToolButton#WrapperWidgetButton {
|
QToolButton#WrapperWidgetButton {
|
||||||
|
padding: 0px;
|
||||||
border-color: #DADDDE;
|
border-color: #DADDDE;
|
||||||
}
|
}
|
||||||
QPushButton#WrapperWidgetButton:disabled,
|
QPushButton#WrapperWidgetButton:disabled,
|
||||||
|
@ -762,6 +764,7 @@ QScrollArea#WrapperSettingsScroll {
|
||||||
QScrollBar#WrapperSettingsScrollBar {
|
QScrollBar#WrapperSettingsScrollBar {
|
||||||
background-color: #BCBEBF;
|
background-color: #BCBEBF;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
QLabel#WrapperSettingsLabel {
|
QLabel#WrapperSettingsLabel {
|
||||||
border-width: 1px;
|
border-width: 1px;
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
|
@ -775,3 +778,4 @@ QLabel#WrapperSettingsLabel:disabled {
|
||||||
border-color: rgb( 67, 71, 77);
|
border-color: rgb( 67, 71, 77);
|
||||||
background-color: rgb( 32, 34, 37);
|
background-color: rgb( 32, 34, 37);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
Binary file not shown.
|
@ -8,7 +8,7 @@ disabled: #43474d rgb( 67, 71, 77) -- disabled font color
|
||||||
normal: #202225 rgb( 32, 34, 37) -- main background color
|
normal: #202225 rgb( 32, 34, 37) -- main background color
|
||||||
editable: #272733 rgb( 38, 38, 51) -- background color for reactive/editable widgets (TextEdits, ProgressBars etc)
|
editable: #272733 rgb( 38, 38, 51) -- background color for reactive/editable widgets (TextEdits, ProgressBars etc)
|
||||||
hover: #222233 rgb( 34, 34, 51) -- background color when hovering over reactive widgets (Buttons, Headers)
|
hover: #222233 rgb( 34, 34, 51) -- background color when hovering over reactive widgets (Buttons, Headers)
|
||||||
selection: #2f4f4f rgb( 47, 79, 79) -- background color for selectable widgets
|
selection: #274242 rgb( 39, 66, 66) -- background color for selectable widgets
|
||||||
alternate: #282a2e rgb( 40, 42, 46) -- background color for alternating rows in List/Tree/TableViews and for ScrollBars
|
alternate: #282a2e rgb( 40, 42, 46) -- background color for alternating rows in List/Tree/TableViews and for ScrollBars
|
||||||
|
|
||||||
[Border]
|
[Border]
|
||||||
|
@ -45,7 +45,7 @@ QLabel:disabled {
|
||||||
border-width: 0px;
|
border-width: 0px;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
selection-background-color: rgb( 47, 79, 79);
|
selection-background-color: rgb( 39, 66, 66);
|
||||||
}
|
}
|
||||||
|
|
||||||
QMenu,
|
QMenu,
|
||||||
|
@ -77,6 +77,7 @@ QScrollBar {
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
QHeaderView::section,
|
QHeaderView::section,
|
||||||
QTableView QTableCornerButton::section,
|
QTableView QTableCornerButton::section,
|
||||||
QLineEdit,
|
QLineEdit,
|
||||||
|
@ -92,7 +93,7 @@ QProgressBar,
|
||||||
QScrollBar {
|
QScrollBar {
|
||||||
border-color: rgb( 47, 79, 79);
|
border-color: rgb( 47, 79, 79);
|
||||||
background-color: rgb( 38, 38, 51);
|
background-color: rgb( 38, 38, 51);
|
||||||
selection-background-color: rgb( 47, 79, 79);
|
selection-background-color: rgb( 39, 66, 66);
|
||||||
}
|
}
|
||||||
|
|
||||||
QLineEdit,
|
QLineEdit,
|
||||||
|
@ -104,24 +105,16 @@ QComboBox,
|
||||||
QSpinBox,
|
QSpinBox,
|
||||||
QDoubleSpinBox,
|
QDoubleSpinBox,
|
||||||
QProgressBar,
|
QProgressBar,
|
||||||
|
QScrollArea,
|
||||||
QPushButton {
|
QPushButton {
|
||||||
|
min-height: 3.00ex;
|
||||||
/* min-height: 1.30em; */
|
/* min-height: 1.30em; */
|
||||||
min-height: 18px;
|
/* min-height: 18px; */
|
||||||
}
|
|
||||||
QLineEdit,
|
|
||||||
QTextEdit
|
|
||||||
QTimeEdit,
|
|
||||||
QDateEdit,
|
|
||||||
QDateTimeEdit,
|
|
||||||
QSpinBox,
|
|
||||||
QDoubleSpinBox,
|
|
||||||
QProgressBar {
|
|
||||||
/* max-height: 1.30em; */
|
|
||||||
max-height: 18px;
|
|
||||||
}
|
}
|
||||||
QToolButton {
|
QToolButton {
|
||||||
|
min-height: 3.00ex;
|
||||||
/* min-height: 1.10em; */
|
/* min-height: 1.10em; */
|
||||||
min-height: 15px;
|
/* min-height: 15px; */
|
||||||
}
|
}
|
||||||
|
|
||||||
QFrame[frameShape="0"] {
|
QFrame[frameShape="0"] {
|
||||||
|
@ -141,7 +134,7 @@ QComboBox:!editable:hover {
|
||||||
}
|
}
|
||||||
*::item:selected,
|
*::item:selected,
|
||||||
QComboBox QAbstractItemView {
|
QComboBox QAbstractItemView {
|
||||||
selection-background-color: rgb( 47, 79, 79);
|
selection-background-color: rgb( 39, 66, 66);
|
||||||
}
|
}
|
||||||
*::drop-down,
|
*::drop-down,
|
||||||
*::drop-down:editable,
|
*::drop-down:editable,
|
||||||
|
@ -191,14 +184,19 @@ QComboBox QAbstractItemView {
|
||||||
border-top-width: 1;
|
border-top-width: 1;
|
||||||
image: url(":/stylesheets/RareStyle/sort-down.svg");
|
image: url(":/stylesheets/RareStyle/sort-down.svg");
|
||||||
}
|
}
|
||||||
|
|
||||||
QProgressBar {
|
QProgressBar {
|
||||||
|
padding: 0px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
QProgressBar::chunk {
|
QProgressBar::chunk {
|
||||||
|
padding: 0px;
|
||||||
|
border-width: 0px;
|
||||||
width: 2%;
|
width: 2%;
|
||||||
margin: 0%;
|
margin: 0px;
|
||||||
background-color: rgb( 47, 79, 79);
|
background-color: rgb( 39, 66, 66);
|
||||||
}
|
}
|
||||||
|
|
||||||
QScrollBar {
|
QScrollBar {
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
padding: 1px;
|
padding: 1px;
|
||||||
|
@ -303,7 +301,7 @@ QListView::item:selected,
|
||||||
QTreeView::item:selected,
|
QTreeView::item:selected,
|
||||||
QTableView::item:selected {
|
QTableView::item:selected {
|
||||||
border-color: rgb( 72, 61, 139);
|
border-color: rgb( 72, 61, 139);
|
||||||
background-color: rgb( 47, 79, 79);
|
background-color: rgb( 39, 66, 66);
|
||||||
}
|
}
|
||||||
|
|
||||||
QPushButton,
|
QPushButton,
|
||||||
|
@ -766,6 +764,7 @@ QScrollArea#WrapperSettingsScroll {
|
||||||
QScrollBar#WrapperSettingsScrollBar {
|
QScrollBar#WrapperSettingsScrollBar {
|
||||||
background-color: rgb( 40, 42, 46);
|
background-color: rgb( 40, 42, 46);
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
QLabel#WrapperSettingsLabel {
|
QLabel#WrapperSettingsLabel {
|
||||||
border-width: 1px;
|
border-width: 1px;
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
|
@ -779,3 +778,4 @@ QLabel#WrapperSettingsLabel:disabled {
|
||||||
border-color: rgb( 67, 71, 77);
|
border-color: rgb( 67, 71, 77);
|
||||||
background-color: rgb( 32, 34, 37);
|
background-color: rgb( 32, 34, 37);
|
||||||
}
|
}
|
||||||
|
*/
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
# Form implementation generated from reading ui file 'rare/ui/components/tabs/downloads/download_widget.ui'
|
# Form implementation generated from reading ui file 'rare/ui/components/tabs/downloads/download_widget.ui'
|
||||||
#
|
#
|
||||||
# Created by: PyQt5 UI code generator 5.15.8
|
# Created by: PyQt5 UI code generator 5.15.10
|
||||||
#
|
#
|
||||||
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
|
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
|
||||||
# run again. Do not edit this file unless you know what you are doing.
|
# run again. Do not edit this file unless you know what you are doing.
|
||||||
|
@ -14,28 +14,24 @@ from PyQt5 import QtCore, QtGui, QtWidgets
|
||||||
class Ui_DownloadWidget(object):
|
class Ui_DownloadWidget(object):
|
||||||
def setupUi(self, DownloadWidget):
|
def setupUi(self, DownloadWidget):
|
||||||
DownloadWidget.setObjectName("DownloadWidget")
|
DownloadWidget.setObjectName("DownloadWidget")
|
||||||
DownloadWidget.resize(490, 90)
|
DownloadWidget.resize(479, 86)
|
||||||
DownloadWidget.setWindowTitle("DownloadWidget")
|
DownloadWidget.setWindowTitle("DownloadWidget")
|
||||||
self.active_download_layout = QtWidgets.QGridLayout(DownloadWidget)
|
self.active_download_layout = QtWidgets.QGridLayout(DownloadWidget)
|
||||||
self.active_download_layout.setContentsMargins(0, 0, 0, 0)
|
self.active_download_layout.setContentsMargins(0, 0, 0, 0)
|
||||||
self.active_download_layout.setObjectName("active_download_layout")
|
self.active_download_layout.setObjectName("active_download_layout")
|
||||||
self.downloaded = QtWidgets.QLabel(DownloadWidget)
|
self.dl_name = QtWidgets.QLabel(DownloadWidget)
|
||||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
|
||||||
sizePolicy.setHorizontalStretch(0)
|
sizePolicy.setHorizontalStretch(0)
|
||||||
sizePolicy.setVerticalStretch(0)
|
sizePolicy.setVerticalStretch(0)
|
||||||
sizePolicy.setHeightForWidth(self.downloaded.sizePolicy().hasHeightForWidth())
|
sizePolicy.setHeightForWidth(self.dl_name.sizePolicy().hasHeightForWidth())
|
||||||
self.downloaded.setSizePolicy(sizePolicy)
|
self.dl_name.setSizePolicy(sizePolicy)
|
||||||
self.downloaded.setText("downloaded")
|
|
||||||
self.downloaded.setObjectName("downloaded")
|
|
||||||
self.active_download_layout.addWidget(self.downloaded, 2, 3, 1, 1)
|
|
||||||
self.dl_speed_label = QtWidgets.QLabel(DownloadWidget)
|
|
||||||
font = QtGui.QFont()
|
font = QtGui.QFont()
|
||||||
font.setBold(True)
|
font.setBold(False)
|
||||||
font.setWeight(75)
|
font.setWeight(50)
|
||||||
self.dl_speed_label.setFont(font)
|
self.dl_name.setFont(font)
|
||||||
self.dl_speed_label.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
self.dl_name.setText("dl_name")
|
||||||
self.dl_speed_label.setObjectName("dl_speed_label")
|
self.dl_name.setObjectName("dl_name")
|
||||||
self.active_download_layout.addWidget(self.dl_speed_label, 1, 2, 1, 1)
|
self.active_download_layout.addWidget(self.dl_name, 0, 1, 1, 3)
|
||||||
self.dl_name_label = QtWidgets.QLabel(DownloadWidget)
|
self.dl_name_label = QtWidgets.QLabel(DownloadWidget)
|
||||||
font = QtGui.QFont()
|
font = QtGui.QFont()
|
||||||
font.setBold(True)
|
font.setBold(True)
|
||||||
|
@ -53,15 +49,14 @@ class Ui_DownloadWidget(object):
|
||||||
self.cache_used.setText("cache_used")
|
self.cache_used.setText("cache_used")
|
||||||
self.cache_used.setObjectName("cache_used")
|
self.cache_used.setObjectName("cache_used")
|
||||||
self.active_download_layout.addWidget(self.cache_used, 2, 1, 1, 1)
|
self.active_download_layout.addWidget(self.cache_used, 2, 1, 1, 1)
|
||||||
self.time_left = QtWidgets.QLabel(DownloadWidget)
|
self.dl_speed_label = QtWidgets.QLabel(DownloadWidget)
|
||||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
|
font = QtGui.QFont()
|
||||||
sizePolicy.setHorizontalStretch(0)
|
font.setBold(True)
|
||||||
sizePolicy.setVerticalStretch(0)
|
font.setWeight(75)
|
||||||
sizePolicy.setHeightForWidth(self.time_left.sizePolicy().hasHeightForWidth())
|
self.dl_speed_label.setFont(font)
|
||||||
self.time_left.setSizePolicy(sizePolicy)
|
self.dl_speed_label.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
||||||
self.time_left.setText("time_left")
|
self.dl_speed_label.setObjectName("dl_speed_label")
|
||||||
self.time_left.setObjectName("time_left")
|
self.active_download_layout.addWidget(self.dl_speed_label, 1, 2, 1, 1)
|
||||||
self.active_download_layout.addWidget(self.time_left, 1, 1, 1, 1)
|
|
||||||
self.downloaded_label = QtWidgets.QLabel(DownloadWidget)
|
self.downloaded_label = QtWidgets.QLabel(DownloadWidget)
|
||||||
font = QtGui.QFont()
|
font = QtGui.QFont()
|
||||||
font.setBold(True)
|
font.setBold(True)
|
||||||
|
@ -79,27 +74,6 @@ class Ui_DownloadWidget(object):
|
||||||
self.dl_speed.setText("dl_speed")
|
self.dl_speed.setText("dl_speed")
|
||||||
self.dl_speed.setObjectName("dl_speed")
|
self.dl_speed.setObjectName("dl_speed")
|
||||||
self.active_download_layout.addWidget(self.dl_speed, 1, 3, 1, 1)
|
self.active_download_layout.addWidget(self.dl_speed, 1, 3, 1, 1)
|
||||||
self.cache_used_label = QtWidgets.QLabel(DownloadWidget)
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setBold(True)
|
|
||||||
font.setWeight(75)
|
|
||||||
self.cache_used_label.setFont(font)
|
|
||||||
self.cache_used_label.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
|
||||||
self.cache_used_label.setObjectName("cache_used_label")
|
|
||||||
self.active_download_layout.addWidget(self.cache_used_label, 2, 0, 1, 1)
|
|
||||||
self.dl_name = QtWidgets.QLabel(DownloadWidget)
|
|
||||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
|
|
||||||
sizePolicy.setHorizontalStretch(0)
|
|
||||||
sizePolicy.setVerticalStretch(0)
|
|
||||||
sizePolicy.setHeightForWidth(self.dl_name.sizePolicy().hasHeightForWidth())
|
|
||||||
self.dl_name.setSizePolicy(sizePolicy)
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setBold(False)
|
|
||||||
font.setWeight(50)
|
|
||||||
self.dl_name.setFont(font)
|
|
||||||
self.dl_name.setText("dl_name")
|
|
||||||
self.dl_name.setObjectName("dl_name")
|
|
||||||
self.active_download_layout.addWidget(self.dl_name, 0, 1, 1, 3)
|
|
||||||
self.time_left_label = QtWidgets.QLabel(DownloadWidget)
|
self.time_left_label = QtWidgets.QLabel(DownloadWidget)
|
||||||
font = QtGui.QFont()
|
font = QtGui.QFont()
|
||||||
font.setBold(True)
|
font.setBold(True)
|
||||||
|
@ -108,23 +82,39 @@ class Ui_DownloadWidget(object):
|
||||||
self.time_left_label.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
self.time_left_label.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
||||||
self.time_left_label.setObjectName("time_left_label")
|
self.time_left_label.setObjectName("time_left_label")
|
||||||
self.active_download_layout.addWidget(self.time_left_label, 1, 0, 1, 1)
|
self.active_download_layout.addWidget(self.time_left_label, 1, 0, 1, 1)
|
||||||
self.kill_button = QtWidgets.QPushButton(DownloadWidget)
|
self.downloaded = QtWidgets.QLabel(DownloadWidget)
|
||||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
|
||||||
sizePolicy.setHorizontalStretch(0)
|
sizePolicy.setHorizontalStretch(0)
|
||||||
sizePolicy.setVerticalStretch(0)
|
sizePolicy.setVerticalStretch(0)
|
||||||
sizePolicy.setHeightForWidth(self.kill_button.sizePolicy().hasHeightForWidth())
|
sizePolicy.setHeightForWidth(self.downloaded.sizePolicy().hasHeightForWidth())
|
||||||
self.kill_button.setSizePolicy(sizePolicy)
|
self.downloaded.setSizePolicy(sizePolicy)
|
||||||
self.kill_button.setObjectName("kill_button")
|
self.downloaded.setText("downloaded")
|
||||||
self.active_download_layout.addWidget(self.kill_button, 3, 4, 1, 1)
|
self.downloaded.setObjectName("downloaded")
|
||||||
|
self.active_download_layout.addWidget(self.downloaded, 2, 3, 1, 1)
|
||||||
|
self.time_left = QtWidgets.QLabel(DownloadWidget)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
|
||||||
|
sizePolicy.setHorizontalStretch(0)
|
||||||
|
sizePolicy.setVerticalStretch(0)
|
||||||
|
sizePolicy.setHeightForWidth(self.time_left.sizePolicy().hasHeightForWidth())
|
||||||
|
self.time_left.setSizePolicy(sizePolicy)
|
||||||
|
self.time_left.setText("time_left")
|
||||||
|
self.time_left.setObjectName("time_left")
|
||||||
|
self.active_download_layout.addWidget(self.time_left, 1, 1, 1, 1)
|
||||||
|
self.cache_used_label = QtWidgets.QLabel(DownloadWidget)
|
||||||
|
font = QtGui.QFont()
|
||||||
|
font.setBold(True)
|
||||||
|
font.setWeight(75)
|
||||||
|
self.cache_used_label.setFont(font)
|
||||||
|
self.cache_used_label.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
||||||
|
self.cache_used_label.setObjectName("cache_used_label")
|
||||||
|
self.active_download_layout.addWidget(self.cache_used_label, 2, 0, 1, 1)
|
||||||
self.progress_bar = QtWidgets.QProgressBar(DownloadWidget)
|
self.progress_bar = QtWidgets.QProgressBar(DownloadWidget)
|
||||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Maximum)
|
|
||||||
sizePolicy.setHorizontalStretch(0)
|
|
||||||
sizePolicy.setVerticalStretch(0)
|
|
||||||
sizePolicy.setHeightForWidth(self.progress_bar.sizePolicy().hasHeightForWidth())
|
|
||||||
self.progress_bar.setSizePolicy(sizePolicy)
|
|
||||||
self.progress_bar.setProperty("value", 0)
|
self.progress_bar.setProperty("value", 0)
|
||||||
self.progress_bar.setObjectName("progress_bar")
|
self.progress_bar.setObjectName("progress_bar")
|
||||||
self.active_download_layout.addWidget(self.progress_bar, 3, 0, 1, 4)
|
self.active_download_layout.addWidget(self.progress_bar, 3, 0, 1, 4)
|
||||||
|
self.kill_button = QtWidgets.QPushButton(DownloadWidget)
|
||||||
|
self.kill_button.setObjectName("kill_button")
|
||||||
|
self.active_download_layout.addWidget(self.kill_button, 3, 4, 1, 1)
|
||||||
self.active_download_layout.setColumnStretch(1, 1)
|
self.active_download_layout.setColumnStretch(1, 1)
|
||||||
self.active_download_layout.setColumnStretch(3, 1)
|
self.active_download_layout.setColumnStretch(3, 1)
|
||||||
|
|
||||||
|
@ -132,11 +122,11 @@ class Ui_DownloadWidget(object):
|
||||||
|
|
||||||
def retranslateUi(self, DownloadWidget):
|
def retranslateUi(self, DownloadWidget):
|
||||||
_translate = QtCore.QCoreApplication.translate
|
_translate = QtCore.QCoreApplication.translate
|
||||||
self.dl_speed_label.setText(_translate("DownloadWidget", "Download speed:"))
|
|
||||||
self.dl_name_label.setText(_translate("DownloadWidget", "Current download:"))
|
self.dl_name_label.setText(_translate("DownloadWidget", "Current download:"))
|
||||||
|
self.dl_speed_label.setText(_translate("DownloadWidget", "Download speed:"))
|
||||||
self.downloaded_label.setText(_translate("DownloadWidget", "Downloaded:"))
|
self.downloaded_label.setText(_translate("DownloadWidget", "Downloaded:"))
|
||||||
self.cache_used_label.setText(_translate("DownloadWidget", "Cache size:"))
|
|
||||||
self.time_left_label.setText(_translate("DownloadWidget", "Time left:"))
|
self.time_left_label.setText(_translate("DownloadWidget", "Time left:"))
|
||||||
|
self.cache_used_label.setText(_translate("DownloadWidget", "Cache size:"))
|
||||||
self.kill_button.setText(_translate("DownloadWidget", "Stop Download"))
|
self.kill_button.setText(_translate("DownloadWidget", "Stop Download"))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>490</width>
|
<width>479</width>
|
||||||
<height>90</height>
|
<height>86</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -26,32 +26,22 @@
|
||||||
<property name="bottomMargin">
|
<property name="bottomMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="2" column="3">
|
<item row="0" column="1" colspan="3">
|
||||||
<widget class="QLabel" name="downloaded">
|
<widget class="QLabel" name="dl_name">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
|
||||||
<string notr="true">downloaded</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="2">
|
|
||||||
<widget class="QLabel" name="dl_speed_label">
|
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<weight>75</weight>
|
<weight>50</weight>
|
||||||
<bold>true</bold>
|
<bold>false</bold>
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Download speed:</string>
|
<string notr="true">dl_name</string>
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -84,16 +74,19 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="2">
|
||||||
<widget class="QLabel" name="time_left">
|
<widget class="QLabel" name="dl_speed_label">
|
||||||
<property name="sizePolicy">
|
<property name="font">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
<font>
|
||||||
<horstretch>0</horstretch>
|
<weight>75</weight>
|
||||||
<verstretch>0</verstretch>
|
<bold>true</bold>
|
||||||
</sizepolicy>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string notr="true">time_left</string>
|
<string>Download speed:</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -126,41 +119,6 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="cache_used_label">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<weight>75</weight>
|
|
||||||
<bold>true</bold>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Cache size:</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1" colspan="3">
|
|
||||||
<widget class="QLabel" name="dl_name">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<weight>50</weight>
|
|
||||||
<bold>false</bold>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true">dl_name</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="time_left_label">
|
<widget class="QLabel" name="time_left_label">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
|
@ -177,32 +135,62 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="4">
|
<item row="2" column="3">
|
||||||
<widget class="QPushButton" name="kill_button">
|
<widget class="QLabel" name="downloaded">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Stop Download</string>
|
<string notr="true">downloaded</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QLabel" name="time_left">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">time_left</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="cache_used_label">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Cache size:</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0" colspan="4">
|
<item row="3" column="0" colspan="4">
|
||||||
<widget class="QProgressBar" name="progress_bar">
|
<widget class="QProgressBar" name="progress_bar">
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
<property name="value">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="3" column="4">
|
||||||
|
<widget class="QPushButton" name="kill_button">
|
||||||
|
<property name="text">
|
||||||
|
<string>Stop Download</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
|
|
|
@ -25,7 +25,7 @@ class Ui_LegendarySettings(object):
|
||||||
self.install_dir_group.setObjectName("install_dir_group")
|
self.install_dir_group.setObjectName("install_dir_group")
|
||||||
self.install_dir_layout = QtWidgets.QVBoxLayout(self.install_dir_group)
|
self.install_dir_layout = QtWidgets.QVBoxLayout(self.install_dir_group)
|
||||||
self.install_dir_layout.setObjectName("install_dir_layout")
|
self.install_dir_layout.setObjectName("install_dir_layout")
|
||||||
self.left_layout.addWidget(self.install_dir_group, 0, QtCore.Qt.AlignTop)
|
self.left_layout.addWidget(self.install_dir_group)
|
||||||
self.download_group = QtWidgets.QGroupBox(LegendarySettings)
|
self.download_group = QtWidgets.QGroupBox(LegendarySettings)
|
||||||
self.download_group.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
|
self.download_group.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
|
||||||
self.download_group.setObjectName("download_group")
|
self.download_group.setObjectName("download_group")
|
||||||
|
@ -97,7 +97,7 @@ class Ui_LegendarySettings(object):
|
||||||
self.disable_https_check.setText("")
|
self.disable_https_check.setText("")
|
||||||
self.disable_https_check.setObjectName("disable_https_check")
|
self.disable_https_check.setObjectName("disable_https_check")
|
||||||
self.download_layout.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.disable_https_check)
|
self.download_layout.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.disable_https_check)
|
||||||
self.left_layout.addWidget(self.download_group, 0, QtCore.Qt.AlignTop)
|
self.left_layout.addWidget(self.download_group)
|
||||||
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||||
self.left_layout.addItem(spacerItem)
|
self.left_layout.addItem(spacerItem)
|
||||||
self.legendary_layout.addLayout(self.left_layout)
|
self.legendary_layout.addLayout(self.left_layout)
|
||||||
|
@ -113,7 +113,7 @@ class Ui_LegendarySettings(object):
|
||||||
self.locale_group.setObjectName("locale_group")
|
self.locale_group.setObjectName("locale_group")
|
||||||
self.locale_layout = QtWidgets.QVBoxLayout(self.locale_group)
|
self.locale_layout = QtWidgets.QVBoxLayout(self.locale_group)
|
||||||
self.locale_layout.setObjectName("locale_layout")
|
self.locale_layout.setObjectName("locale_layout")
|
||||||
self.right_layout.addWidget(self.locale_group, 0, QtCore.Qt.AlignTop)
|
self.right_layout.addWidget(self.locale_group)
|
||||||
self.cleanup_group = QtWidgets.QGroupBox(LegendarySettings)
|
self.cleanup_group = QtWidgets.QGroupBox(LegendarySettings)
|
||||||
self.cleanup_group.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
|
self.cleanup_group.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
|
||||||
self.cleanup_group.setObjectName("cleanup_group")
|
self.cleanup_group.setObjectName("cleanup_group")
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<layout class="QHBoxLayout" name="legendary_layout">
|
<layout class="QHBoxLayout" name="legendary_layout">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="left_layout">
|
<layout class="QVBoxLayout" name="left_layout">
|
||||||
<item alignment="Qt::AlignTop">
|
<item>
|
||||||
<widget class="QGroupBox" name="install_dir_group">
|
<widget class="QGroupBox" name="install_dir_group">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Default installation folder</string>
|
<string>Default installation folder</string>
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
<layout class="QVBoxLayout" name="install_dir_layout"/>
|
<layout class="QVBoxLayout" name="install_dir_layout"/>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item alignment="Qt::AlignTop">
|
<item>
|
||||||
<widget class="QGroupBox" name="download_group">
|
<widget class="QGroupBox" name="download_group">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Download settings</string>
|
<string>Download settings</string>
|
||||||
|
@ -183,7 +183,7 @@
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="right_layout">
|
<layout class="QVBoxLayout" name="right_layout">
|
||||||
<item alignment="Qt::AlignTop">
|
<item>
|
||||||
<widget class="QGroupBox" name="locale_group">
|
<widget class="QGroupBox" name="locale_group">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
|
|
@ -123,19 +123,19 @@ class ButtonLineEdit(QLineEdit):
|
||||||
self.button.clicked.connect(self.buttonClicked.emit)
|
self.button.clicked.connect(self.buttonClicked.emit)
|
||||||
|
|
||||||
self.setPlaceholderText(placeholder_text)
|
self.setPlaceholderText(placeholder_text)
|
||||||
frame_width = self.style().pixelMetric(QStyle.PM_DefaultFrameWidth)
|
# frame_width = self.style().pixelMetric(QStyle.PM_DefaultFrameWidth)
|
||||||
button_size = self.button.sizeHint()
|
# button_size = self.button.sizeHint()
|
||||||
|
#
|
||||||
self.setStyleSheet(
|
# self.setStyleSheet(
|
||||||
f"QLineEdit#{self.objectName()} {{padding-right: {(button_size.width() + frame_width + 1)}px; }}"
|
# f"QLineEdit#{self.objectName()} {{padding-right: {(button_size.width() + frame_width + 1)}px; }}"
|
||||||
)
|
# )
|
||||||
self.setMinimumSize(
|
# self.setMinimumSize(
|
||||||
max(self.minimumSizeHint().width(), button_size.width() + frame_width * 2 + 2),
|
# max(self.minimumSizeHint().width(), button_size.width() + frame_width * 2 + 2),
|
||||||
max(
|
# max(
|
||||||
self.minimumSizeHint().height(),
|
# self.minimumSizeHint().height(),
|
||||||
button_size.height() + frame_width * 2 + 2,
|
# button_size.height() + frame_width * 2 + 2,
|
||||||
),
|
# ),
|
||||||
)
|
# )
|
||||||
|
|
||||||
def resizeEvent(self, event):
|
def resizeEvent(self, event):
|
||||||
frame_width = self.style().pixelMetric(QStyle.PM_DefaultFrameWidth)
|
frame_width = self.style().pixelMetric(QStyle.PM_DefaultFrameWidth)
|
||||||
|
|
|
@ -136,7 +136,7 @@ class ImageWidget(QWidget):
|
||||||
painter.setOpacity(1.0)
|
painter.setOpacity(1.0)
|
||||||
painter.setCompositionMode(QPainter.CompositionMode_Source)
|
painter.setCompositionMode(QPainter.CompositionMode_Source)
|
||||||
overlay, _ = self._generate_rounded_overlay()
|
overlay, _ = self._generate_rounded_overlay()
|
||||||
painter.fillPath(overlay, self.palette().color(QPalette.Background))
|
painter.fillPath(overlay, self.palette().color(QPalette.Window))
|
||||||
|
|
||||||
def paint_overlay_squared(self, painter: QPainter, a0: QPaintEvent) -> None:
|
def paint_overlay_squared(self, painter: QPainter, a0: QPaintEvent) -> None:
|
||||||
painter.setRenderHint(QPainter.Antialiasing, False)
|
painter.setRenderHint(QPainter.Antialiasing, False)
|
||||||
|
|
|
@ -99,17 +99,19 @@ class SideTabContainer(QWidget):
|
||||||
layout.addWidget(self.title)
|
layout.addWidget(self.title)
|
||||||
|
|
||||||
if not hasattr(widget, "implements_scrollarea") or not widget.implements_scrollarea:
|
if not hasattr(widget, "implements_scrollarea") or not widget.implements_scrollarea:
|
||||||
self.scrollarea = QScrollArea(self)
|
scrollarea = QScrollArea(self)
|
||||||
self.scrollarea.setSizeAdjustPolicy(QScrollArea.AdjustToContents)
|
scrollarea.setSizeAdjustPolicy(QScrollArea.AdjustToContents)
|
||||||
self.scrollarea.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
scrollarea.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
||||||
self.scrollarea.setFrameStyle(QScrollArea.NoFrame)
|
scrollarea.setFrameStyle(QScrollArea.NoFrame)
|
||||||
self.scrollarea.setMinimumWidth(
|
scrollarea.setMinimumWidth(
|
||||||
widget.sizeHint().width() + self.scrollarea.verticalScrollBar().sizeHint().width()
|
widget.sizeHint().width() + scrollarea.verticalScrollBar().sizeHint().width()
|
||||||
)
|
)
|
||||||
self.scrollarea.setWidgetResizable(True)
|
scrollarea.setWidgetResizable(True)
|
||||||
widget.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
|
widget.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
|
||||||
self.scrollarea.setWidget(widget)
|
scrollarea.setWidget(widget)
|
||||||
layout.addWidget(self.scrollarea)
|
scrollarea.widget().setAutoFillBackground(False)
|
||||||
|
scrollarea.viewport().setAutoFillBackground(False)
|
||||||
|
layout.addWidget(scrollarea)
|
||||||
else:
|
else:
|
||||||
layout.addWidget(widget)
|
layout.addWidget(widget)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue