Skip to content

Commit

Permalink
Refactoring docks on right (remove no need, improve order)
Browse files Browse the repository at this point in the history
  • Loading branch information
wkentaro committed Jul 23, 2018
1 parent 8145190 commit 1d69b63
Showing 1 changed file with 15 additions and 20 deletions.
35 changes: 15 additions & 20 deletions labelme/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,6 @@ def __init__(self, config=None, filename=None, output=None):
self.labelList = LabelQListWidget()
self.lastOpenDir = None

self.labelList.itemActivated.connect(self.labelSelectionChanged)
self.labelList.itemSelectionChanged.connect(self.labelSelectionChanged)
self.labelList.itemDoubleClicked.connect(self.editLabel)
# Connect to itemChanged to detect checkbox changes.
self.labelList.itemChanged.connect(self.labelItemChanged)
self.labelList.setDragDropMode(
QtWidgets.QAbstractItemView.InternalMove)
self.labelList.setParent(self)

self.flag_dock = self.flag_widget = None
self.flag_dock = QtWidgets.QDockWidget('Flags', self)
self.flag_dock.setObjectName('Flags')
Expand All @@ -107,6 +98,18 @@ def __init__(self, config=None, filename=None, output=None):
self.flag_dock.setWidget(self.flag_widget)
self.flag_widget.itemChanged.connect(self.setDirty)

self.labelList.itemActivated.connect(self.labelSelectionChanged)
self.labelList.itemSelectionChanged.connect(self.labelSelectionChanged)
self.labelList.itemDoubleClicked.connect(self.editLabel)
# Connect to itemChanged to detect checkbox changes.
self.labelList.itemChanged.connect(self.labelItemChanged)
self.labelList.setDragDropMode(
QtWidgets.QAbstractItemView.InternalMove)
self.labelList.setParent(self)
self.dock = QtWidgets.QDockWidget('Polygon Labels', self)
self.dock.setObjectName('Labels')
self.dock.setWidget(self.labelList)

self.uniqLabelList = EscapableQListWidget()
self.uniqLabelList.setToolTip(
"Select label to start annotating for it. "
Expand All @@ -118,21 +121,13 @@ def __init__(self, config=None, filename=None, output=None):
self.labelsdock.setObjectName(u'Label List')
self.labelsdock.setWidget(self.uniqLabelList)

self.dock = QtWidgets.QDockWidget('Polygon Labels', self)
self.dock.setObjectName('Labels')
self.dock.setWidget(self.labelList)

self.fileListWidget = QtWidgets.QListWidget()
self.fileListWidget.itemSelectionChanged.connect(
self.fileSelectionChanged)
filelistLayout = QtWidgets.QVBoxLayout()
filelistLayout.setContentsMargins(0, 0, 0, 0)
filelistLayout.addWidget(self.fileListWidget)
fileListContainer = QtWidgets.QWidget()
fileListContainer.setLayout(filelistLayout)
self.fileSelectionChanged
)
self.filedock = QtWidgets.QDockWidget(u'File List', self)
self.filedock.setObjectName(u'Files')
self.filedock.setWidget(fileListContainer)
self.filedock.setWidget(self.fileListWidget)

self.zoomWidget = ZoomWidget()
self.colorDialog = ColorDialog(parent=self)
Expand Down

0 comments on commit 1d69b63

Please sign in to comment.