mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
publish and browse btns cant be focused and components can handle mime data
This commit is contained in:
parent
da3214fafe
commit
8da831c193
3 changed files with 10 additions and 5 deletions
|
|
@ -22,12 +22,11 @@ from .widget_asset_view import AssetView
|
|||
from .widget_asset import AssetWidget
|
||||
from .widget_family_desc import FamilyDescriptionWidget
|
||||
from .widget_family import FamilyWidget
|
||||
from .widget_drop_data import DropDataWidget
|
||||
|
||||
from .widget_component import ComponentWidget
|
||||
from .widget_tree_components import TreeComponents
|
||||
from .widget_drop_empty import DropEmpty
|
||||
from .widget_component_item import ComponentItem
|
||||
from .widget_components_list import ComponentsList
|
||||
|
||||
from .widget_drop_files import DropDataFrame
|
||||
from .widget_drop_frame import DropDataFrame
|
||||
|
||||
from .widget_components import ComponentsWidget
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ from PyQt5 import QtSvg, QtXml
|
|||
|
||||
class SvgResizable(QtSvg.QSvgWidget):
|
||||
clicked = QtCore.Signal()
|
||||
|
||||
def __init__(self, filepath, width=None, height=None, fill=None):
|
||||
super().__init__()
|
||||
self.xmldoc = minidom.parse(filepath)
|
||||
|
|
@ -13,6 +14,7 @@ class SvgResizable(QtSvg.QSvgWidget):
|
|||
for element in itemlist:
|
||||
if fill:
|
||||
element.setAttribute('fill', str(fill))
|
||||
# TODO auto scale if only one is set
|
||||
if width is not None and height is not None:
|
||||
self.setMaximumSize(width, height)
|
||||
self.setMinimumSize(width, height)
|
||||
|
|
|
|||
|
|
@ -14,9 +14,11 @@ class ComponentsWidget(QtWidgets.QWidget):
|
|||
|
||||
self.btn_browse = QtWidgets.QPushButton('Browse')
|
||||
self.btn_browse.setToolTip('Browse for file(s).')
|
||||
self.btn_browse.setFocusPolicy(QtCore.Qt.NoFocus)
|
||||
|
||||
self.btn_publish = QtWidgets.QPushButton('Publish')
|
||||
self.btn_publish.setToolTip('Publishes data.')
|
||||
self.btn_publish.setFocusPolicy(QtCore.Qt.NoFocus)
|
||||
|
||||
layout.addWidget(self.btn_browse, alignment=QtCore.Qt.AlignLeft)
|
||||
layout.addWidget(self.btn_publish, alignment=QtCore.Qt.AlignRight)
|
||||
|
|
@ -33,7 +35,6 @@ class ComponentsWidget(QtWidgets.QWidget):
|
|||
layout.addWidget(body)
|
||||
|
||||
self.btn_browse.clicked.connect(self._browse)
|
||||
# self.setStyleSheet("border: 1px solid black;")
|
||||
|
||||
def set_valid(self, in_bool):
|
||||
self.btn_publish.setEnabled(in_bool)
|
||||
|
|
@ -41,6 +42,9 @@ class ComponentsWidget(QtWidgets.QWidget):
|
|||
def set_valid_components(self, in_bool):
|
||||
self.parent_widget.set_valid_components(in_bool)
|
||||
|
||||
def process_mime_data(self, mime_data):
|
||||
self.drop_frame.process_ent_mime(mime_data)
|
||||
|
||||
def _browse(self):
|
||||
options = [
|
||||
QtWidgets.QFileDialog.DontResolveSymlinks,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue