Noah Petherbridge
5d16f5d50c
* Added the TabFrame widget with an example program and screenshot * Button: FixedColor=true to set a consistent background color and not worry about it with mouseover/down events.
99 lines
2.6 KiB
Go
99 lines
2.6 KiB
Go
package theme
|
|
|
|
import (
|
|
"git.kirsle.net/go/render"
|
|
"git.kirsle.net/go/ui/style"
|
|
)
|
|
|
|
// Color schemes.
|
|
var (
|
|
ButtonBackgroundColor = render.RGBA(200, 200, 200, 255)
|
|
ButtonHoverColor = render.RGBA(200, 255, 255, 255)
|
|
ButtonOutlineColor = render.Black
|
|
InputBackgroundColor = render.White
|
|
|
|
BorderColorOffset = 40
|
|
)
|
|
|
|
// Theme is a collection of styles for various built-in widgets.
|
|
type Theme struct {
|
|
Name string
|
|
Window *style.Window
|
|
Label *style.Label
|
|
Button *style.Button
|
|
Tooltip *style.Tooltip
|
|
TabFrame *style.Button
|
|
}
|
|
|
|
// Default theme.
|
|
var Default = Theme{
|
|
Name: "Default",
|
|
Label: &style.DefaultLabel,
|
|
Button: &style.DefaultButton,
|
|
Tooltip: &style.DefaultTooltip,
|
|
TabFrame: &style.DefaultButton,
|
|
}
|
|
|
|
// DefaultFlat is a flat version of the default theme.
|
|
var DefaultFlat = Theme{
|
|
Name: "DefaultFlat",
|
|
Button: &style.Button{
|
|
Background: style.DefaultButton.Background,
|
|
Foreground: style.DefaultButton.Foreground,
|
|
OutlineColor: style.DefaultButton.OutlineColor,
|
|
OutlineSize: 1,
|
|
HoverBackground: style.DefaultButton.HoverBackground,
|
|
HoverForeground: style.DefaultButton.HoverForeground,
|
|
BorderStyle: style.BorderSolid,
|
|
BorderSize: 2,
|
|
},
|
|
TabFrame: &style.Button{
|
|
Background: style.DefaultButton.Background,
|
|
Foreground: style.DefaultButton.Foreground,
|
|
OutlineColor: style.DefaultButton.OutlineColor,
|
|
OutlineSize: 1,
|
|
HoverBackground: style.DefaultButton.HoverBackground,
|
|
HoverForeground: style.DefaultButton.HoverForeground,
|
|
BorderStyle: style.BorderSolid,
|
|
BorderSize: 2,
|
|
},
|
|
}
|
|
|
|
// DefaultDark is a dark version of the default theme.
|
|
var DefaultDark = Theme{
|
|
Name: "DefaultDark",
|
|
Label: &style.Label{
|
|
Foreground: render.Grey,
|
|
},
|
|
Window: &style.Window{
|
|
ActiveTitleBackground: render.Red,
|
|
ActiveTitleForeground: render.White,
|
|
InactiveTitleBackground: render.DarkGrey,
|
|
InactiveTitleForeground: render.Grey,
|
|
ActiveBackground: render.Black,
|
|
InactiveBackground: render.Black,
|
|
},
|
|
Button: &style.Button{
|
|
Background: render.Black,
|
|
Foreground: render.Grey,
|
|
OutlineColor: render.DarkGrey,
|
|
OutlineSize: 1,
|
|
HoverBackground: render.Grey,
|
|
BorderStyle: style.BorderRaised,
|
|
BorderSize: 2,
|
|
},
|
|
Tooltip: &style.Tooltip{
|
|
Background: render.RGBA(60, 60, 60, 230),
|
|
Foreground: render.Cyan,
|
|
},
|
|
TabFrame: &style.Button{
|
|
Background: render.DarkGrey,
|
|
Foreground: render.Grey,
|
|
OutlineColor: render.DarkGrey,
|
|
OutlineSize: 1,
|
|
HoverBackground: render.Grey,
|
|
BorderStyle: style.BorderRaised,
|
|
BorderSize: 2,
|
|
},
|
|
}
|