added buttons (not finished)
This commit is contained in:
		
							parent
							
								
									a1d73f0902
								
							
						
					
					
						commit
						b8ebf8b909
					
				| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
(define-options-spec titlebar-options-spec
 | 
					(define-options-spec titlebar-options-spec
 | 
				
			||||||
  (buttons symbol-list '(kill)) ; iconize, maximize, roll
 | 
					  (buttons symbol-list '(kill)) ; kill, iconize, maximize
 | 
				
			||||||
  (normal-colors colors '("#aaaaaa" "#eeeeee" "#777777" "black"))
 | 
					  (normal-colors colors '("#aaaaaa" "#eeeeee" "#777777" "black"))
 | 
				
			||||||
  (active-colors colors '("#9999aa" "#eeeeff" "#777788" "black"))
 | 
					  (active-colors colors '("#9999aa" "#eeeeff" "#777788" "black"))
 | 
				
			||||||
  (focused-colors colors '("#666699" "#aaaacc" "#333366" "#eeeeee"))
 | 
					  (focused-colors colors '("#666699" "#aaaacc" "#333366" "#eeeeee"))
 | 
				
			||||||
| 
						 | 
					@ -26,9 +26,21 @@
 | 
				
			||||||
				  options-def))
 | 
									  options-def))
 | 
				
			||||||
	 (gc (create-gc dpy window '()))
 | 
						 (gc (create-gc dpy window '()))
 | 
				
			||||||
	 (tb (make-titlebar in-channel dpy window "test" 'normal))
 | 
						 (tb (make-titlebar in-channel dpy window "test" 'normal))
 | 
				
			||||||
	 ;; buttons... icon-window...
 | 
						 (button-channel out-channel)
 | 
				
			||||||
 | 
						 (button-size 13) ;; TODO has to be calculated from window-height
 | 
				
			||||||
 | 
						 (buttons (map (lambda (id i)
 | 
				
			||||||
 | 
								 (create-button dpy window colormap
 | 
				
			||||||
 | 
										(make-rectangle
 | 
				
			||||||
 | 
										 (+ 2 (* i (+ 2 button-size)))
 | 
				
			||||||
 | 
										 2 button-size button-size)
 | 
				
			||||||
 | 
										button-channel id
 | 
				
			||||||
 | 
										;; TODO: border-style -> colors
 | 
				
			||||||
 | 
										`((content . ,id))))
 | 
				
			||||||
 | 
							       (get-option-value options 'buttons)
 | 
				
			||||||
 | 
							       (iota (length (get-option-value options 'buttons)))))
 | 
				
			||||||
 | 
						 ;; icon-window...
 | 
				
			||||||
	 )
 | 
						 )
 | 
				
			||||||
    (mdisplay "creating titlebar " window "\n")
 | 
					    (for-each map-button buttons)
 | 
				
			||||||
    (spawn*
 | 
					    (spawn*
 | 
				
			||||||
     (list 'titlebar window)
 | 
					     (list 'titlebar window)
 | 
				
			||||||
     (lambda (release)
 | 
					     (lambda (release)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue