Merge pull request #177 from ynput/bugfix/AY-1044_Publisher-window-stretch-on-error

Publisher: Change scrollbar stylesheet to avoid issues on resize
This commit is contained in:
Jakub Trllo 2024-03-13 14:38:47 +01:00 committed by GitHub
commit da6910f708
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 37 additions and 1 deletions

View file

@ -1067,6 +1067,38 @@ PixmapButton:disabled {
font-size: 13pt;
}
#PublisherVerticalScrollArea QScrollBar {
background: transparent;
margin: 0;
border: none;
}
#PublisherVerticalScrollArea QScrollBar:horizontal {
height: 10px;
margin: 0;
}
#PublisherVerticalScrollArea QScrollBar:vertical {
width: 10px;
margin: 0;
}
#PublisherVerticalScrollArea QScrollBar::handle {
background: {color:bg-scroll-handle};
border-radius: 4px;
margin: 1px;
}
#PublisherVerticalScrollArea QScrollBar::handle:horizontal {
min-width: 20px;
min-height: 8px;
}
#PublisherVerticalScrollArea QScrollBar::handle:vertical {
min-height: 20px;
min-width: 8px;
}
ValidationArtistMessage QLabel {
font-size: 20pt;
font-weight: bold;

View file

@ -56,6 +56,8 @@ class VerticalScrollArea(QtWidgets.QScrollArea):
self.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
self.setLayoutDirection(QtCore.Qt.RightToLeft)
self.setObjectName("PublisherVerticalScrollArea")
self.setAttribute(QtCore.Qt.WA_TranslucentBackground)
# Background of scrollbar will be transparent
scrollbar_bg = self.verticalScrollBar().parent()
@ -500,7 +502,9 @@ class ValidationErrorsView(QtWidgets.QWidget):
errors_scroll.setWidget(errors_widget)
errors_layout = QtWidgets.QVBoxLayout(errors_widget)
errors_layout.setContentsMargins(0, 0, 0, 0)
# Add 5 margin to left so the is not directly on the edge of the
# scroll widget
errors_layout.setContentsMargins(5, 0, 0, 0)
layout = QtWidgets.QVBoxLayout(self)
layout.addWidget(errors_scroll, 1)