about summary refs log tree commit diff stats
path: root/LICENSE
diff options
context:
space:
mode:
Diffstat (limited to 'LICENSE')
0 files changed, 0 insertions, 0 deletions
28:13 +0100 committer hut <hut@lavabit.com> 2009-11-23 22:28:13 +0100 test cases for directory.py' href='/akspecs/ranger/commit/test/tc_directory.py?h=v1.9.2&id=fe179145892d5835b33c79ab90b6ba257cf5f12d'>fe179145 ^
fae694a0 ^

fe179145 ^
fae694a0 ^

fe179145 ^
fae694a0 ^

fe179145 ^
fae694a0 ^
fe179145 ^

fae694a0 ^
fe179145 ^
fae694a0 ^




fe179145 ^

fae694a0 ^











fe179145 ^


fae694a0 ^
fe179145 ^
fae694a0 ^
fe179145 ^

fae694a0 ^


fe179145 ^


fae694a0 ^
fe179145 ^







fae694a0 ^














fe179145 ^
fae694a0 ^
fe179145 ^


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


                          
                                

                                                                                 
                                                   







                                                                 

                                                     
                                                 

                                                                            
 

                                                                                
                                                  
                                  

                                           
                                                           
 




                                                                                       

                                             











                                                                                 


                                                          
                                  
                
                                                   

                                                


                                                                            


                                                  
                                          







                                                                                  














                                                                               
 
                                   


               
88888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
.highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */
.highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */
.highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */
.highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */
.highlight .vc { color: #336699 } /* Name.Variable.Class */
.highlight .vg { color: #dd7700 } /* Name.Variable.Global */
.highlight .vi { color: #3333bb } /* Name.Variable.Instance */
.highlight .vm { color: #336699 } /* Name.Variable.Magic */
.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
# This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.

from __future__ import (absolute_import, division, print_function)

import curses
from ranger.gui.widgets.view_base import ViewBase
from ranger.gui.widgets.browsercolumn import BrowserColumn


class ViewMultipane(ViewBase):  # pylint: disable=too-many-ancestors

    def __init__(self, win):
        ViewBase.__init__(self, win)

        self.fm.signal_bind('tab.layoutchange', self._layoutchange_handler)
        self.fm.signal_bind('tab.change', self._tabchange_handler)
        self.rebuild()

    def _layoutchange_handler(self):
        if self.fm.ui.browser == self:
            self.rebuild()

    def _tabchange_handler(self, signal):
        if self.fm.ui.browser == self:
            if signal.old:
                signal.old.need_redraw = True
            if signal.new:
                signal.new.need_redraw = True

    def rebuild(self):
        self.columns = []

        for child in self.container:
            self.remove_child(child)
            child.destroy()
        for name, tab in self.fm.tabs.items():
            column = BrowserColumn(self.win, 0, tab=tab)
            column.main_column = True
            column.display_infostring = True
            if name == self.fm.current_tab:
                self.main_column = column
            self.columns.append(column)
            self.add_child(column)
        self.resize(self.y, self.x, self.hei, self.wid)

    def draw(self):
        if self.need_clear:
            self.win.erase()
            self.need_redraw = True
            self.need_clear = False

        ViewBase.draw(self)

        if self.settings.draw_borders:
            draw_borders = self.settings.draw_borders.lower()
            if draw_borders in ['both', 'true']:   # 'true' for backwards compat.
                border_types = ['separators', 'outline']
            else:
                border_types = [draw_borders]
            self._draw_borders(border_types)
        if self.draw_bookmarks:
            self._draw_bookmarks()
        elif self.draw_hints:
            self._draw_hints()
        elif self.draw_info:
            self._draw_info(self.draw_info)

    def _draw_borders(self, border_types):
        # Referenced from ranger.gui.widgets.view_miller
        win = self.win

        self.color('in_browser', 'border')

        left_start = 0
        right_end = self.wid - 1

        # Draw the outline borders
        if 'outline' in border_types:
            try:
                win.hline(0, left_start, curses.ACS_HLINE, right_end - left_start)
                win.hline(self.hei - 1, left_start, curses.ACS_HLINE, right_end - left_start)
                win.vline(1, left_start, curses.ACS_VLINE, self.hei - 2)
                win.vline(1, right_end, curses.ACS_VLINE, self.hei - 2)
                # Draw the four corners
                self.addch(0, left_start, curses.ACS_ULCORNER)
                self.addch(self.hei - 1, left_start, curses.ACS_LLCORNER)
                self.addch(0, right_end, curses.ACS_URCORNER)
                self.addch(self.hei - 1, right_end, curses.ACS_LRCORNER)
            except curses.error:
                pass

        # Draw the column separators
        if 'separators' in border_types:
            for child in self.columns[:-1]:
                x = child.x + child.wid
                y = self.hei - 1
                try:
                    win.vline(1, x, curses.ACS_VLINE, y - 1)
                    if 'outline' in border_types:
                        self.addch(0, x, curses.ACS_TTEE, 0)
                        self.addch(y, x, curses.ACS_BTEE, 0)
                    else:
                        self.addch(0, x, curses.ACS_VLINE, 0)
                        self.addch(y, x, curses.ACS_VLINE, 0)
                except curses.error:
                    # boundary out of index safety
                    pass

    def resize(self, y, x, hei=None, wid=None):
        ViewBase.resize(self, y, x, hei, wid)

        border_type = self.settings.draw_borders.lower()
        if border_type in ['outline', 'both', 'true']:
            # 'true' for backwards compat., no height pad needed for 'separators'
            pad = 1
        else:
            pad = 0
        column_width = int((wid - len(self.columns) + 1) / len(self.columns))
        left = 0
        top = 0
        for column in self.columns:
            column.resize(top + pad, left, hei - pad * 2, max(1, column_width))
            left += column_width + 1
            column.need_redraw = True
        self.need_redraw = True