about summary refs log tree commit diff stats
Commit message (Expand)AuthorAgeFilesLines
...
* | | Merge branch 'Nfanja-patch-1'toonn2020-11-151-1/+1
|\ \ \
| * | | Add decrementtoonn2020-11-151-1/+1
| * | | add forgotten maxFedor2020-11-151-1/+1
| * | | Fix ranger freeze after shell command during kitty previewFedor2020-11-151-1/+1
|/ / /
* | | Merge branch 'pretty-make'toonn2020-11-131-8/+17
|\ \ \
| * | | Change "sgr0" to "normal" for legibilitytoonn2020-11-131-9/+9
| * | | Add formatting to make output for claritytoonn2020-11-131-8/+17
|/ / /
* | | Merge branch 'fix-travis'toonn2020-11-116-42/+51
|\ \ \
| * | | Fix test_py2_compat formattingtoonn2020-11-111-0/+1
| * | | Drop py3 specific pylint for ranger/configtoonn2020-11-111-1/+1
| * | | Shortcut py2 incompatible pytest teststoonn2020-11-111-0/+11
| * | | Unalign code because bad-whitspace was removedtoonn2020-11-113-40/+37
| * | | Add new py3 specific pylint warnings to disabledtoonn2020-11-111-1/+1
|/ / /
* | | Merge branch 'politas-fix/1880-multipane-status'toonn2020-11-111-1/+7
|\ \ \
| * \ \ Merge branch 'master' into fix/1880-multipane-statusMyk2020-11-072-13/+20
| |\ \ \
| * | | | unbind from tab.changeMyk2020-08-061-1/+0
| * | | | Merge branch 'fix/1880-multipane-status' of https://github.com/politas/ranger...Myk2020-08-022-2/+22
| |\ \ \ \
| | * \ \ \ Merge branch 'master' into fix/1880-multipane-statusMyk2020-08-022-2/+22
| | |\ \ \ \ | | | | |/ / | | | |/| |
| * | / | | Add handler for tab.layoutchangeMyk2020-08-021-0/+1
| |/ / / /
| * | | | Handle all column changesMyk2020-08-011-4/+4
| * | | | Test for and follow tab changes in multipane modeMyk2020-08-011-1/+7
* | | | | Merge branch 'plesiv-master'toonn2020-11-084-15/+15
|\ \ \ \ \ | |_|_|/ / |/| | | |
| * | | | Regenerate rifle man pagetoonn2020-11-081-1/+1
| * | | | Update the docs to reflect changes to codeZoran Plesivcak2020-11-083-6/+6
| * | | | Allow $PAGER to contain spaces (handle pager flags)Zoran Plesivcak2020-11-081-8/+8
|/ / / /
* | | | Merge branch 'swalladge-extra-rifle-apps'toonn2020-11-061-12/+19
|\ \ \ \
| * | | | Fix rifle rule alignmenttoonn2020-11-061-10/+10
| * | | | Add support for more apps in rifle default configSamuel Walladge2019-10-231-6/+13
* | | | | Merge branch 'cache-hash'toonn2020-10-041-1/+1
|\ \ \ \ \ | |_|_|/ / |/| | | |
| * | | | Fix encoding of cached filenamestoonn2020-10-041-1/+1
|/ / / /
* | | | Merge branch 'multipane-selection'toonn2020-08-012-2/+22
|\ \ \ \ | |_|/ / |/| | |
| * | | Add initialization and fix indentationtoonn2020-08-011-3/+6
| * | | Selection in multipane viewmode was misleadingtoonn2020-07-272-2/+19
|/ / /
* | | Merge branch 'cache-hash'toonn2020-07-241-4/+5
|\ \ \
| * | | Fix unicode decode issues in py2toonn2020-07-241-4/+5
|/ / /
* | | Merge branch 'cache-hash'toonn2020-07-081-8/+13
|\ \ \
| * | | Fix check for Nonetoonn2020-07-081-2/+2
| * | | Add path to cache hashtoonn2020-07-081-11/+13
| * | | Drop st_dev from sha512_encodetoonn2020-07-071-2/+1
| * | | Switch to packing fields for sha512_encodetoonn2020-07-071-5/+7
| * | | Fix indendation of sha512_encodetoonn2020-07-071-4/+5
| * | | Hashlib requires objects implementing the buffer APItoonn2020-07-071-3/+4
* | | | Merge pull request #2034 from toonn/py-version-checksWojciech Siewierski2020-07-071-4/+6
|\ \ \ \
| * | | | Refactor _add_character as static methodtoonn2020-07-071-40/+40
| * | | | Refactor _add_character as functiontoonn2020-07-071-39/+40
| * | | | Missed a couple py3 version checkstoonn2020-07-071-3/+4
|/ / / /
* | | | Merge branch 'windowserror'toonn2020-07-051-11/+1
|\ \ \ \
| * | | | Remove WindowsErrortoonn2020-07-051-11/+1
|/ / / /
* | | | Merge branch 'pylint3k'toonn2020-07-0526-102/+356
|\ \ \ \
| * | | | Apply some PEP8 love to the pylint module and teststoonn2020-07-052-20/+17
=1ede1c3c6d3fc2ec8070da4c726b3fbe1bf9d374'>^
674d571 ^
8d4d00d ^
3b36093 ^
674d571 ^
3b36093 ^
674d571 ^
8d4d00d ^
674d571 ^
8d4d00d ^
3b36093 ^
674d571 ^
8d4d00d ^
3b36093 ^
674d571 ^
3b36093 ^
674d571 ^
8d4d00d ^
9bbfc2b ^
3b36093 ^
674d571 ^


