make publish frame borders transparent

This commit is contained in:
Jakub Trllo 2022-10-11 12:01:29 +02:00
parent 2b6d6a5151
commit 8b570a37d5
3 changed files with 27 additions and 19 deletions

View file

@ -971,7 +971,6 @@ VariantInputsWidget QToolButton {
#PublishInfoFrame {
background: {color:bg};
border: 2px solid black;
border-radius: 0.3em;
}

View file

@ -29,7 +29,7 @@ class PublishFrame(QtWidgets.QWidget):
+------------------------------------------------------------------------+
| < Main label > |
| < Label top > |
| (#### 10% <Progress bar> ) |
| (#### 10% <Progress bar> ) |
| <Instance label> <Plugin label> |
| <Report> <Reset><Stop><Validate><Publish> |
+------------------------------------------------------------------------+
@ -37,7 +37,7 @@ class PublishFrame(QtWidgets.QWidget):
details_page_requested = QtCore.Signal()
def __init__(self, controller, parent):
def __init__(self, controller, borders, parent):
super(PublishFrame, self).__init__(parent)
# Bottom part of widget where process and callback buttons are showed
@ -137,7 +137,7 @@ class PublishFrame(QtWidgets.QWidget):
content_layout.addWidget(footer_widget)
main_layout = QtWidgets.QVBoxLayout(self)
main_layout.setContentsMargins(0, 0, 0, 0)
main_layout.setContentsMargins(borders, 0, borders, borders)
main_layout.addWidget(content_frame)
shrunk_anim = QtCore.QVariantAnimation()
@ -261,7 +261,7 @@ class PublishFrame(QtWidgets.QWidget):
diff -= self._content_layout.spacing()
window_pos = self.pos()
window_pos_y = self.pos().y() + diff
window_pos_y = window_pos.y() + diff
window_height = self.height() - diff
self._top_content_widget.setMinimumHeight(value)
@ -286,11 +286,17 @@ class PublishFrame(QtWidgets.QWidget):
if self._shrunken:
content_frame_hint = self._content_frame.sizeHint()
window_height = content_frame_hint.height()
layout = self.layout()
margins = layout.contentsMargins()
window_height = (
content_frame_hint.height()
+ margins.bottom()
+ margins.top()
)
diff = self.height() - window_height
window_pos = self.pos()
window_pos_y = self.pos().y() + diff
window_pos_y = window_pos.y() + diff
self.resize(self.width(), window_height)
self.move(window_pos.x(), window_pos_y)

View file

@ -33,6 +33,8 @@ class PublisherWindow(QtWidgets.QDialog):
"""Main window of publisher."""
default_width = 1300
default_height = 800
footer_border = 8
publish_footer_spacer = 2
def __init__(self, parent=None, reset_on_show=None):
super(PublisherWindow, self).__init__(parent)
@ -126,22 +128,23 @@ class PublisherWindow(QtWidgets.QDialog):
footer_bottom_layout.addWidget(validate_btn, 0)
footer_bottom_layout.addWidget(publish_btn, 0)
footer_layout = QtWidgets.QVBoxLayout(footer_widget)
footer_margins = footer_layout.contentsMargins()
border = 2
footer_layout.setContentsMargins(
footer_margins.left() + border,
footer_margins.top(),
footer_margins.right() + border,
footer_margins.bottom() + border
)
# Spacer helps keep distance of Publish Frame when comment input
# is hidden - so when is shrunken it is not overlaying pages
footer_spacer = QtWidgets.QWidget(footer_widget)
footer_spacer.setMinimumHeight(border)
footer_spacer.setMaximumHeight(border)
footer_spacer.setMinimumHeight(self.publish_footer_spacer)
footer_spacer.setMaximumHeight(self.publish_footer_spacer)
footer_spacer.setVisible(False)
footer_layout = QtWidgets.QVBoxLayout(footer_widget)
footer_margins = footer_layout.contentsMargins()
footer_layout.setContentsMargins(
footer_margins.left() + self.footer_border,
footer_margins.top(),
footer_margins.right() + self.footer_border,
footer_margins.bottom() + self.footer_border
)
footer_layout.addWidget(comment_input, 0)
footer_layout.addWidget(footer_spacer, 0)
footer_layout.addWidget(footer_bottom_widget, 0)
@ -216,7 +219,7 @@ class PublisherWindow(QtWidgets.QDialog):
main_layout.addWidget(under_publish_stack, 1)
# Floating publish frame
publish_frame = PublishFrame(controller, self)
publish_frame = PublishFrame(controller, self.footer_border, self)
help_btn.clicked.connect(self._on_help_click)
tabs_widget.tab_changed.connect(self._on_tab_change)