fix layout issue
This commit is contained in:
+24
-32
@@ -812,47 +812,39 @@
|
|||||||
[:text {:fg :yellow :bold true} (str " " message)]))
|
[:text {:fg :yellow :bold true} (str " " message)]))
|
||||||
|
|
||||||
(defn main-grid-view
|
(defn main-grid-view
|
||||||
"Render the main lazygit-style grid layout using grid primitive."
|
"Render the main lazygit-style grid layout."
|
||||||
[model width height]
|
[model width height]
|
||||||
(let [has-message? (some? (:message model))
|
(let [has-message? (some? (:message model))
|
||||||
narrow? (< width 70)]
|
narrow? (< width 70)
|
||||||
(if narrow?
|
content (if narrow?
|
||||||
;; NARROW: Single column stacked layout
|
;; NARROW: Single column stacked
|
||||||
[:col {:width width :height height
|
[:col {:heights [3 :flex :flex :flex :flex :flex 4]}
|
||||||
:heights (if has-message?
|
|
||||||
[1 3 :flex :flex :flex :flex :flex 4 1]
|
|
||||||
[3 :flex :flex :flex :flex :flex 4 1])}
|
|
||||||
(when has-message? (message-view model))
|
|
||||||
(status-panel model)
|
(status-panel model)
|
||||||
(files-panel model)
|
(files-panel model)
|
||||||
(branches-panel model)
|
(branches-panel model)
|
||||||
(commits-panel model)
|
(commits-panel model)
|
||||||
(stash-panel model)
|
(stash-panel model)
|
||||||
(main-view-panel model)
|
(main-view-panel model)
|
||||||
(command-log-panel)
|
(command-log-panel)]
|
||||||
|
;; WIDE: Two columns using row/col
|
||||||
|
[:row {:gap 1 :widths [30 :flex]}
|
||||||
|
[:col {:heights [3 :flex :flex :flex :flex]}
|
||||||
|
(status-panel model)
|
||||||
|
(files-panel model)
|
||||||
|
(branches-panel model)
|
||||||
|
(commits-panel model)
|
||||||
|
(stash-panel model)]
|
||||||
|
[:col {:heights [:flex 4]}
|
||||||
|
(main-view-panel model)
|
||||||
|
(command-log-panel)]])]
|
||||||
|
(if has-message?
|
||||||
|
[:col {:width width :height height :heights [1 :flex 1]}
|
||||||
|
(message-view model)
|
||||||
|
content
|
||||||
(help-bar model)]
|
(help-bar model)]
|
||||||
;; WIDE: Two columns using grid
|
[:col {:width width :height height :heights [:flex 1]}
|
||||||
[:grid {:rows (if has-message?
|
content
|
||||||
[1 3 :flex :flex :flex :flex 4 1]
|
(help-bar model)])))
|
||||||
[3 :flex :flex :flex :flex 4 1])
|
|
||||||
:cols [30 :flex]
|
|
||||||
:gap 1}
|
|
||||||
;; Message row spans both columns (if present)
|
|
||||||
(when has-message?
|
|
||||||
[:area {:row 0 :col 0 :col-span 2} (message-view model)])
|
|
||||||
;; Left column panels
|
|
||||||
(let [row-offset (if has-message? 1 0)]
|
|
||||||
(list
|
|
||||||
[:area {:row row-offset :col 0} (status-panel model)]
|
|
||||||
[:area {:row (+ row-offset 1) :col 0} (files-panel model)]
|
|
||||||
[:area {:row (+ row-offset 2) :col 0} (branches-panel model)]
|
|
||||||
[:area {:row (+ row-offset 3) :col 0} (commits-panel model)]
|
|
||||||
[:area {:row (+ row-offset 4) :col 0} (stash-panel model)]
|
|
||||||
;; Right column panels (spanning all rows)
|
|
||||||
[:area {:row row-offset :col 1 :row-span 5} (main-view-panel model)]
|
|
||||||
[:area {:row (+ row-offset 5) :col 1} (command-log-panel)]
|
|
||||||
;; Help bar at bottom, spanning both columns
|
|
||||||
[:area {:row (+ row-offset 6) :col 0 :col-span 2} (help-bar model)]))])))
|
|
||||||
|
|
||||||
(defn view [model {:keys [width height] :or {width 120 height 30}}]
|
(defn view [model {:keys [width height] :or {width 120 height 30}}]
|
||||||
(let [background (main-grid-view model width height)]
|
(let [background (main-grid-view model width height)]
|
||||||
|
|||||||
Reference in New Issue
Block a user