Skip to content

Commit

Permalink
Improve focus display
Browse files Browse the repository at this point in the history
  • Loading branch information
vlaaad committed May 26, 2020
1 parent a1930ac commit 952e469
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/vlaaad/reveal/layout.clj
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,10 @@
gesture
focused]} layout]
(.clearRect ctx 0 0 canvas-width canvas-height)
(when focused
(doto ctx
(.setFill (fx.coerce/color style/selection-color))
(.fillRect 0 (- canvas-height 2) canvas-width 2)))
(when (and cursor anchor)
(let [from (-> anchor
(cursor/min cursor)
Expand Down
2 changes: 1 addition & 1 deletion src/vlaaad/reveal/stream.clj
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@
(as-> $
(if (pos? length)
(.append $ (subs text 0 (dec length)))
(.delete $ (dec max-length) max-length)))
(.delete $ ^int (dec max-length) ^int max-length)))
(.append ""))
:length new-length})

Expand Down
9 changes: 6 additions & 3 deletions src/vlaaad/reveal/style.clj
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,21 @@
"-summary" {:-fx-font-family font-family
:-fx-font-size font-size}
"-table"
{" .arrow" {:-fx-background-color util-color
{:-fx-table-cell-border-color unfocused-selection-color
:-fx-border-width [0 0 2 0]
:-fx-border-color :transparent
" .arrow" {:-fx-background-color util-color
:-fx-padding [3 4 3 4]
:-fx-shape "\"M 0 0 h 7 l -3.5 4 z\""}
" .filler" {:-fx-background-color unfocused-background-color}
:-fx-table-cell-border-color unfocused-selection-color
"-column" {:-fx-padding 0
:-fx-background-color unfocused-background-color
:-fx-border-color [:transparent unfocused-selection-color :transparent :transparent]}
"-cell" {:-fx-border-color [:transparent unfocused-selection-color :transparent :transparent]
:-fx-padding 0
":selected" {:-fx-background-color unfocused-selection-color}}
":focused .reveal-table-cell:selected" {:-fx-background-color selection-color}}
":focused" {:-fx-border-color selection-color
" .reveal-table-cell:selected" {:-fx-background-color selection-color}}}
"-chart"
{:-fx-focus-traversable true
:-fx-padding 2
Expand Down
2 changes: 2 additions & 0 deletions src/vlaaad/reveal/view.clj
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@
{:bounds (.localToScreen cell (.getBoundsInLocal cell))
:value (.getCellData (.getTableColumn pos) (.getRow pos))}))))

;; todo table view does not like repeated items, should use indices!

(defn table [{:keys [seqable]}]
(let [xs (seq seqable)
head (first xs)
Expand Down

0 comments on commit 952e469

Please sign in to comment.