Browse files

Modify aspect ratio at which the actions panel will switch from h to …

…v layout

Added aspect_ratio property to QFlowLayoutWidget so each individual
widget can choose when it will switch between _horizontal and _vertical
  • Loading branch information...
1 parent b30d19d commit 9ab385c535c42ab48bd66f82290a3593045e3cdf Jamie Pate committed Mar 27, 2013
Showing with 3 additions and 1 deletion.
  1. +2 −1 cola/qt.py
  2. +1 −0 cola/widgets/action.py
View
3 cola/qt.py
@@ -146,10 +146,11 @@ def __init__(self, parent):
QtGui.QSizePolicy.Minimum)
self.setSizePolicy(policy)
self.setMinimumSize(QtCore.QSize(1, 1))
+ self.aspect_ratio = 0.8
def resizeEvent(self, event):
size = event.size()
- if size.width() * 0.8 < size.height():
+ if size.width() * self.aspect_ratio < size.height():
dxn = self._vertical
else:
dxn = self._horizontal
View
1 cola/widgets/action.py
@@ -21,6 +21,7 @@ def __init__(self, parent=None):
self.push_button = create_button(text=N_('Push...'), layout=layout)
self.pull_button = create_button(text=N_('Pull...'), layout=layout)
self.stash_button = create_button(text=N_('Stash...'), layout=layout)
+ self.aspect_ratio = 0.4
layout.addStretch()
self.setMinimumHeight(30)

0 comments on commit 9ab385c

Please sign in to comment.