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)