-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Selecting a theme is a custom setting panel that reuses the filter list component. When in theme mode, the themes are rendered immediately to help discover preferred themes.
- Loading branch information
1 parent
fdb7cef
commit cccbc43
Showing
12 changed files
with
556 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package theme | ||
|
||
import ( | ||
"github.com/mikelorant/committed/internal/theme" | ||
"github.com/mikelorant/committed/internal/ui/colour" | ||
|
||
"github.com/charmbracelet/lipgloss" | ||
) | ||
|
||
type Styles struct { | ||
themeTitle lipgloss.Style | ||
themeTitleFocus lipgloss.Style | ||
themeTitleLabel lipgloss.Style | ||
themeTitleText lipgloss.Style | ||
themeListBoundary lipgloss.Style | ||
themeListBoundaryFocus lipgloss.Style | ||
} | ||
|
||
func defaultStyles(th theme.Theme) Styles { | ||
var s Styles | ||
|
||
clr := colour.New(th).OptionTheme() | ||
|
||
s.themeTitle = lipgloss.NewStyle(). | ||
Border(lipgloss.NormalBorder()). | ||
BorderForeground(clr.Title). | ||
Width(40). | ||
Padding(0, 1, 0, 1). | ||
MarginBottom(1) | ||
|
||
s.themeTitleFocus = s.themeTitle.Copy(). | ||
BorderForeground(clr.TitleFocus) | ||
|
||
s.themeTitleLabel = lipgloss.NewStyle(). | ||
Foreground(clr.TitleLabel). | ||
SetString("Theme:") | ||
|
||
s.themeTitleText = lipgloss.NewStyle(). | ||
Foreground(clr.TitleText) | ||
|
||
s.themeListBoundary = lipgloss.NewStyle(). | ||
Border(lipgloss.NormalBorder()). | ||
Width(40). | ||
BorderForeground(clr.Boundary) | ||
|
||
s.themeListBoundaryFocus = s.themeListBoundary.Copy(). | ||
BorderForeground(clr.BoundaryFocus) | ||
|
||
return s | ||
} |
Oops, something went wrong.