Skip to content
This repository
Browse code

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...
commit 9ab385c535c42ab48bd66f82290a3593045e3cdf 1 parent b30d19d
authored March 27, 2013
3  cola/qt.py
@@ -146,10 +146,11 @@ def __init__(self, parent):
146 146
                                    QtGui.QSizePolicy.Minimum)
147 147
         self.setSizePolicy(policy)
148 148
         self.setMinimumSize(QtCore.QSize(1, 1))
  149
+        self.aspect_ratio = 0.8
149 150
 
150 151
     def resizeEvent(self, event):
151 152
         size = event.size()
152  
-        if size.width() * 0.8 < size.height():
  153
+        if size.width() * self.aspect_ratio < size.height():
153 154
             dxn = self._vertical
154 155
         else:
155 156
             dxn = self._horizontal
1  cola/widgets/action.py
@@ -21,6 +21,7 @@ def __init__(self, parent=None):
21 21
         self.push_button = create_button(text=N_('Push...'), layout=layout)
22 22
         self.pull_button = create_button(text=N_('Pull...'), layout=layout)
23 23
         self.stash_button = create_button(text=N_('Stash...'), layout=layout)
  24
+        self.aspect_ratio = 0.4
24 25
         layout.addStretch()
25 26
         self.setMinimumHeight(30)
26 27
 

0 notes on commit 9ab385c

Please sign in to comment.
Something went wrong with that request. Please try again.