Merge lp:~stephen-j-boddy/terminator/bugfix-lp-1089162 into lp:terminator/trunk

Proposed by Stephen Boddy
Status: Merged
Merged at revision: 1579
Proposed branch: lp:~stephen-j-boddy/terminator/bugfix-lp-1089162
Merge into: lp:terminator/trunk
Diff against target: 13 lines (+2/-1)
1 file modified
terminatorlib/paned.py (+2/-1)
To merge this branch: bzr merge lp:~stephen-j-boddy/terminator/bugfix-lp-1089162
Reviewer Review Type Date Requested Status
Terminator Pending
Review via email: mp+139750@code.launchpad.net

Description of the change

Trivial fix for off-center splits. Line was not accounting for the size of the handle.

To post a comment you must log in.
Revision history for this message
Stephen Boddy (stephen-j-boddy) wrote :

Hmm. I'm thinking about it now, and wondering if the function below (set_position) need changing to allow for handle size too. I think we are setting the ratio to the left/top point of the splitter. If the splitter is non-zero then the ratio will be slightly off.

Revision history for this message
Chris Jones (cmsj) wrote :

Stephen: Do you still want to get this applied? Or do you think it would be better to change more stuff in one go?

Revision history for this message
Stephen Boddy (stephen-j-boddy) wrote :

Chris: I've switched this to Work in progress. As well as the comment above, after submitting for merging I noticed some odd jumpiness in splitter behviour that I haven't had time to figure out and fix. I'll come back to it when I get the opportunity.

Revision history for this message
Stephen Boddy (stephen-j-boddy) wrote :

The patch below was not enough. Revision 1579 is the full fix, although there is still an issue with erratic behaviour when equalizing splits, it seems that was there before, and is an unrelated issue.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'terminatorlib/paned.py'
2--- terminatorlib/paned.py 2012-10-19 16:57:23 +0000
3+++ terminatorlib/paned.py 2012-12-13 17:11:26 +0000
4@@ -386,7 +386,8 @@
5 self.set_position(self.get_position())
6
7 def set_position_by_ratio(self):
8- self.set_pos(int(self.ratio*self.get_length()))
9+ handle_size = self.style_get_property('handle-size')
10+ self.set_pos(int((self.ratio*self.get_length())-(handle_size/2.0)))
11
12 def set_position(self, pos):
13 self.ratio = float(pos) / self.get_length()