summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-04-14 16:35:06 +0200
committerhut <hut@lavabit.com>2010-04-14 16:35:06 +0200
commit1d3d94aac68790581e1e4027d0ecc868c516fea1 (patch)
tree96b254d3c17b14571c4bc30f29b44538f9058db0
parent7327aab14542763cdd1e135ed5317fccab1d51d4 (diff)
downloadranger-1d3d94aac68790581e1e4027d0ecc868c516fea1.tar.gz
widget.browsercolumn: display "?" in info in a different color
-rw-r--r--ranger/colorschemes/default.py5
-rw-r--r--ranger/gui/context.py2
-rw-r--r--ranger/gui/widgets/browsercolumn.py7
3 files changed, 13 insertions, 1 deletions
diff --git a/ranger/colorschemes/default.py b/ranger/colorschemes/default.py
index 335fdf53..317e8258 100644
--- a/ranger/colorschemes/default.py
+++ b/ranger/colorschemes/default.py
@@ -71,6 +71,11 @@ class Default(ColorScheme):
 				if context.marked:
 					attr |= bold
 					fg = yellow
+			if context.badinfo:
+				if attr & reverse:
+					bg = magenta
+				else:
+					fg = magenta
 
 		elif context.in_titlebar:
 			attr |= bold
diff --git a/ranger/gui/context.py b/ranger/gui/context.py
index 585dd674..1e127a2e 100644
--- a/ranger/gui/context.py
+++ b/ranger/gui/context.py
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-CONTEXT_KEYS = ['reset', 'error',
+CONTEXT_KEYS = ['reset', 'error', 'badinfo',
 		'in_browser', 'in_statusbar', 'in_titlebar', 'in_console',
 		'in_pager', 'in_taskview',
 		'directory', 'file', 'hostname',
diff --git a/ranger/gui/widgets/browsercolumn.py b/ranger/gui/widgets/browsercolumn.py
index 7d38576d..c0b60a2e 100644
--- a/ranger/gui/widgets/browsercolumn.py
+++ b/ranger/gui/widgets/browsercolumn.py
@@ -20,6 +20,7 @@ from time import time
 
 from . import Widget
 from .pager import Pager
+from ranger.fsobject import BAD_INFO
 
 # Don't even try to preview files which mach this regular expression:
 PREVIEW_BLACKLIST = re.compile(r"""
@@ -252,6 +253,7 @@ class BrowserColumn(Pager):
 			except IndexError:
 				break
 
+			bad_info_color = None
 			this_color = base_color + list(drawn.mimetype_tuple)
 			text = drawn.basename
 			tagged = self.fm.tags and drawn.realpath in self.fm.tags
@@ -306,6 +308,8 @@ class BrowserColumn(Pager):
 						and self.settings.display_size_in_main_column:
 					info = drawn.infostring
 					x = self.wid - 1 - len(info)
+					if info is BAD_INFO:
+						bad_info_color = (x, len(str(info)))
 					if x > self.x:
 						self.win.addstr(line, x, str(info) + ' ')
 			except:
@@ -314,6 +318,9 @@ class BrowserColumn(Pager):
 				pass
 
 			self.color_at(line, 0, self.wid, this_color)
+			if bad_info_color:
+				start, wid = bad_info_color
+				self.color_at(line, start, wid, this_color, 'badinfo')
 
 			if self.main_column and tagged and self.wid > 2:
 				this_color.append('tag_marker')
a'>^
e7fa504 ^
8a34fa5 ^
d7e1708 ^
8a34fa5 ^
dc5d967 ^
8a34fa5 ^
650a1fb ^
8a34fa5 ^
e7fa504 ^
650a1fb ^
8a34fa5 ^
b1701ad ^
39677ec ^
650a1fb ^
8a34fa5 ^
39677ec ^
8a34fa5 ^

39677ec ^
8a34fa5 ^

39677ec ^
8a34fa5 ^

650a1fb ^


8a34fa5 ^

9e8b325 ^
8a34fa5 ^

650a1fb ^
8a34fa5 ^

e7fa504 ^

650a1fb ^


8a34fa5 ^


650a1fb ^


8a34fa5 ^


bf35794 ^
c09bf8d ^





937cabf ^
c09bf8d ^






4688ad1 ^
c09bf8d ^














4688ad1 ^
c09bf8d ^


4688ad1 ^



c09bf8d ^
e6cbe9c ^
c09bf8d ^

adaa28a ^




























e6cbe9c ^

adaa28a ^

9e8b325 ^
c0705ee ^
8a34fa5 ^
9e8b325 ^
dc5d967 ^
9e8b325 ^
8a34fa5 ^



8a34fa5 ^
c0705ee ^
8a34fa5 ^

d7e1708 ^
8a34fa5 ^
8a8b795 ^
8a34fa5 ^
9e8b325 ^


8a34fa5 ^



9e8b325 ^


8a34fa5 ^

9e8b325 ^
8a34fa5 ^


8a34fa5 ^
9e8b325 ^







8a34fa5 ^



9e8b325 ^






dba2306 ^
9e8b325 ^

8a34fa5 ^
9e8b325 ^
8a34fa5 ^
adaa28a ^

adaa28a ^



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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236