update API
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
"lazygitclj - A lazygit-inspired TUI for git."
|
"lazygitclj - A lazygit-inspired TUI for git."
|
||||||
(:require [tui.core :as tui]
|
(:require [tui.core :as tui]
|
||||||
[tui.events :as ev :refer [key=]]
|
[tui.events :as ev :refer [key=]]
|
||||||
|
[tui.terminal :as term]
|
||||||
[lazygitclj.git :as git]
|
[lazygitclj.git :as git]
|
||||||
[clojure.string :as str]))
|
[clojure.string :as str]))
|
||||||
|
|
||||||
@@ -813,8 +814,9 @@
|
|||||||
|
|
||||||
(defn main-grid-view
|
(defn main-grid-view
|
||||||
"Render the main lazygit-style grid layout."
|
"Render the main lazygit-style grid layout."
|
||||||
[model width height]
|
[model]
|
||||||
(let [has-message? (some? (:message model))
|
(let [has-message? (some? (:message model))
|
||||||
|
{:keys [width]} (term/get-terminal-size)
|
||||||
narrow? (< width 70)
|
narrow? (< width 70)
|
||||||
content (if narrow?
|
content (if narrow?
|
||||||
;; NARROW: Single column stacked
|
;; NARROW: Single column stacked
|
||||||
@@ -838,16 +840,16 @@
|
|||||||
(main-view-panel model)
|
(main-view-panel model)
|
||||||
(command-log-panel)]])]
|
(command-log-panel)]])]
|
||||||
(if has-message?
|
(if has-message?
|
||||||
[:col {:width width :height height :heights [1 :flex 1]}
|
[:col {:heights [1 :flex 1]}
|
||||||
(message-view model)
|
(message-view model)
|
||||||
content
|
content
|
||||||
(help-bar model)]
|
(help-bar model)]
|
||||||
[:col {:width width :height height :heights [:flex 1]}
|
[:col {:heights [:flex 1]}
|
||||||
content
|
content
|
||||||
(help-bar model)])))
|
(help-bar model)])))
|
||||||
|
|
||||||
(defn view [model {:keys [width height] :or {width 120 height 30}}]
|
(defn view [model]
|
||||||
(let [background (main-grid-view model width height)]
|
(let [background (main-grid-view model)]
|
||||||
(cond
|
(cond
|
||||||
;; Help menu modal overlay
|
;; Help menu modal overlay
|
||||||
(= (:menu-mode model) :help)
|
(= (:menu-mode model) :help)
|
||||||
|
|||||||
Reference in New Issue
Block a user