summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2013-02-03 06:20:28 +0100
committerhut <hut@lavabit.com>2013-02-03 06:22:26 +0100
commitf826fd47ac40f920cf84de8158edb6458afdf892 (patch)
tree155a95fa71226a57d818256bd7337e72beec91a1 /ranger
parent66aad8a70013fdf76c1f77a9690e6c87d659cab7 (diff)
downloadranger-f826fd47ac40f920cf84de8158edb6458afdf892.tar.gz
gui.ui: shift column levels by 1 when pressing "i"
Diffstat (limited to 'ranger')
-rw-r--r--ranger/gui/ui.py6
-rw-r--r--ranger/gui/widgets/browsercolumn.py7
2 files changed, 13 insertions, 0 deletions
diff --git a/ranger/gui/ui.py b/ranger/gui/ui.py
index 1d47157c..78dab9de 100644
--- a/ranger/gui/ui.py
+++ b/ranger/gui/ui.py
@@ -330,10 +330,16 @@ class UI(DisplayableContainer):
 
 	def open_embedded_pager(self):
 		self.browser.open_pager()
+		for column in self.browser.columns:
+			if column == self.browser.main_column:
+				break
+			column.level_shift(amount=1)
 		return self.browser.pager
 
 	def close_embedded_pager(self):
 		self.browser.close_pager()
+		for column in self.browser.columns:
+			column.level_restore()
 
 	def open_console(self, string='', prompt=None, position=None):
 		if self.console.open(string, prompt=prompt, position=position):
diff --git a/ranger/gui/widgets/browsercolumn.py b/ranger/gui/widgets/browsercolumn.py
index a5579c15..fcf09845 100644
--- a/ranger/gui/widgets/browsercolumn.py
+++ b/ranger/gui/widgets/browsercolumn.py
@@ -35,6 +35,7 @@ class BrowserColumn(Pager):
 		Pager.__init__(self, win)
 		Widget.__init__(self, win)
 		self.level = level
+		self.original_level = level
 
 		self.settings.signal_bind('setopt.display_size_in_main_column',
 				self.request_redraw, weak=True)
@@ -119,6 +120,12 @@ class BrowserColumn(Pager):
 
 		return True
 
+	def level_shift(self, amount):
+		self.level = self.original_level + amount
+
+	def level_restore(self):
+		self.level = self.original_level
+
 	def poke(self):
 		Widget.poke(self)
 		self.target = self.fm.thistab.at_level(self.level)
tions.html?h=v1.9.0&id=4e01caf19cfbc798862e6b8b2dbd77328c8f99a2'>^
4c13e1f2 ^



f07bb12f ^

4c13e1f2 ^


f07bb12f ^





4c13e1f2 ^





f07bb12f ^












4c13e1f2 ^
f07bb12f ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176