mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 21:32:15 +01:00
use openpype style on main window
This commit is contained in:
parent
0fcdbabeb1
commit
150eb6a29c
2 changed files with 13 additions and 9 deletions
|
|
@ -3,12 +3,13 @@ import sys
|
|||
|
||||
from Qt import QtWidgets, QtCore
|
||||
from avalon.vendor import qtawesome
|
||||
from avalon import io, api, style
|
||||
|
||||
from avalon import io, api
|
||||
|
||||
from avalon.tools import lib as tools_lib
|
||||
from avalon.tools.delegates import VersionDelegate
|
||||
|
||||
from openpype import style
|
||||
|
||||
from .proxy import FilterProxyModel
|
||||
from .model import InventoryModel
|
||||
from .view import View
|
||||
|
|
@ -94,7 +95,6 @@ class SceneInventoryWindow(QtWidgets.QDialog):
|
|||
"version": version_delegate
|
||||
}
|
||||
}
|
||||
|
||||
# set some nice default widths for the view
|
||||
self.view.setColumnWidth(0, 250) # name
|
||||
self.view.setColumnWidth(1, 55) # version
|
||||
|
|
@ -104,6 +104,14 @@ class SceneInventoryWindow(QtWidgets.QDialog):
|
|||
|
||||
self.family_config_cache.refresh()
|
||||
|
||||
self._first_show = True
|
||||
|
||||
def showEvent(self, event):
|
||||
super(SceneInventoryWindow, self).showEvent(event)
|
||||
if self._first_show:
|
||||
self._first_show = False
|
||||
self.setStyleSheet(style.load_stylesheet())
|
||||
|
||||
def keyPressEvent(self, event):
|
||||
"""Custom keyPressEvent.
|
||||
|
||||
|
|
@ -161,7 +169,6 @@ def show(root=None, debug=False, parent=None, items=None):
|
|||
|
||||
with tools_lib.application():
|
||||
window = SceneInventoryWindow(parent)
|
||||
window.setStyleSheet(style.load_stylesheet())
|
||||
window.show()
|
||||
window.refresh(items=items)
|
||||
|
||||
|
|
|
|||
|
|
@ -154,21 +154,18 @@ class HostToolsHelper:
|
|||
def get_scene_inventory_tool(self, parent):
|
||||
"""Create, cache and return scene inventory tool window."""
|
||||
if self._scene_inventory_tool is None:
|
||||
from avalon.tools.sceneinventory.app import Window
|
||||
from openpype.tools.sceneinventory import SceneInventoryWindow
|
||||
|
||||
scene_inventory_window = Window(parent=parent or self._parent)
|
||||
scene_inventory_window = SceneInventoryWindow(parent=parent or self._parent)
|
||||
self._scene_inventory_tool = scene_inventory_window
|
||||
|
||||
return self._scene_inventory_tool
|
||||
|
||||
def show_scene_inventory(self, parent=None):
|
||||
"""Show tool maintain loaded containers."""
|
||||
from avalon import style
|
||||
|
||||
scene_inventory_tool = self.get_scene_inventory_tool(parent)
|
||||
scene_inventory_tool.show()
|
||||
scene_inventory_tool.refresh()
|
||||
scene_inventory_tool.setStyleSheet(style.load_stylesheet())
|
||||
|
||||
# Pull window to the front.
|
||||
scene_inventory_tool.raise_()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue