summary refs log tree commit diff stats
path: root/compiler/saturate.nim
Commit message (Expand)AuthorAgeFilesLines
* compiler: Trim .nim files trailing whitespaceAdam Strzelecki2015-09-041-1/+1
* Nimrod renamed to NimAraq2014-08-281-1/+1
* case consistency part 4Araq2013-12-271-6/+6
* changed integer promotion rules; breaks bootstrapping and lots of codeAraq2012-07-081-0/+79
anger/blame/ranger/gui/defaultui.py?id=4c05e43d11430fbfd8a5d86ae0070e24775251b1'>^
9506fb8e ^
49ae0dd1 ^
8db3c4b1 ^
d88232a3 ^

cfdbb9d6 ^
ddf828fb ^
a923ead7 ^
06aefcf5 ^

a6791aee ^
d88232a3 ^
a6791aee ^
9506fb8e ^
8db3c4b1 ^



e6dfc442 ^
a6791aee ^
ddf828fb ^

a6791aee ^
ddf828fb ^
a6791aee ^
a923ead7 ^
a6791aee ^
a923ead7 ^
a6791aee ^
8db3c4b1 ^
a6791aee ^


c1033553 ^
a6791aee ^
c1033553 ^

a6791aee ^
06aefcf5 ^
42fd3690 ^
a6791aee ^
06aefcf5 ^
d88232a3 ^

1159f9ec ^
49ae0dd1 ^
9506fb8e ^
acde88ad ^
a923ead7 ^
8db3c4b1 ^
c1033553 ^


d88232a3 ^
cfdbb9d6 ^

a923ead7 ^







e6dfc442 ^
06aefcf5 ^
5715beca ^

06aefcf5 ^

8db3c4b1 ^
06aefcf5 ^

5715beca ^

06aefcf5 ^

8db3c4b1 ^
5715beca ^
06aefcf5 ^

8db3c4b1 ^

06aefcf5 ^

8db3c4b1 ^
06aefcf5 ^
7ec262f8 ^

e6dfc442 ^

cfdbb9d6 ^
e6dfc442 ^


cfdbb9d6 ^
5715beca ^
e6dfc442 ^
ddf828fb ^
8db3c4b1 ^
ddf828fb ^




8db3c4b1 ^
ddf828fb ^

e6dfc442 ^
8db3c4b1 ^

633387ba ^
9a78b644 ^




a396b3a0 ^


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
 
                       
 

                            
                        
                                                              
                                                                      

                                                                
                                                                  
                                                                             
                                                            

                                                          
                                    
                                                  
                                             
 



                                                           
 
                                            

                                                    
                                         
 
                                                          
                                              
                                           
 
                                       
                                                                           


                                           
                                                
                                            

                                            
                                  
                                            
                                          
                                          
 

                                        
                                    
                                        
 
                                                                             
 
                                                                


                                                                    
                                                

                                                   







                                                                   
 
                              

                                                   

                                          
                                           

                             

                                                    

                                         
                                            
                                 

                                      

                                         

                                       
                                          
        

                                                   

                                                                  
                                                   


                                            
                                          
                                  
 
                            
                                            




                                         
                                           

                                         
                                   

                                                                 
        




                                                                             


                                           
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.browserview import BrowserView
		from ranger.gui.widgets.titlebar import TitleBar
		from ranger.gui.widgets.console import Console
		from ranger.gui.widgets.statusbar import StatusBar
		from ranger.gui.widgets.process_manager import ProcessManager
		from ranger.gui.widgets.notify import Notify
		from ranger.gui.widgets.pager import Pager

		# Create a title bar
		self.titlebar = TitleBar(self.win)
		self.add_child(self.titlebar)

		# Create the browser view
		self.browser = BrowserView(self.win, RATIO)
		self.add_child(self.browser)
		self.main_column = self.browser.main_column

		# Create the process manager
		self.pman = ProcessManager(self.win)
		self.pman.visible = False
		self.add_child(self.pman)

		# Create the (initially hidden) notify bar
		self.notify = Notify(self.win)
		self.add_child(self.notify)

		# Create the status bar
		self.status = StatusBar(self.win, self.browser.main_column)
		self.add_child(self.status)

		# Create the console
		self.console = Console(self.win)
		self.add_child(self.console)
		self.console.visible = False

		# Create the pager
		self.pager = Pager(self.win)
		self.pager.visible = False
		self.add_child(self.pager)

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

		notify_hei = min(max(1, y - 4), self.notify.requested_height)

		self.browser.resize(1, 0, y - 1 - notify_hei, x)
		self.pman.resize(1, 0, y - 1 - notify_hei, x)
		self.pager.resize(1, 0, y - 1 - notify_hei, x)
		self.notify.resize(y - notify_hei, 0, notify_hei, 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 poke(self):
		UI.poke(self)
		if self.notify.requested_height != self.notify.hei:
			self.update_size()
	
	def display(self, *a, **k):
		return self.notify.display(*a, **k)

	def close_pager(self):
		if self.console.visible:
			self.console.focused = True
		self.pager.visible = False
		self.pager.focused = False
		self.browser.visible = True
	
	def open_pager(self):
		if self.console.focused:
			self.console.focused = False
		self.pager.visible = True
		self.pager.focused = True
		self.browser.visible = False
		return self.pager

	def open_embedded_pager(self):
		self.browser.open_pager()
		return self.browser.pager

	def close_embedded_pager(self):
		self.browser.close_pager()
	
	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
		self.close_pager()

	def open_pman(self):
		self.browser.visible = False
		self.pman.visible = True
		self.pman.focused = True

	def close_pman(self):
		self.pman.visible = False
		self.browser.visible = True
		self.pman.focused = False

	def scroll(self, relative):
		if self.browser and self.browser.main_column:
			self.browser.main_column.scroll(relative)
	
	def throbber(self, string='.', remove=False):
		if remove:
			self.titlebar.throbber = type(self.titlebar).throbber
		else:
			self.titlebar.throbber = string

	def hint(self, text=None):
		self.status.override = text