mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-24 09:18:08 +02:00
Show results frame in cyan while scan in progress
This commit is contained in:
@@ -268,7 +268,7 @@ func (h *Handler) draw_num_of_matches(num_shown, y int) {
|
||||
func (h *Handler) draw_results(y, bottom_margin int, matches *SortedResults, in_progress bool) (height int) {
|
||||
height = h.screen_size.height - y - bottom_margin
|
||||
h.lp.MoveCursorTo(1, 1+y)
|
||||
h.draw_frame(h.screen_size.width, height)
|
||||
h.draw_frame(h.screen_size.width, height, in_progress)
|
||||
h.lp.MoveCursorTo(1, 1+y)
|
||||
h.draw_results_title()
|
||||
y += 2
|
||||
|
||||
@@ -12,8 +12,14 @@ import (
|
||||
|
||||
var _ = fmt.Print
|
||||
|
||||
func (h *Handler) draw_frame(width, height int) {
|
||||
func (h *Handler) draw_frame(width, height int, in_progress bool) {
|
||||
lp := h.lp
|
||||
prefix, suffix := "", ""
|
||||
if in_progress {
|
||||
x := h.lp.SprintStyled("fg=cyan", " ")
|
||||
prefix, suffix, _ = strings.Cut(x, " ")
|
||||
lp.QueueWriteString(prefix)
|
||||
}
|
||||
for i := range height {
|
||||
lp.SaveCursorPosition()
|
||||
switch i {
|
||||
@@ -33,6 +39,9 @@ func (h *Handler) draw_frame(width, height int) {
|
||||
lp.RestoreCursorPosition()
|
||||
lp.MoveCursorVertically(1)
|
||||
}
|
||||
if suffix != "" {
|
||||
lp.QueueWriteString(suffix)
|
||||
}
|
||||
}
|
||||
|
||||
func (h *Handler) draw_search_text(available_width int) {
|
||||
@@ -93,7 +102,7 @@ func (h *Handler) draw_search_bar(y int) {
|
||||
left_margin, right_margin := 0, h.draw_controls(y)
|
||||
h.lp.MoveCursorTo(1+left_margin, 1+y)
|
||||
available_width := h.screen_size.width - left_margin - right_margin
|
||||
h.draw_frame(available_width, SEARCH_BAR_HEIGHT)
|
||||
h.draw_frame(available_width, SEARCH_BAR_HEIGHT, false)
|
||||
for y1 := y; y1 < y+4; y1++ {
|
||||
cr := h.state.mouse_state.AddCellRegion("search-bar", left_margin, y1, left_margin+available_width, y1)
|
||||
cr.PointerShape = loop.TEXT_POINTER
|
||||
|
||||
Reference in New Issue
Block a user