3b36093 ^
674d571 ^
de495ae ^
674d571 ^
3b36093 ^
674d571 ^
de495ae ^
674d571 ^
3b36093 ^
674d571 ^
de495ae ^
674d571 ^
3b36093 ^
674d571 ^
de495ae ^
674d571 ^
3b36093 ^
674d571 ^
e27165c ^
674d571 ^
3b36093 ^
674d571 ^
e27165c ^
3850fba ^
b7a67ab ^
de495ae ^

674d571 ^

de495ae ^
674d571 ^
de495ae ^
674d571 ^
de495ae ^
674d571 ^
de495ae ^

674d571 ^
de495ae ^


de495ae ^
ce31b74 ^
de495ae ^
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


                                                              
                       
                                
                                                            
                           
                                                                                                            
                           
                                                                                                                  
                           
                                                                                                
                           
                                                                                                                
                           
                                                                                                     

                                                  
                                                                                                  


                                              
                                                                                       


                                                   
                                                                                                           


                                                
                                                                                              


                                                 
                                                                                          


                                                   
                                                                                            


                                                
                                                                                         

                             
                                                                                                              
                           
                                                                              
                           
                                  
                                                                                                                                                  

   


                                                           
                       
                                
                                                                                                            
                           
                                                                

                                                  
                                                                                                   

                                                                                               
                                                                                                 

                                                    
                                            
                                                                                                     
                               
                                                                                         
        
                                                                                                  
       

                                                     
                                                                                                    
                             
                                                                                      

                                                       
                                         
                                                                                          
                               
        
                                                                                                        
                               
                                                                                                       
                               
       
                                                    
                                         
                                                                                       
                               
        
                                                                                                     
                               
                                                                                                    
                               
       
     
                                                                                                                 


                                              
                                                                                  
                             
     
                                                   
                                                                                                      
                             
     
                                                
                                                                                         
                             
     
                                                 
                                                                                     
                             
     
                                                   
                                                                                       
                             
     
                                                
                                                                                    
                             
     
                                  
                                                                                                                                                  

   

                                                  
                            
                                                  
                          
                                                       
                                     
                                                                                    

                
                                     


     
                        
                                 
   
function draw_help_without_mouse_pressed(State, drawing_index)
  local drawing = State.lines[drawing_index]
  local line_cache = State.line_cache[drawing_index]
  App.color(Help_color)
  local y = line_cache.starty+10
  love.graphics.print("Things you can do:", State.left+30,y)
  y = y + State.line_height
  love.graphics.print("* Press the mouse button to start drawing a "..current_shape(State), State.left+30,y)
  y = y + State.line_height
  love.graphics.print("* Hover on a point and press 'ctrl+u' to pick it up and start moving it,", State.left+30,y)
  y = y + State.line_height
  love.graphics.print("then press the mouse button to drop it", State.left+30+bullet_indent(),y)
  y = y + State.line_height
  love.graphics.print("* Hover on a point and press 'ctrl+n', type a name, then press 'enter'", State.left+30,y)
  y = y + State.line_height
  love.graphics.print("* Hover on a point or shape and press 'ctrl+d' to delete it", State.left+30,y)
  y = y + State.line_height
  if State.current_drawing_mode ~= 'freehand' then
    love.graphics.print("* Press 'ctrl+p' to switch to drawing freehand strokes", State.left+30,y)
    y = y + State.line_height
  end
  if State.current_drawing_mode ~= 'line' then
    love.graphics.print("* Press 'ctrl+l' to switch to drawing lines", State.left+30,y)
    y = y + State.line_height
  end
  if State.current_drawing_mode ~= 'manhattan' then
    love.graphics.print("* Press 'ctrl+m' to switch to drawing horizontal/vertical lines", State.left+30,y)
    y = y + State.line_height
  end
  if State.current_drawing_mode ~= 'circle' then
    love.graphics.print("* Press 'ctrl+o' to switch to drawing circles/arcs", State.left+30,y)
    y = y + State.line_height
  end
  if State.current_drawing_mode ~= 'polygon' then
    love.graphics.print("* Press 'ctrl+g' to switch to drawing polygons", State.left+30,y)
    y = y + State.line_height
  end
  if State.current_drawing_mode ~= 'rectangle' then
    love.graphics.print("* Press 'ctrl+r' to switch to drawing rectangles", State.left+30,y)
    y = y + State.line_height
  end
  if State.current_drawing_mode ~= 'square' then
    love.graphics.print("* Press 'ctrl+s' to switch to drawing squares", State.left+30,y)
    y = y + State.line_height
  end
  love.graphics.print("* Press 'ctrl+=' or 'ctrl+-' to zoom in or out, ctrl+0 to reset zoom", State.left+30,y)
  y = y + State.line_height
  love.graphics.print("Press 'esc' now to hide this message", State.left+30,y)
  y = y + State.line_height
  App.color(Help_background_color)
  love.graphics.rectangle('fill', State.left,line_cache.starty, State.width, math.max(Drawing.pixels(drawing.h, State.width),y-line_cache.starty))
