Mercurial > fife-parpg
comparison clients/editor/scripts/gui/toolbar.py @ 316:6add14ebe9f5
Disabled recursing for some adaptLayout calls. This will make the editor more responsive
author | cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Sat, 15 Aug 2009 00:42:23 +0000 |
parents | 51cc05d862f2 |
children | e2ac8bb1a22c |
comparison
equal
deleted
inserted
replaced
315:21999e058c7b | 316:6add14ebe9f5 |
---|---|
57 for b in self._actionbuttons[:]: | 57 for b in self._actionbuttons[:]: |
58 if a == b.action: | 58 if a == b.action: |
59 self.gui.removeChild(b) | 59 self.gui.removeChild(b) |
60 self._actionbuttons.remove(b) | 60 self._actionbuttons.remove(b) |
61 | 61 |
62 self.adaptLayout() | 62 self.adaptLayout(False) |
63 | 63 |
64 def hasAction(self, action): | 64 def hasAction(self, action): |
65 for a in self._actions: | 65 for a in self._actions: |
66 if a == action: return True | 66 if a == action: return True |
67 return False | 67 return False |
79 | 79 |
80 def _updateActionGroup(self, sender): | 80 def _updateActionGroup(self, sender): |
81 position = self._actions.index(sender) | 81 position = self._actions.index(sender) |
82 self.removeAction(sender) | 82 self.removeAction(sender) |
83 self.insertAction(sender, position) | 83 self.insertAction(sender, position) |
84 self.adaptLayout() | 84 self.adaptLayout(False) |
85 | 85 |
86 def _insertButton(self, action, position): | 86 def _insertButton(self, action, position): |
87 actions = [action] | 87 actions = [action] |
88 if isinstance(action, ActionGroup): | 88 if isinstance(action, ActionGroup): |
89 actions = action.getActions() | 89 actions = action.getActions() |
140 self.addChild(self.gui) | 140 self.addChild(self.gui) |
141 | 141 |
142 for action in actions: | 142 for action in actions: |
143 self.addAction(action) | 143 self.addAction(action) |
144 | 144 |
145 self.adaptLayout() | 145 self.adaptLayout(False) |
146 | 146 |
147 def setOrientation(self, orientation): | 147 def setOrientation(self, orientation): |
148 if orientation == ToolBar.ORIENTATION['Vertical']: | 148 if orientation == ToolBar.ORIENTATION['Vertical']: |
149 self._orientation = ToolBar.ORIENTATION['Vertical'] | 149 self._orientation = ToolBar.ORIENTATION['Vertical'] |
150 self._max_size = (self._panel_size, 5000) | 150 self._max_size = (self._panel_size, 5000) |
225 def setAction(self, action): | 225 def setAction(self, action): |
226 self.removeEvents() | 226 self.removeEvents() |
227 | 227 |
228 self._action = action | 228 self._action = action |
229 self.update() | 229 self.update() |
230 self.adaptLayout() | 230 self.adaptLayout(False) |
231 | 231 |
232 self.initEvents() | 232 self.initEvents() |
233 | 233 |
234 def getAction(self): | 234 def getAction(self): |
235 return self._action | 235 return self._action |
253 def _hideTooltip(self): | 253 def _hideTooltip(self): |
254 scripts.editor.getEditor().getStatusBar().hideTooltip() | 254 scripts.editor.getEditor().getStatusBar().hideTooltip() |
255 | 255 |
256 def _actionChanged(self): | 256 def _actionChanged(self): |
257 self.update() | 257 self.update() |
258 self.adaptLayout() | 258 self.adaptLayout(False) |
259 | 259 |
260 def update(self): | 260 def update(self): |
261 """ Sets up the button widget """ | 261 """ Sets up the button widget """ |
262 if self._widget != None: | 262 if self._widget != None: |
263 self.removeChild(self._widget) | 263 self.removeChild(self._widget) |