1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Attempt to offer linux transparency

Add 'transparent' as a color option
Default to 'transparent'
Make sure to set color to appropriate things, so transparency is achieved
This commit is contained in:
Sean Smith 2019-08-20 22:28:14 -04:00
parent c832db9ddb
commit 146cbb598a
4 changed files with 10 additions and 2 deletions

View File

@ -20,8 +20,8 @@ func NewDisplay(widgets []wtf.Wtfable, config *config.Config) *Display {
config: config,
}
display.Grid.SetBackgroundColor(wtf.ColorFor(config.UString("wtf.colors.background", "transparent")))
display.build(widgets)
display.Grid.SetBackgroundColor(wtf.ColorFor(config.UString("wtf.colors.background", "black")))
return &display
}

View File

@ -37,6 +37,13 @@ func NewWtfApp(app *tview.Application, config *config.Config, configFilePath str
pages: tview.NewPages(),
}
wtfApp.app.SetBeforeDrawFunc(func(s tcell.Screen) bool {
s.Clear()
return false
})
wtfApp.pages.Box.SetBackgroundColor(wtf.ColorFor(config.UString("wtf.colors.background", "transparent")))
wtfApp.app.SetInputCapture(wtfApp.keyboardIntercept)
wtfApp.widgets = MakeWidgets(wtfApp.app, wtfApp.pages, wtfApp.config)
wtfApp.display = NewDisplay(wtfApp.widgets, wtfApp.config)

View File

@ -62,7 +62,7 @@ func NewCommonSettingsFromModule(name, defaultTitle string, moduleConfig *config
common := Common{
Colors: Colors{
Background: moduleConfig.UString("background", globalSettings.UString("background", "black")),
Background: moduleConfig.UString("background", globalSettings.UString("background", "transparent")),
BorderFocusable: colorsConfig.UString("border.focusable", "red"),
BorderFocused: colorsConfig.UString("border.focused", "orange"),
BorderNormal: colorsConfig.UString("border.normal", "gray"),

View File

@ -401,6 +401,7 @@ var colors = map[string]tcell.Color{
"teal": tcell.ColorTeal,
"thistle": tcell.ColorThistle,
"tomato": tcell.ColorTomato,
"transparent": tcell.ColorDefault,
"turquoise": tcell.ColorTurquoise,
"violet": tcell.ColorViolet,
"wheat": tcell.ColorWheat,