Skip to content

Commit

Permalink
update transparent background
Browse files Browse the repository at this point in the history
  • Loading branch information
yorukot committed Apr 28, 2024
1 parent c06c884 commit 4108d40
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 4 deletions.
21 changes: 18 additions & 3 deletions src/internal/config_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,24 @@ type ThemeType struct {

// Configuration settings
type ConfigType struct {
Theme string `toml:"theme" comment:"change your theme"`
FooterPanelList []string `toml:"footer_panel_list" comment:"\nuseless for now"`
Metadata bool `toml:"metadata" comment:"\n==========PLUGINS========== #\n\nShow more detailed metadata, please install exiftool before enabling this plugin!"`
Theme string `toml:"theme" comment:"change your theme"`

FooterPanelList []string `toml:"footer_panel_list" comment:"\nuseless for now"`

TransparentBackground bool `toml:"transparent_backgroun" comment:"\n================ Style =================\n\nSet transparent background or not (this only work when your terminal background is transparent)"`

BorderTop string `toml:"border_top" comment:"\n\nBorder style"`
BorderBottom string `toml:"border_bottom"`
BorderLeft string `toml:"border_left"`
BorderRight string `toml:"border_right"`
BorderTopLeft string `toml:"border_top_left"`
BorderTopRight string `toml:"border_top_right"`
BorderBottomLeft string `toml:"border_bottom_left"`
BorderBottomRight string `toml:"border_bottom_right"`
BorderSplitLeft string `toml:"border_split_left"`
BorderSplitRight string `toml:"border_split_right"`

Metadata bool `toml:"metadata" comment:"\n==========PLUGINS========== #\n\nShow more detailed metadata, please install exiftool before enabling this plugin!"`
}

type HotkeysType struct {
Expand Down
17 changes: 17 additions & 0 deletions src/internal/default_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,23 @@ theme = 'catpuccin'
#
# useless for now
footer_panel_list = ['processes', 'metadata', 'clipboard']
#
# ================ Style =================
#
# Set transparent background or not (this only work when your terminal background is transparent)
transparent_backgroun = false
#
# Border style
border_top = "━"
border_bottom = "━"
border_left = "┃"
border_right = "┃"
border_top_left = "┏"
border_top_right = "┓"
border_bottom_left = "┗"
border_bottom_right = "┛"
border_split_left = "┫"
border_split_right = "┣"
#
# ==========PLUGINS========== #
#
Expand Down
13 changes: 13 additions & 0 deletions src/internal/style.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ func LoadThemeConfig() {
helpMenuHotkeyColor = lipgloss.Color(theme.HelpMenuHotkey)
helpMenuTitleColor = lipgloss.Color(theme.HelpMenuTitle)

if Config.TransparentBackground {
transparentAllBackgrounColor()
}

// All Panel Main Color
// (full screen and default color)
mainStyle = lipgloss.NewStyle().Foreground(fullScreenFGColor).Background(fullScreenBGColor)
Expand Down Expand Up @@ -163,3 +167,12 @@ func generateFooterBorder(countString string, width int) string {
func footerWidth(fullWidth int) int {
return fullWidth/3 - 2
}

var transparentBackgroundColor string
func transparentAllBackgrounColor() {
fullScreenBGColor = lipgloss.Color(transparentBackgroundColor)
filePanelBGColor = lipgloss.Color(transparentBackgroundColor)
sidebarBGColor = lipgloss.Color(transparentBackgroundColor)
footerBGColor = lipgloss.Color(transparentBackgroundColor)
modalBGColor = lipgloss.Color(transparentBackgroundColor)
}
2 changes: 1 addition & 1 deletion src/internal/style_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func metadataBoarder(height int, width int, borderBottom string, focusType focus
// Generate border style for clipboard and can custom bottom border
func clipboardBoarder(height int, width int, borderBottom string) lipgloss.Style {
border := generateBorder()
border.Top = "━┫ Clipboard " + strings.Repeat("━", width)
border.Top = "━┫ Clipboard w" + strings.Repeat("━", width)
border.Bottom = borderBottom

return lipgloss.NewStyle().
Expand Down

0 comments on commit 4108d40

Please sign in to comment.