Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…v layout

Added verticalAspect property to QFlowLayoutWidget so each one can be
individualized
  • Loading branch information...
commit 1428636f58448fd898a3f8e93e0a21d31fcd1933 1 parent b30d19d
Jamie Pate authored
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.verticalAspect = 0.8
def resizeEvent(self, event):
size = event.size()
- if size.width() * 0.8 < size.height():
+ if size.width() * self.verticalAspect < 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.verticalAspect = 0.4
layout.addStretch()
self.setMinimumHeight(30)

2 comments on commit 1428636

@davvid

Thanks a lot, this looks good. Tiny nit: can you please amend the commit to name the variable self.aspect_ratio and adjust the commit message? I try to only use camelCase names when required by Qt; everything else should stick to standard PEP-8 underscore_variable_names.

@jamie-pate
Owner

Amended.. er wierd, pr was on the wrong branch or something

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