Commit 3a1726da authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[widgets][assetbrowser] Automatically resize the first column when folder is loaded

This make viewing the content easier.
parent d78a74bc
......@@ -113,9 +113,19 @@ class AssetBrowser(QWidget):
layout = QVBoxLayout(self)
layout.addWidget(self.view)
self.filesystem_model.directoryLoaded.connect(self.__onDirectoryLoaded)
self.view.doubleClicked.connect(self._onItemDoubleClicked)
self.view.customContextMenuRequested.connect(self._openMenu)
@pyqtSlot()
def __onDirectoryLoaded(self):
"""When a directory is loaded, resize the first column.
This makes the navigation easier.
"""
self.view.resizeColumnToContents(0)
@pyqtSlot("QModelIndex")
def _onItemDoubleClicked(self, index):
"""When an item is selected, emit the jsonSelected signal with
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment