mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
change style of button
This commit is contained in:
parent
0645089ad6
commit
20dacc342b
2 changed files with 21 additions and 13 deletions
|
|
@ -1832,23 +1832,24 @@ class CreateNextPageOverlay(QtWidgets.QWidget):
|
|||
rect = QtCore.QRect(self.rect())
|
||||
rect_width = rect.width()
|
||||
rect_height = rect.height()
|
||||
radius = rect_width * 0.2
|
||||
|
||||
size = rect_width * 0.9
|
||||
|
||||
x_offset = (rect_width - size) * 0.5
|
||||
y_offset = (rect_height - size) * 0.5
|
||||
x_offset = 0
|
||||
y_offset = 0
|
||||
if self._anim_value != 1.0:
|
||||
x_offset += rect_width - (rect_width * self._anim_value)
|
||||
|
||||
arrow_half_height = size * 0.2
|
||||
arrow_x_start = x_offset + (size * 0.4)
|
||||
arrow_height = rect_height * 0.4
|
||||
arrow_half_height = arrow_height * 0.5
|
||||
arrow_x_start = x_offset + ((rect_width - arrow_half_height) * 0.5)
|
||||
arrow_x_end = arrow_x_start + arrow_half_height
|
||||
center_y = rect.center().y()
|
||||
|
||||
painter.setBrush(self._bg_color)
|
||||
painter.drawEllipse(
|
||||
painter.drawRoundedRect(
|
||||
x_offset, y_offset,
|
||||
size, size
|
||||
rect_width + radius, rect_height,
|
||||
radius, radius
|
||||
)
|
||||
|
||||
src_arrow_path = QtGui.QPainterPath()
|
||||
|
|
|
|||
|
|
@ -257,7 +257,9 @@ class PublisherWindow(QtWidgets.QDialog):
|
|||
publish_btn.clicked.connect(self._on_publish_clicked)
|
||||
|
||||
publish_frame.details_page_requested.connect(self._go_to_details_tab)
|
||||
create_overlay_button.clicked.connect(self._go_to_publish_tab)
|
||||
create_overlay_button.clicked.connect(
|
||||
self._on_create_overlay_button_click
|
||||
)
|
||||
|
||||
controller.event_system.add_callback(
|
||||
"instances.refresh.finished", self._on_instances_refresh
|
||||
|
|
@ -471,6 +473,10 @@ class PublisherWindow(QtWidgets.QDialog):
|
|||
self._help_dialog.width(), self._help_dialog.height()
|
||||
)
|
||||
|
||||
def _on_create_overlay_button_click(self):
|
||||
self._create_overlay_button.set_under_mouse(False)
|
||||
self._go_to_publish_tab()
|
||||
|
||||
def _on_tab_change(self, old_tab, new_tab):
|
||||
if old_tab == "details":
|
||||
self._publish_details_widget.close_details_popup()
|
||||
|
|
@ -716,19 +722,20 @@ class PublisherWindow(QtWidgets.QDialog):
|
|||
|
||||
def _update_create_overlay_size(self):
|
||||
metrics = self._create_overlay_button.fontMetrics()
|
||||
size = int(metrics.height())
|
||||
height = int(metrics.height())
|
||||
width = int(height * 0.7)
|
||||
end_pos_x = self.width()
|
||||
start_pos_x = end_pos_x - size
|
||||
start_pos_x = end_pos_x - width
|
||||
|
||||
center = self._content_widget.parent().mapTo(
|
||||
self,
|
||||
self._content_widget.rect().center()
|
||||
)
|
||||
pos_y = center.y() - (size * 0.5)
|
||||
pos_y = center.y() - (height * 0.5)
|
||||
|
||||
self._create_overlay_button.setGeometry(
|
||||
start_pos_x, pos_y,
|
||||
size, size
|
||||
width, height
|
||||
)
|
||||
|
||||
def _update_create_overlay_visibility(self, global_pos=None):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue