diff options
author | Treeki <treeki@gmail.com> | 2011-11-10 04:31:20 +0100 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2011-11-10 04:31:20 +0100 |
commit | cd91a8909a51dbe663e7eb8d61eae7a6ddbd3ca0 (patch) | |
tree | 598f18f32338af667e4139b3e833aedcf738be6c | |
parent | e56f58fdbf664c1608f68f92534cbeed86cd45f2 (diff) | |
download | koopatlas-cd91a8909a51dbe663e7eb8d61eae7a6ddbd3ca0.tar.gz koopatlas-cd91a8909a51dbe663e7eb8d61eae7a6ddbd3ca0.zip |
cosmetic fixes to the object chooser
-rw-r--r-- | src/tileset.py | 2 | ||||
-rw-r--r-- | src/ui.py | 11 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/tileset.py b/src/tileset.py index 19451de..c060f07 100644 --- a/src/tileset.py +++ b/src/tileset.py @@ -395,7 +395,7 @@ class KPTileset(object): self.tiles = [] self.objects = [] - self.groupItem = KPGroupItem("") + self.groupItem = KPGroupItem("All Groups") self.processImage(imageBuffer) self.processObjects(objectBuffer, objectMetadata) @@ -88,7 +88,6 @@ class KPObjectSelector(QtGui.QWidget): self.sorterButton.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) self.sorterMenu = QtGui.QMenu() - self.sorterMenu.setFixedWidth(self.sorterButton.width()) action = self.sorterMenu.addAction("test 1") self.sorterButton.setMenu(self.sorterMenu) @@ -114,9 +113,14 @@ class KPObjectSelector(QtGui.QWidget): # Borrowed the signals and junk from Reggie, figure we'll need em' self.listView.clicked.connect(self.handleObjReplace) + self.sorterMenu.aboutToShow.connect(self.fixUpMenuSize) self.sorterMenu.triggered.connect(self.toggleTopLevel) + def fixUpMenuSize(self): + self.sorterMenu.setFixedWidth(self.sorterButton.width()) + + def currentSelectedObject(self): """Returns the currently selected object reference, for painting purposes.""" @@ -147,12 +151,15 @@ class KPObjectSelector(QtGui.QWidget): actionMan.setData((item[1], item[2])) + # a Quick Fix + self.listView.setRowHidden(0, True) + def toggleTopLevel(self, action): """Changes the top level group in the list view.""" name = str(action.text()).strip() - startRow = action.data().toPyObject()[0] + startRow = action.data().toPyObject()[0] + 1 endRow = action.data().toPyObject()[1] for row in xrange(self.model.rowCount()): |