From 8b570a37d548a0e0028863db2dc2d493b8fddf8f Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Tue, 11 Oct 2022 12:01:29 +0200 Subject: [PATCH] make publish frame borders transparent --- openpype/style/style.css | 1 - .../tools/publisher/widgets/publish_frame.py | 18 ++++++++----- openpype/tools/publisher/window.py | 27 ++++++++++--------- 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/openpype/style/style.css b/openpype/style/style.css index 740c1520e0..4d13dc7c89 100644 --- a/openpype/style/style.css +++ b/openpype/style/style.css @@ -971,7 +971,6 @@ VariantInputsWidget QToolButton { #PublishInfoFrame { background: {color:bg}; - border: 2px solid black; border-radius: 0.3em; } diff --git a/openpype/tools/publisher/widgets/publish_frame.py b/openpype/tools/publisher/widgets/publish_frame.py index 04e5f85528..ddaac7027d 100644 --- a/openpype/tools/publisher/widgets/publish_frame.py +++ b/openpype/tools/publisher/widgets/publish_frame.py @@ -29,7 +29,7 @@ class PublishFrame(QtWidgets.QWidget): +------------------------------------------------------------------------+ | < Main label > | | < Label top > | - | (#### 10% ) | + | (#### 10% ) | | | | | +------------------------------------------------------------------------+ @@ -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) diff --git a/openpype/tools/publisher/window.py b/openpype/tools/publisher/window.py index aa5f08eed4..4b382c0df5 100644 --- a/openpype/tools/publisher/window.py +++ b/openpype/tools/publisher/window.py @@ -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)