summary refs log tree commit diff stats
path: root/doc/nep1.rst
diff options
context:
space:
mode:
Diffstat (limited to 'doc/nep1.rst')
0 files changed, 0 insertions, 0 deletions
7f894efd2d57a8'>^
1159f9ec ^

9506fb8e ^
49ae0dd1 ^

d88232a3 ^

cfdbb9d6 ^
d88232a3 ^

9506fb8e ^
49ae0dd1 ^


e6dfc442 ^
cfdbb9d6 ^

d88232a3 ^

cfdbb9d6 ^
d494f019 ^
d88232a3 ^

1159f9ec ^
49ae0dd1 ^
9506fb8e ^
cfdbb9d6 ^
d88232a3 ^
cfdbb9d6 ^

e6dfc442 ^
7ec262f8 ^

e6dfc442 ^

cfdbb9d6 ^
e6dfc442 ^


cfdbb9d6 ^
e6dfc442 ^

49ae0dd1 ^

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
 
                       
 

                            
                        

                                                                                  

                                                                
                                                                  

                                                  
 


                                                                            
 

                                                                     

                                                
                                            
 

                                        
                                    
                                        
 
                                                              
                                                

                                                   
 

                                                   

                                                                  
                                                   


                                            
                                          

                                   

                                                           
RATIO = ( 3, 3, 12, 9 )

from ranger.gui.ui import UI
class DefaultUI(UI):
	def setup(self):
		"""Build up the UI by initializing widgets."""
		from ranger.gui.widgets.filelistcontainer import FileListContainer
		from ranger.gui.widgets.titlebar import TitleBar
		from ranger.gui.widgets.console import Console
		from ranger.gui.widgets.statusbar import StatusBar
		self.titlebar = TitleBar(self.win)
		self.add_obj(self.titlebar)

		self.filelist_container = FileListContainer(self.win, RATIO)
		self.add_obj(self.filelist_container)
		self.main_filelist = self.filelist_container.main_filelist

		self.status = StatusBar(self.win, self.main_filelist)
		self.add_obj(self.status)
		self.console = Console(self.win)
		self.add_obj(self.console)
		self.console.visible = False

	def update_size(self):
		"""resize all widgets"""
		UI.update_size(self)
		y, x = self.env.termsize

		self.filelist_container.resize(1, 0, y - 2, x)
		self.titlebar.resize(0, 0, 1, x)
		self.status.resize(y - 1, 0, 1, x)
		self.console.resize(y - 1, 0, 1, x)

	def open_console(self, mode, string=''):
		if self.console.open(mode, string):
			self.console.on_close = self.close_console
			self.console.visible = True
			self.status.visible = False

	def close_console(self):
		self.console.visible = False
		self.status.visible = True

	def scroll(self, relative):
		if self.main_filelist:
			self.main_filelist.scroll(relative)