Skip to content

Commit c2e96b3

Browse files
committed
feat: Add hide_panel_footer_info flag
1 parent f291156 commit c2e96b3

File tree

5 files changed

+19
-4
lines changed

5 files changed

+19
-4
lines changed

dfsdf

Whitespace-only changes.

src/internal/common/config_type.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ type ConfigType struct {
7171
CdOnQuit bool `toml:"cd_on_quit" comment:"\nCd on quit (For more details, please check out https://superfile.netlify.app/configure/superfile-config/#cd_on_quit)"`
7272
DefaultOpenFilePreview bool `toml:"default_open_file_preview" comment:"\nWhether to open file preview automatically every time superfile is opened."`
7373
ShowImagePreview bool `toml:"show_image_preview" comment:"\nWhether to show image preview."`
74+
HidePanelFooterInfo bool `toml:"hide_panel_footer_info" comment:"\nWhether to hide additional footer info for file panel."`
7475
DefaultDirectory string `toml:"default_directory" comment:"\nThe path of the first file panel when superfile is opened."`
7576
FileSizeUseSI bool `toml:"file_size_use_si" comment:"\nDisplay file sizes using powers of 1000 (kB, MB, GB) instead of powers of 1024 (KiB, MiB, GiB)."`
7677
DefaultSortType int `toml:"default_sort_type" comment:"\nDefault sort type (0: Name, 1: Size, 2: Date Modified)."`

src/internal/model_render.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,14 @@ func (panel *filePanel) Render(mainPanelHeight int, filePanelWidth int, focussed
122122
}
123123
cursorNumberString := fmt.Sprintf("%d/%d", cursorNumber, len(panel.element))
124124

125-
r.SetBorderInfoItems(sortTypeString, panelModeString, cursorNumberString)
126-
if r.AreInfoItemsTruncated() {
127-
// Use smaller values
128-
r.SetBorderInfoItems(sortTypeStringSmall, panelModeStringSmall, cursorNumberString)
125+
if common.Config.HidePanelFooterInfo {
126+
r.SetBorderInfoItems(cursorNumberString)
127+
} else {
128+
r.SetBorderInfoItems(sortTypeString, panelModeString, cursorNumberString)
129+
if r.AreInfoItemsTruncated() {
130+
// Use smaller values
131+
r.SetBorderInfoItems(sortTypeStringSmall, panelModeStringSmall, cursorNumberString)
132+
}
129133
}
130134

131135
if len(panel.element) == 0 {

src/superfile_config/config.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ default_open_file_preview = true
2121
# Whether to show image preview
2222
show_image_preview = true
2323
#
24+
#
25+
# Whether to hide additional footer info for file panel.
26+
hide_panel_footer_info = false
27+
#
2428
# The path of the first file panel when superfile is opened.
2529
default_directory = "."
2630
#

website/src/content/docs/configure/superfile-config.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ Example command to enable - `Set-ExecutionPolicy -ExecutionPolicy RemoteSigned`
101101

102102
`false` => Does not shows the image preview.
103103

104+
- ###### hide_panel_footer_info
105+
106+
`true` => Shows additional footer info for file panel like panel mode and sort type.
107+
108+
`false` => Does not shows additional footer info for file panel
109+
104110
- ###### file_size_use_si
105111

106112
`true` => Displays the file/directory sizes using powers of 1000 (kB, MB, GB).

0 commit comments

Comments
 (0)