diff --git a/spinetoolbox/ui/jump_properties.py b/spinetoolbox/ui/jump_properties.py index 718f0d6e6..beb29ec04 100644 --- a/spinetoolbox/ui/jump_properties.py +++ b/spinetoolbox/ui/jump_properties.py @@ -26,10 +26,11 @@ QFont, QFontDatabase, QGradient, QIcon, QImage, QKeySequence, QLinearGradient, QPainter, QPalette, QPixmap, QRadialGradient, QTransform) -from PySide6.QtWidgets import (QAbstractItemView, QApplication, QComboBox, QGridLayout, - QGroupBox, QHBoxLayout, QHeaderView, QPushButton, - QRadioButton, QScrollArea, QSizePolicy, QSpacerItem, - QToolButton, QTreeView, QVBoxLayout, QWidget) +from PySide6.QtWidgets import (QAbstractItemView, QApplication, QComboBox, QFrame, + QGridLayout, QGroupBox, QHBoxLayout, QHeaderView, + QPushButton, QRadioButton, QScrollArea, QSizePolicy, + QSpacerItem, QToolButton, QTreeView, QVBoxLayout, + QWidget) from spinetoolbox.widgets.code_text_edit import CodeTextEdit from spinetoolbox import resources_icons_rc @@ -39,16 +40,19 @@ def setupUi(self, Form): if not Form.objectName(): Form.setObjectName(u"Form") Form.resize(307, 400) + Form.setStyleSheet(u"QScrollArea { background: transparent; }\n" +"QScrollArea > QWidget > QWidget { background: transparent; }") self.verticalLayout_3 = QVBoxLayout(Form) self.verticalLayout_3.setSpacing(0) self.verticalLayout_3.setObjectName(u"verticalLayout_3") self.verticalLayout_3.setContentsMargins(0, 0, 0, 0) self.scrollArea = QScrollArea(Form) self.scrollArea.setObjectName(u"scrollArea") + self.scrollArea.setFrameShape(QFrame.Shape.NoFrame) self.scrollArea.setWidgetResizable(True) self.scrollAreaWidgetContents = QWidget() self.scrollAreaWidgetContents.setObjectName(u"scrollAreaWidgetContents") - self.scrollAreaWidgetContents.setGeometry(QRect(0, 0, 305, 398)) + self.scrollAreaWidgetContents.setGeometry(QRect(0, 0, 307, 400)) self.verticalLayout = QVBoxLayout(self.scrollAreaWidgetContents) self.verticalLayout.setSpacing(0) self.verticalLayout.setObjectName(u"verticalLayout") diff --git a/spinetoolbox/ui/jump_properties.ui b/spinetoolbox/ui/jump_properties.ui index 562bfbfda..666654049 100644 --- a/spinetoolbox/ui/jump_properties.ui +++ b/spinetoolbox/ui/jump_properties.ui @@ -26,6 +26,10 @@ Form + + QScrollArea { background: transparent; } +QScrollArea > QWidget > QWidget { background: transparent; } + 0 @@ -44,6 +48,9 @@ + + QFrame::Shape::NoFrame + true @@ -52,8 +59,8 @@ 0 0 - 305 - 398 + 307 + 400 @@ -157,7 +164,7 @@ ... - + :/icons/file-upload.svg:/icons/file-upload.svg diff --git a/spinetoolbox/ui/link_properties.py b/spinetoolbox/ui/link_properties.py index 55a76298a..5aa369177 100644 --- a/spinetoolbox/ui/link_properties.py +++ b/spinetoolbox/ui/link_properties.py @@ -39,16 +39,20 @@ def setupUi(self, Form): if not Form.objectName(): Form.setObjectName(u"Form") Form.resize(362, 404) + Form.setStyleSheet(u"QScrollArea { background: transparent; }\n" +"QScrollArea > QWidget > QWidget { background: transparent; }") self.verticalLayout_3 = QVBoxLayout(Form) self.verticalLayout_3.setSpacing(0) self.verticalLayout_3.setObjectName(u"verticalLayout_3") self.verticalLayout_3.setContentsMargins(0, 0, 0, 0) self.scrollArea = QScrollArea(Form) self.scrollArea.setObjectName(u"scrollArea") + self.scrollArea.setFrameShape(QFrame.Shape.NoFrame) self.scrollArea.setWidgetResizable(True) self.scrollAreaWidgetContents = QWidget() self.scrollAreaWidgetContents.setObjectName(u"scrollAreaWidgetContents") - self.scrollAreaWidgetContents.setGeometry(QRect(0, 0, 360, 402)) + self.scrollAreaWidgetContents.setGeometry(QRect(0, 0, 362, 404)) + self.scrollAreaWidgetContents.setAutoFillBackground(False) self.verticalLayout = QVBoxLayout(self.scrollAreaWidgetContents) self.verticalLayout.setSpacing(0) self.verticalLayout.setObjectName(u"verticalLayout") diff --git a/spinetoolbox/ui/link_properties.ui b/spinetoolbox/ui/link_properties.ui index 1c91c7b69..976159286 100644 --- a/spinetoolbox/ui/link_properties.ui +++ b/spinetoolbox/ui/link_properties.ui @@ -26,6 +26,10 @@ Form + + QScrollArea { background: transparent; } +QScrollArea > QWidget > QWidget { background: transparent; } + 0 @@ -44,6 +48,9 @@ + + QFrame::Shape::NoFrame + true @@ -52,10 +59,13 @@ 0 0 - 360 - 402 + 362 + 404 + + false + 0 diff --git a/spinetoolbox/ui/mainwindow.py b/spinetoolbox/ui/mainwindow.py index 79c337f0b..1e716bc71 100644 --- a/spinetoolbox/ui/mainwindow.py +++ b/spinetoolbox/ui/mainwindow.py @@ -340,7 +340,7 @@ def setupUi(self, MainWindow): self.tab_no_selection.setObjectName(u"tab_no_selection") self.verticalLayout_14 = QVBoxLayout(self.tab_no_selection) self.verticalLayout_14.setObjectName(u"verticalLayout_14") - self.verticalLayout_14.setContentsMargins(6, 6, 6, 6) + self.verticalLayout_14.setContentsMargins(0, 0, 0, 0) self.label_no_selection = QLabel(self.tab_no_selection) self.label_no_selection.setObjectName(u"label_no_selection") self.label_no_selection.setAlignment(Qt.AlignmentFlag.AlignCenter) diff --git a/spinetoolbox/ui/mainwindow.ui b/spinetoolbox/ui/mainwindow.ui index 6d14f4849..6563a0165 100644 --- a/spinetoolbox/ui/mainwindow.ui +++ b/spinetoolbox/ui/mainwindow.ui @@ -390,16 +390,16 @@ - 6 + 0 - 6 + 0 - 6 + 0 - 6 + 0 diff --git a/spinetoolbox/widgets/properties_widget.py b/spinetoolbox/widgets/properties_widget.py index 04009f440..2f9328b30 100644 --- a/spinetoolbox/widgets/properties_widget.py +++ b/spinetoolbox/widgets/properties_widget.py @@ -57,16 +57,20 @@ def set_color_and_icon(self, base_color, icon=None): bnw_pixmap = QPixmap(icon) self._pixmap = QPixmap(bnw_pixmap.size()) self._pixmap.fill(self._fg_color) - self._pixmap.setMask(bnw_pixmap.createMaskFromColor(Qt.transparent)) + self._pixmap.setMask(bnw_pixmap.createMaskFromColor(Qt.GlobalColor.transparent)) def eventFilter(self, obj, ev): - if ev.type() == QEvent.Paint: + if ev.type() == QEvent.Type.Paint: painter = QPainter(obj) painter.fillRect(obj.rect(), QColor(255, 255, 255, 180)) return super().eventFilter(obj, ev) def paintEvent(self, ev): - """Paints background""" + """Paints background. + + Note: The backgrounds of the properties widget's QScrollArea + and the scrollAreaWidgetContents QWidget are set to transparent in stylesheets. + """ settings = self._toolbox.qsettings() if settings.value("appSettings/colorPropertiesWidgets", defaultValue="false") == "false": super().paintEvent(ev) @@ -80,10 +84,10 @@ def paintEvent(self, ev): new_transparent_widgets -= self._transparent_widgets self._transparent_widgets |= new_transparent_widgets for widget in new_transparent_widgets: - widget.setAttribute(Qt.WA_NoSystemBackground) + widget.setAttribute(Qt.WidgetAttribute.WA_NoSystemBackground) widget.installEventFilter(self) try: - widget.viewport().setAttribute(Qt.WA_TranslucentBackground) + widget.viewport().setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground) except AttributeError: pass rect = self.rect()