Refine transfer UX and active-pane selection rendering
This commit is contained in:
parent
5a5923099b
commit
874a5ed678
3 changed files with 5 additions and 16 deletions
|
|
@ -42,9 +42,9 @@ func DefaultKeyMap() KeyMap {
|
|||
Down: key.NewBinding(key.WithKeys("down", "j"), key.WithHelp("↓/j", "down")),
|
||||
PageUp: key.NewBinding(key.WithKeys("pgup", "b"), key.WithHelp("PgUp/b", "page up")),
|
||||
PageDown: key.NewBinding(key.WithKeys("pgdown", "f"), key.WithHelp("PgDn/f", "page down")),
|
||||
Open: key.NewBinding(key.WithKeys("enter", "right", "l"), key.WithHelp("Enter", "open")),
|
||||
Back: key.NewBinding(key.WithKeys("backspace", "left", "h"), key.WithHelp("←", "parent")),
|
||||
Switch: key.NewBinding(key.WithKeys("tab"), key.WithHelp("Tab", "switch pane")),
|
||||
Open: key.NewBinding(key.WithKeys("enter", "right"), key.WithHelp("Enter", "open")),
|
||||
Back: key.NewBinding(key.WithKeys("backspace", "left"), key.WithHelp("←", "parent")),
|
||||
Switch: key.NewBinding(key.WithKeys("tab", "h", "l"), key.WithHelp("Tab/h/l", "switch pane")),
|
||||
Refresh: key.NewBinding(key.WithKeys("r"), key.WithHelp("r", "refresh")),
|
||||
DirSize: key.NewBinding(key.WithKeys(" "), key.WithHelp("Space", "dir size")),
|
||||
Copy: key.NewBinding(key.WithKeys("f5", "c"), key.WithHelp("F5/c", "copy")),
|
||||
|
|
|
|||
|
|
@ -461,9 +461,6 @@ func (m Model) View() string {
|
|||
}
|
||||
|
||||
parts := make([]string, 0, 3)
|
||||
if m.cfg.UI.ShowTitleBar {
|
||||
parts = append(parts, renderTitleBar(m))
|
||||
}
|
||||
parts = append(parts, panels)
|
||||
if m.cfg.UI.ShowFooter {
|
||||
parts = append(parts, renderFooter(m))
|
||||
|
|
@ -1065,9 +1062,6 @@ func (m *Model) layoutWidths() (int, int, int) {
|
|||
|
||||
func (m *Model) bodyHeight() int {
|
||||
height := m.height
|
||||
if m.cfg.UI.ShowTitleBar {
|
||||
height--
|
||||
}
|
||||
if m.cfg.UI.ShowFooter {
|
||||
height--
|
||||
}
|
||||
|
|
@ -1776,9 +1770,6 @@ func (m *Model) mouseTarget(x, y int) (PaneID, int, bool) {
|
|||
|
||||
leftWidth, previewWidth, rightWidth := m.layoutWidths()
|
||||
top := 0
|
||||
if m.cfg.UI.ShowTitleBar {
|
||||
top++
|
||||
}
|
||||
bodyHeight := m.bodyHeight()
|
||||
if y < top || y >= top+bodyHeight {
|
||||
return "", 0, false
|
||||
|
|
@ -1854,9 +1845,6 @@ func (m *Model) mouseOverPreview(x, y int) bool {
|
|||
|
||||
leftWidth, previewWidth, _ := m.layoutWidths()
|
||||
top := 0
|
||||
if m.cfg.UI.ShowTitleBar {
|
||||
top++
|
||||
}
|
||||
bodyHeight := m.bodyHeight()
|
||||
if y < top || y >= top+bodyHeight {
|
||||
return false
|
||||
|
|
|
|||
|
|
@ -206,7 +206,8 @@ func renderPaneRows(pane BrowserPane, cfg config.Config, palette theme.Palette,
|
|||
lines := make([]string, 0, visibleHeight)
|
||||
for idx := pane.Offset; idx < end; idx++ {
|
||||
entry := pane.Entries[idx]
|
||||
row := renderEntryRow(entry, cfg, width, idx == pane.Cursor, idx == hoverIndex, active, palette, background)
|
||||
isSelected := idx == pane.Cursor && active
|
||||
row := renderEntryRow(entry, cfg, width, isSelected, idx == hoverIndex, active, palette, background)
|
||||
lines = append(lines, row)
|
||||
}
|
||||
for len(lines) < visibleHeight {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue