mirror of
https://github.com/eeeXun/GTT.git
synced 2025-05-31 23:10:30 -07:00
add selected_color
This commit is contained in:
parent
bea89309a8
commit
d3180230c0
17
color.go
17
color.go
@ -7,6 +7,7 @@ import (
|
|||||||
type color_theme struct {
|
type color_theme struct {
|
||||||
bg tcell.Color
|
bg tcell.Color
|
||||||
fg tcell.Color
|
fg tcell.Color
|
||||||
|
gray tcell.Color
|
||||||
red tcell.Color
|
red tcell.Color
|
||||||
green tcell.Color
|
green tcell.Color
|
||||||
yellow tcell.Color
|
yellow tcell.Color
|
||||||
@ -19,6 +20,7 @@ var (
|
|||||||
Gruvbox color_theme = color_theme{
|
Gruvbox color_theme = color_theme{
|
||||||
bg: tcell.NewHexColor(0x282828),
|
bg: tcell.NewHexColor(0x282828),
|
||||||
fg: tcell.NewHexColor(0xebdbb2),
|
fg: tcell.NewHexColor(0xebdbb2),
|
||||||
|
gray: tcell.NewHexColor(0x928374),
|
||||||
red: tcell.NewHexColor(0xfb4934),
|
red: tcell.NewHexColor(0xfb4934),
|
||||||
green: tcell.NewHexColor(0xfabd2f),
|
green: tcell.NewHexColor(0xfabd2f),
|
||||||
yellow: tcell.NewHexColor(0xfabd2f),
|
yellow: tcell.NewHexColor(0xfabd2f),
|
||||||
@ -29,6 +31,7 @@ var (
|
|||||||
Nord color_theme = color_theme{
|
Nord color_theme = color_theme{
|
||||||
bg: tcell.NewHexColor(0x3b4252),
|
bg: tcell.NewHexColor(0x3b4252),
|
||||||
fg: tcell.NewHexColor(0xeceff4),
|
fg: tcell.NewHexColor(0xeceff4),
|
||||||
|
gray: tcell.NewHexColor(0x4c566a),
|
||||||
red: tcell.NewHexColor(0xbf616a),
|
red: tcell.NewHexColor(0xbf616a),
|
||||||
green: tcell.NewHexColor(0xa3be8c),
|
green: tcell.NewHexColor(0xa3be8c),
|
||||||
yellow: tcell.NewHexColor(0xebcb8b),
|
yellow: tcell.NewHexColor(0xebcb8b),
|
||||||
@ -43,6 +46,7 @@ type Colors struct {
|
|||||||
border_color tcell.Color
|
border_color tcell.Color
|
||||||
foreground_color tcell.Color
|
foreground_color tcell.Color
|
||||||
text_color tcell.Color
|
text_color tcell.Color
|
||||||
|
selected_color tcell.Color
|
||||||
}
|
}
|
||||||
|
|
||||||
type Window struct {
|
type Window struct {
|
||||||
@ -51,10 +55,11 @@ type Window struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (w *Window) color_init() {
|
func (w *Window) color_init() {
|
||||||
w.src.background_color = Nord.bg
|
w.src.background_color = Gruvbox.bg
|
||||||
w.src.border_color = Nord.yellow
|
w.src.border_color = Gruvbox.red
|
||||||
w.src.foreground_color = Nord.fg
|
w.src.foreground_color = Gruvbox.fg
|
||||||
w.dest.background_color = Nord.bg
|
w.src.selected_color = Gruvbox.gray
|
||||||
w.dest.border_color = Nord.blue
|
w.dest.background_color = Gruvbox.bg
|
||||||
w.dest.foreground_color = Nord.fg
|
w.dest.border_color = Gruvbox.blue
|
||||||
|
w.dest.foreground_color = Gruvbox.fg
|
||||||
}
|
}
|
||||||
|
3
ui.go
3
ui.go
@ -13,6 +13,9 @@ func ui_init() {
|
|||||||
src_box.SetTextStyle(tcell.StyleDefault.
|
src_box.SetTextStyle(tcell.StyleDefault.
|
||||||
Background(window.src.background_color).
|
Background(window.src.background_color).
|
||||||
Foreground(window.src.foreground_color))
|
Foreground(window.src.foreground_color))
|
||||||
|
src_box.SetSelectedStyle(tcell.StyleDefault.
|
||||||
|
Background(window.src.selected_color).
|
||||||
|
Foreground(window.src.foreground_color))
|
||||||
|
|
||||||
dest_box.SetBorder(true).
|
dest_box.SetBorder(true).
|
||||||
SetTitle(translator.dest_lang).
|
SetTitle(translator.dest_lang).
|
||||||
|
Loading…
x
Reference in New Issue
Block a user