mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 22:02:15 +01:00
added new icons for instance view buttons
This commit is contained in:
parent
24d70cae64
commit
d60e8ada22
7 changed files with 60 additions and 18 deletions
|
|
@ -547,7 +547,9 @@ QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {
|
|||
background: {color:bg-menu-separator};
|
||||
}
|
||||
|
||||
#IconBtn {}
|
||||
#IconButton {
|
||||
padding: 4px 4px 4px 4px;
|
||||
}
|
||||
|
||||
/* Password dialog*/
|
||||
#PasswordBtn {
|
||||
|
|
|
|||
|
|
@ -2,16 +2,21 @@ from .icons import (
|
|||
get_icon_path,
|
||||
get_pixmap,
|
||||
get_icon
|
||||
)
|
||||
from .border_label_widget import (
|
||||
BorderedLabelWidget
|
||||
)
|
||||
from .widgets import (
|
||||
SubsetAttributesWidget,
|
||||
IconBtn,
|
||||
|
||||
StopBtn,
|
||||
ResetBtn,
|
||||
ValidateBtn,
|
||||
PublishBtn
|
||||
PublishBtn,
|
||||
|
||||
CreateInstanceBtn,
|
||||
RemoveInstanceBtn,
|
||||
ChangeViewBtn
|
||||
)
|
||||
from .publish_widget import (
|
||||
PublishFrame
|
||||
|
|
@ -36,12 +41,16 @@ __all__ = (
|
|||
|
||||
"SubsetAttributesWidget",
|
||||
"BorderedLabelWidget",
|
||||
"IconBtn",
|
||||
|
||||
"StopBtn",
|
||||
"ResetBtn",
|
||||
"ValidateBtn",
|
||||
"PublishBtn",
|
||||
|
||||
"CreateInstanceBtn",
|
||||
"RemoveInstanceBtn",
|
||||
"ChangeViewBtn",
|
||||
|
||||
"PublishFrame",
|
||||
|
||||
"CreateDialog",
|
||||
|
|
|
|||
BIN
openpype/tools/new_publisher/widgets/images/add.png
Normal file
BIN
openpype/tools/new_publisher/widgets/images/add.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.7 KiB |
BIN
openpype/tools/new_publisher/widgets/images/change_view.png
Normal file
BIN
openpype/tools/new_publisher/widgets/images/change_view.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.1 KiB |
BIN
openpype/tools/new_publisher/widgets/images/delete.png
Normal file
BIN
openpype/tools/new_publisher/widgets/images/delete.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
|
|
@ -17,24 +17,30 @@ from ..constants import (
|
|||
)
|
||||
|
||||
|
||||
class IconBtn(QtWidgets.QPushButton):
|
||||
class IconButton(QtWidgets.QPushButton):
|
||||
"""PushButton with icon and size of font.
|
||||
|
||||
Using font metrics height as icon size reference.
|
||||
"""
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(IconButton, self).__init__(*args, **kwargs)
|
||||
self.setObjectName("IconButton")
|
||||
|
||||
def sizeHint(self):
|
||||
result = super().sizeHint()
|
||||
if not self.text():
|
||||
new_height = (
|
||||
result.height()
|
||||
- self.iconSize().height()
|
||||
+ self.fontMetrics().height()
|
||||
)
|
||||
result.setHeight(new_height)
|
||||
result = super(IconButton, self).sizeHint()
|
||||
icon_h = self.iconSize().height()
|
||||
font_height = self.fontMetrics().height()
|
||||
text_set = bool(self.text())
|
||||
if not text_set and icon_h < font_height:
|
||||
new_size = result.height() - icon_h + font_height
|
||||
result.setHeight(new_size)
|
||||
result.setWidth(new_size)
|
||||
|
||||
return result
|
||||
|
||||
|
||||
class PublishIconBtn(IconBtn):
|
||||
class PublishIconBtn(IconButton):
|
||||
def __init__(self, pixmap_path, *args, **kwargs):
|
||||
super(PublishIconBtn, self).__init__(*args, **kwargs)
|
||||
|
||||
|
|
@ -124,6 +130,27 @@ class PublishBtn(PublishIconBtn):
|
|||
self.setToolTip("Publish")
|
||||
|
||||
|
||||
class CreateInstanceBtn(PublishIconBtn):
|
||||
def __init__(self, parent=None):
|
||||
icon_path = get_icon_path("add")
|
||||
super(CreateInstanceBtn, self).__init__(icon_path, parent)
|
||||
self.setToolTip("Create new instance")
|
||||
|
||||
|
||||
class RemoveInstanceBtn(PublishIconBtn):
|
||||
def __init__(self, parent=None):
|
||||
icon_path = get_icon_path("delete")
|
||||
super(RemoveInstanceBtn, self).__init__(icon_path, parent)
|
||||
self.setToolTip("Remove selected instances")
|
||||
|
||||
|
||||
class ChangeViewBtn(PublishIconBtn):
|
||||
def __init__(self, parent=None):
|
||||
icon_path = get_icon_path("change_view")
|
||||
super(ChangeViewBtn, self).__init__(icon_path, parent)
|
||||
self.setToolTip("Swap between views")
|
||||
|
||||
|
||||
class AbstractInstanceView(QtWidgets.QWidget):
|
||||
selection_changed = QtCore.Signal()
|
||||
active_changed = QtCore.Signal()
|
||||
|
|
|
|||
|
|
@ -13,11 +13,15 @@ from .widgets import (
|
|||
InstanceCardView,
|
||||
InstanceListView,
|
||||
CreateDialog,
|
||||
IconBtn,
|
||||
|
||||
StopBtn,
|
||||
ResetBtn,
|
||||
ValidateBtn,
|
||||
PublishBtn,
|
||||
|
||||
CreateInstanceBtn,
|
||||
RemoveInstanceBtn,
|
||||
ChangeViewBtn
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -80,9 +84,9 @@ class PublisherWindow(QtWidgets.QDialog):
|
|||
subset_views_layout.addWidget(subset_list_view)
|
||||
|
||||
# Buttons at the bottom of subset view
|
||||
create_btn = QtWidgets.QPushButton("+", subset_frame)
|
||||
delete_btn = QtWidgets.QPushButton("-", subset_frame)
|
||||
change_view_btn = QtWidgets.QPushButton("=", subset_frame)
|
||||
create_btn = CreateInstanceBtn(subset_frame)
|
||||
delete_btn = RemoveInstanceBtn(subset_frame)
|
||||
change_view_btn = ChangeViewBtn(subset_frame)
|
||||
|
||||
# Subset details widget
|
||||
subset_attributes_wrap = BorderedLabelWidget(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue