diff options
author | hut <hut@lavabit.com> | 2009-11-29 20:35:23 +0100 |
---|---|---|
committer | hut <hut@lavabit.com> | 2009-11-29 20:35:23 +0100 |
commit | 5805deca6306eb888ebdad64c14119995521c6b8 (patch) | |
tree | 8041ac52247c99857e0d21dc4c4332cb97556f0e /ranger/gui/wtitlebar.py | |
parent | f027adc08ce0d15717c7694956f23ff637553543 (diff) | |
download | ranger-5805deca6306eb888ebdad64c14119995521c6b8.tar.gz |
random improvements
Diffstat (limited to 'ranger/gui/wtitlebar.py')
-rw-r--r-- | ranger/gui/wtitlebar.py | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/ranger/gui/wtitlebar.py b/ranger/gui/wtitlebar.py index 2ac8ae65..b95311dd 100644 --- a/ranger/gui/wtitlebar.py +++ b/ranger/gui/wtitlebar.py @@ -1,12 +1,33 @@ -import curses +import curses, socket from ranger.gui.widget import Widget as SuperClass + class WTitleBar(SuperClass): def feed_env(self, env): self.pathway = env.pathway + self.cf = env.cf def draw(self): self.win.move(self.y, self.x) + + try: + self.color('in_titlebar', 'hostname') + self.win.addnstr(socket.gethostname(), self.wid) + except: + pass + for path in self.pathway: currentx = self.win.getyx()[1] - self.win.addnstr(path.basename + ' / ', (self.wid - currentx)) + + if path.islink: + self.color('in_titlebar', 'link') + else: + self.color('in_titlebar', 'directory') + + self.win.addnstr(path.basename + '/', max(self.wid - currentx, 0)) + if self.cf is not None: + currentx = self.win.getyx()[1] + self.color('in_titlebar', 'file') + self.win.addnstr(self.cf.basename, max(self.wid - currentx, 0)) + self.color_reset() + |