diff options
author | Joe <rbo@gmx.us> | 2024-04-18 20:20:20 +0200 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2024-04-18 20:20:20 +0200 |
commit | 69c34b1290ed8759dadeb1c6748c37e5a7c78ae4 (patch) | |
tree | 0e4e19e301cdc9eca6e5a6f4e7cb13fc59fb1d85 /src | |
parent | add (diff) | |
download | hardflip-69c34b1290ed8759dadeb1c6748c37e5a7c78ae4.tar.gz hardflip-69c34b1290ed8759dadeb1c6748c37e5a7c78ae4.tar.bz2 hardflip-69c34b1290ed8759dadeb1c6748c37e5a7c78ae4.tar.xz hardflip-69c34b1290ed8759dadeb1c6748c37e5a7c78ae4.tar.zst hardflip-69c34b1290ed8759dadeb1c6748c37e5a7c78ae4.zip |
go
Diffstat (limited to '')
-rw-r--r-- | src/c_defs.go | 2 | ||||
-rw-r--r-- | src/c_hardflip.go | 13 | ||||
-rw-r--r-- | src/i_events.go | 6 | ||||
-rw-r--r-- | src/i_host.go | 14 | ||||
-rw-r--r-- | src/i_ui.go | 1 |
5 files changed, 26 insertions, 10 deletions
diff --git a/src/c_defs.go b/src/c_defs.go index 3179488..48afed0 100644 --- a/src/c_defs.go +++ b/src/c_defs.go @@ -156,7 +156,7 @@ const ( ) var ( - HOST_ICONS = [4]string{" ", " ", " ", " "} + HOST_ICONS = [4]string{" ", " ", " ", " "} DIRS_ICONS = [2]string{" ", " "} RDP_SCREENSIZE = [7]string{ "800x600", diff --git a/src/c_hardflip.go b/src/c_hardflip.go index cf3f2de..fb2d86a 100644 --- a/src/c_hardflip.go +++ b/src/c_hardflip.go @@ -53,17 +53,18 @@ package main // the main data structure, holds up everything important type HardData struct { - litems *ItemsList - ldirs *DirsList - ui HardUI - opts HardOpts - folds map[*DirsNode]*ItemsList + litems *ItemsList + ldirs *DirsList + ui HardUI + opts HardOpts + folds map[*DirsNode]*ItemsList data_dir string home_dir string load_err []error insert_err []error - keys [][2]string + keys [][2]string insert *HostNode + yank *ItemsNode } func main() { diff --git a/src/i_events.go b/src/i_events.go index 41cee0f..7aad44a 100644 --- a/src/i_events.go +++ b/src/i_events.go @@ -487,6 +487,12 @@ func i_events(data *HardData) { } else if event.Rune() == 'm' || event.Key() == tcell.KeyF7 { data.ui.mode = MKDIR_MODE + } else if event.Rune() == 'y' { + if data.litems.curr == nil || + data.litems.curr.is_dir() == true { + break + } + data.yank = data.litems.curr } i_list_follow_cursor(data.litems, ui) case DELETE_MODE: diff --git a/src/i_host.go b/src/i_host.go index 829a1d9..c30c444 100644 --- a/src/i_host.go +++ b/src/i_host.go @@ -51,6 +51,8 @@ package main +import "github.com/gdamore/tcell/v2" + func i_host_panel_dirs(ui HardUI, icons bool, dir_icon uint8, dir *DirsNode, curr *DirsNode, line int) { style := ui.style[DIR_STYLE] @@ -58,7 +60,7 @@ func i_host_panel_dirs(ui HardUI, icons bool, dir_icon uint8, // style = style.Background(tcell.ColorBlack) style = style.Reverse(true) } - text := "" + text := " " for i := 0; i < int(dir.Depth) - 2; i++ { text += " " } @@ -77,13 +79,18 @@ func i_host_panel_dirs(ui HardUI, icons bool, dir_icon uint8, } func i_host_panel_host(ui HardUI, icons bool, - depth uint16, host *HostNode, curr *HostNode, line int) { + depth uint16, host *HostNode, curr *HostNode, yank *ItemsNode, + line int) { style := ui.style[DEF_STYLE] + if yank != nil && host == yank.Host { + style = style.Foreground(tcell.ColorPurple).Bold(true) + // TODO: here + } if host == curr { // style = style.Background(tcell.ColorBlack) style = style.Reverse(true) } - text := "" + text := " " for i := 0; i < int(depth + 1) - 2; i++ { text += " " } @@ -117,6 +124,7 @@ func i_draw_host_panel(ui HardUI, icons bool, ptr.Host.parent.Depth, ptr.Host, litems.curr.Host, + data.yank, line) line++ } else if ptr.Dirs != nil { diff --git a/src/i_ui.go b/src/i_ui.go index 30dfce2..25395d6 100644 --- a/src/i_ui.go +++ b/src/i_ui.go @@ -678,6 +678,7 @@ func i_ui(data_dir string) { nil, [][2]string{}, nil, + nil, } if data.opts.GPG == DEFAULT_OPTS.GPG && data.litems.head == nil { data.ui.mode = WELCOME_MODE |