end

function draw_help_with_mouse_pressed(State, drawing_index)
  local drawing = State.lines[drawing_index]
  local line_cache = State.line_cache[drawing_index]
  App.color(Help_color)
  local y = line_cache.starty+10
  love.graphics.print("You're currently drawing a "..current_shape(State, drawing.pending), State.left+30,y)
  y = y + State.line_height
  love.graphics.print('Things you can do now:', State.left+30,y)
  y = y + State.line_height
  if State.current_drawing_mode == 'freehand' then
    love.graphics.print('* Release the mouse button to finish drawing the stroke', State.left+30,y)
    y = y + State.line_height
  elseif State.current_drawing_mode == 'line' or State.current_drawing_mode == 'manhattan' then
    love.graphics.print('* Release the mouse button to finish drawing the line', State.left+30,y)
    y = y + State.line_height
  elseif State.current_drawing_mode == 'circle' then
    if drawing.pending.mode == 'circle' then
      love.graphics.print('* Release the mouse button to finish drawing the circle', State.left+30,y)
      y = y + State.line_height
      love.graphics.print("* Press 'a' to draw just an arc of a circle", State.left+30,y)
    else
      love.graphics.print('* Release the mouse button to finish drawing the arc', State.left+30,y)
    end
    y = y + State.line_height
  elseif State.current_drawing_mode == 'polygon' then
    love.graphics.print('* Release the mouse button to finish drawing the polygon', State.left+30,y)
    y = y + State.line_height
    love.graphics.print("* Press 'p' to add a vertex to the polygon", State.left+30,y)
    y = y + State.line_height
  elseif State.current_drawing_mode == 'rectangle' then
    if #drawing.pending.vertices < 2 then
      love.graphics.print("* Press 'p' to add a vertex to the rectangle", State.left+30,y)
      y = y + State.line_height
    else
      love.graphics.print('* Release the mouse button to finish drawing the rectangle', State.left+30,y)
      y = y + State.line_height
      love.graphics.print("* Press 'p' to replace the second vertex of the rectangle", State.left+30,y)
      y = y + State.line_height
    end
  elseif State.current_drawing_mode == 'square' then
    if #drawing.pending.vertices < 2 then
      love.graphics.print("* Press 'p' to add a vertex to the square", State.left+30,y)
      y = y + State.line_height
    else
      love.graphics.print('* Release the mouse button to finish drawing the square', State.left+30,y)
      y = y + State.line_height
      love.graphics.print("* Press 'p' to replace the second vertex of the square", State.left+30,y)
      y = y + State.line_height
    end
  end
  love.graphics.print("* Press 'esc' then release the mouse button to cancel the current shape", State.left+30,y)
  y = y + State.line_height
  y = y + State.line_height
  if State.current_drawing_mode ~= 'line' then
    love.graphics.print("* Press 'l' to switch to drawing lines", State.left+30,y)
    y = y + State.line_height
  end
  if State.current_drawing_mode ~= 'manhattan' then
    love.graphics.print("* Press 'm' to switch to drawing horizontal/vertical lines", State.left+30,y)
    y = y + State.line_height
  end
  if State.current_drawing_mode ~= 'circle' then
    love.graphics.print("* Press 'o' to switch to drawing circles/arcs", State.left+30,y)
    y = y + State.line_height
  end
  if State.current_drawing_mode ~= 'polygon' then
    love.graphics.print("* Press 'g' to switch to drawing polygons", State.left+30,y)
    y = y + State.line_height
  end
  if State.current_drawing_mode ~= 'rectangle' then
    love.graphics.print("* Press 'r' to switch to drawing rectangles", State.left+30,y)
    y = y + State.line_height
  end
  if State.current_drawing_mode ~= 'square' then
    love.graphics.print("* Press 's' to switch to drawing squares", State.left+30,y)
    y = y + State.line_height
  end
  App.color(Help_background_color)
  love.graphics.rectangle('fill', State.left,line_cache.starty, State.width, math.max(Drawing.pixels(drawing.h, State.width),y-line_cache.starty))
end

function current_shape(State, shape)
  if State.current_drawing_mode == 'freehand' then
    return 'freehand stroke'
  elseif State.current_drawing_mode == 'line' then
    return 'straight line'
  elseif State.current_drawing_mode == 'manhattan' then
    return 'horizontal/vertical line'
  elseif State.current_drawing_mode == 'circle' and shape and shape.start_angle then
    return 'arc'
  else
    return State.current_drawing_mode
  end
end

function bullet_indent()
  return App.width(to_text('* '))
end