no-sizer option and removal of unicode in source

This commit is contained in:
David Botton 2024-04-25 15:07:35 -04:00
parent 831723175b
commit 0a1264f898

View file

@ -757,6 +757,7 @@ The on-window-change clog-obj received is the new window"))
:documentation "Window closer clog-element") :documentation "Window closer clog-element")
(sizer (sizer
:accessor sizer :accessor sizer
:initform nil
:documentation "Window sizer clog-element") :documentation "Window sizer clog-element")
(last-width (last-width
:accessor last-width :accessor last-width
@ -941,6 +942,7 @@ The on-window-change clog-obj received is the new window"))
window-param window-param
hidden hidden
client-movement client-movement
no-sizer
border-class border-class
title-class title-class
html-id) html-id)
@ -969,6 +971,7 @@ window-to-top-by-param or window-by-param."))
(window-param nil) (window-param nil)
(hidden nil) (hidden nil)
(client-movement nil) (client-movement nil)
(no-sizer nil)
(border-class *default-border-class*) (border-class *default-border-class*)
(title-class *default-title-class*) (title-class *default-title-class*)
(html-id nil)) (html-id nil))
@ -1007,7 +1010,7 @@ window-to-top-by-param or window-by-param."))
</div> </div>
<div id='~A-body' ~A style='position:absolute;top:25px;left:0;right:0;bottom:3px;overflow:auto'>~A</div> <div id='~A-body' ~A style='position:absolute;top:25px;left:0;right:0;bottom:3px;overflow:auto'>~A</div>
<div id='~A-sizer' style='position:absolute;right:0;bottom:0;left:0;user-select:none;height:3px; <div id='~A-sizer' style='position:absolute;right:0;bottom:0;left:0;user-select:none;height:3px;
cursor:se-resize;opacity:0' ~Aopacity:0'
class='w3-right' data-drag-obj='~A' data-drag-type='s'>+</div> class='w3-right' data-drag-obj='~A' data-drag-type='s'>+</div>
</div>" </div>"
top left width height (incf (last-z app)) ; outer div top left width height (incf (last-z app)) ; outer div
@ -1015,18 +1018,22 @@ window-to-top-by-param or window-by-param."))
html-id title-class html-id html-id ; title bar html-id title-class html-id html-id ; title bar
title ; title title ; title
(if has-pinner ; pinner (if has-pinner ; pinner
(format nil "<span id='~A-pinner' (format nil "<span id='~A-pinner'
style='position:absolute;top:0;right:20px; style='position:absolute;top:0;right:20px;
cursor:pointer;user-select:none;'> cursor:pointer;user-select:none;'>
</span><span>&nbsp;&nbsp;&nbsp;</span>" html-id) ~A</span><span>&nbsp;&nbsp;&nbsp;</span>" html-id (code-char 9744))
"") "")
html-id ; closer html-id ; closer
html-id html-id
(if drag-client-area (if drag-client-area
(format nil "data-drag-obj='~A' data-drag-type='m'" html-id) (format nil "data-drag-obj='~A' data-drag-type='m'" html-id)
"") "")
content ; body content ; body
html-id html-id) ; size html-id ; sizer
(if no-sizer
""
"cursor:se-resize;")
html-id)
:clog-type 'clog-gui-window :clog-type 'clog-gui-window
:html-id html-id))) :html-id html-id)))
(setf (win-title win) (setf (win-title win)
@ -1039,7 +1046,8 @@ window-to-top-by-param or window-by-param."))
(when has-pinner (when has-pinner
(setf (pinner win) (attach-as-child win (format nil "~A-pinner" html-id)))) (setf (pinner win) (attach-as-child win (format nil "~A-pinner" html-id))))
(setf (closer win) (attach-as-child win (format nil "~A-closer" html-id))) (setf (closer win) (attach-as-child win (format nil "~A-closer" html-id)))
(setf (sizer win) (attach-as-child win (format nil "~A-sizer" html-id))) (unless no-sizer
(setf (sizer win) (attach-as-child win (format nil "~A-sizer" html-id))))
(setf (content win) (attach-as-child win (format nil "~A-body" html-id))) (setf (content win) (attach-as-child win (format nil "~A-body" html-id)))
(setf (gethash html-id (windows app)) win) (setf (gethash html-id (windows app)) win)
(set-on-click win (lambda (obj) (set-on-click win (lambda (obj)
@ -1124,11 +1132,12 @@ window-to-top-by-param or window-by-param."))
(declare (ignore obj data)) nil) (declare (ignore obj data)) nil)
:cancel-event t) :cancel-event t)
(set-on-pointer-down (content win) 'on-gui-drag-down :capture-pointer t))) (set-on-pointer-down (content win) 'on-gui-drag-down :capture-pointer t)))
(set-on-touch-start (sizer win) (lambda (obj data) (unless no-sizer
(declare (ignore obj data)) nil) (set-on-touch-start (sizer win) (lambda (obj data)
:cancel-event t) (declare (ignore obj data)) nil)
(set-on-pointer-down :cancel-event t)
(sizer win) 'on-gui-drag-down :capture-pointer t))) (set-on-pointer-down
(sizer win) 'on-gui-drag-down :capture-pointer t))))
win))) win)))
;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;
@ -1332,7 +1341,7 @@ to match the pinned state. :state forces state. Returns new state"))
(pinnedp win))) (pinnedp win)))
(progn (progn
(when (pinner win) (when (pinner win)
(setf (inner-html (pinner win)) "☐")) (setf (inner-html (pinner win)) (format nil "~A" (code-char 9744))))
(when keep-on-top (when keep-on-top
(window-keep-on-top win :state nil)) (window-keep-on-top win :state nil))
(setf (pinnedp win) nil) (setf (pinnedp win) nil)
@ -1344,7 +1353,7 @@ to match the pinned state. :state forces state. Returns new state"))
nil) nil)
(flet ((no-op (obj) (declare (ignore obj)) nil)) (flet ((no-op (obj) (declare (ignore obj)) nil))
(when (pinner win) (when (pinner win)
(setf (inner-html (pinner win)) "☑")) (setf (inner-html (pinner win)) (format nil "~A" (code-char 9745))))
(when keep-on-top (when keep-on-top
(window-keep-on-top win)) (window-keep-on-top win))
(setf (pinnedp win) t) (setf (pinnedp win) t)