Move style definitions from Main.go to drw.go
This commit is contained in:
parent
56fa219d2d
commit
da53b8c6b6
3
Main.go
3
Main.go
|
@ -22,9 +22,6 @@ func main() {
|
||||||
if err := drw.Wall.Init(); err != nil {
|
if err := drw.Wall.Init(); err != nil {
|
||||||
log.Fatalf("%+v", err)
|
log.Fatalf("%+v", err)
|
||||||
}
|
}
|
||||||
drw.DefStyle = tcell.StyleDefault.Background(tcell.ColorReset).Foreground(tcell.ColorReset)
|
|
||||||
drw.TodayStyle = tcell.StyleDefault.Background(tcell.ColorReset).Foreground(tcell.GetColor("blue")).Bold(true).Reverse(true)
|
|
||||||
drw.SelStyle = tcell.StyleDefault.Background(tcell.ColorReset).Foreground(tcell.GetColor("green")).Bold(true)
|
|
||||||
|
|
||||||
drw.Wall.SetStyle(drw.DefStyle)
|
drw.Wall.SetStyle(drw.DefStyle)
|
||||||
drw.Wall.Clear()
|
drw.Wall.Clear()
|
||||||
|
|
15
drw/drw.go
15
drw/drw.go
|
@ -15,9 +15,18 @@ var (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
DefStyle tcell.Style
|
DefStyle tcell.Style = tcell.StyleDefault.
|
||||||
TodayStyle tcell.Style
|
Background(tcell.ColorReset).
|
||||||
SelStyle tcell.Style
|
Foreground(tcell.ColorReset)
|
||||||
|
TodayStyle tcell.Style = tcell.StyleDefault.
|
||||||
|
Background(tcell.ColorReset).
|
||||||
|
Foreground(tcell.GetColor("blue")).
|
||||||
|
Bold(true).
|
||||||
|
Reverse(true)
|
||||||
|
SelStyle tcell.Style = tcell.StyleDefault.
|
||||||
|
Background(tcell.ColorReset).
|
||||||
|
Foreground(tcell.GetColor("green")).
|
||||||
|
Bold(true)
|
||||||
)
|
)
|
||||||
|
|
||||||
func centeredText(s string, x, y, width int, scr tcell.Screen, style tcell.Style) {
|
func centeredText(s string, x, y, width int, scr tcell.Screen, style tcell.Style) {
|
||||||
|
|
Loading…
Reference in a new issue