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:
parent
c832db9ddb
commit
146cbb598a
@ -20,8 +20,8 @@ func NewDisplay(widgets []wtf.Wtfable, config *config.Config) *Display {
|
|||||||
config: config,
|
config: config,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
display.Grid.SetBackgroundColor(wtf.ColorFor(config.UString("wtf.colors.background", "transparent")))
|
||||||
display.build(widgets)
|
display.build(widgets)
|
||||||
display.Grid.SetBackgroundColor(wtf.ColorFor(config.UString("wtf.colors.background", "black")))
|
|
||||||
|
|
||||||
return &display
|
return &display
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,13 @@ func NewWtfApp(app *tview.Application, config *config.Config, configFilePath str
|
|||||||
pages: tview.NewPages(),
|
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.app.SetInputCapture(wtfApp.keyboardIntercept)
|
||||||
wtfApp.widgets = MakeWidgets(wtfApp.app, wtfApp.pages, wtfApp.config)
|
wtfApp.widgets = MakeWidgets(wtfApp.app, wtfApp.pages, wtfApp.config)
|
||||||
wtfApp.display = NewDisplay(wtfApp.widgets, wtfApp.config)
|
wtfApp.display = NewDisplay(wtfApp.widgets, wtfApp.config)
|
||||||
|
@ -62,7 +62,7 @@ func NewCommonSettingsFromModule(name, defaultTitle string, moduleConfig *config
|
|||||||
|
|
||||||
common := Common{
|
common := Common{
|
||||||
Colors: Colors{
|
Colors: Colors{
|
||||||
Background: moduleConfig.UString("background", globalSettings.UString("background", "black")),
|
Background: moduleConfig.UString("background", globalSettings.UString("background", "transparent")),
|
||||||
BorderFocusable: colorsConfig.UString("border.focusable", "red"),
|
BorderFocusable: colorsConfig.UString("border.focusable", "red"),
|
||||||
BorderFocused: colorsConfig.UString("border.focused", "orange"),
|
BorderFocused: colorsConfig.UString("border.focused", "orange"),
|
||||||
BorderNormal: colorsConfig.UString("border.normal", "gray"),
|
BorderNormal: colorsConfig.UString("border.normal", "gray"),
|
||||||
|
@ -401,6 +401,7 @@ var colors = map[string]tcell.Color{
|
|||||||
"teal": tcell.ColorTeal,
|
"teal": tcell.ColorTeal,
|
||||||
"thistle": tcell.ColorThistle,
|
"thistle": tcell.ColorThistle,
|
||||||
"tomato": tcell.ColorTomato,
|
"tomato": tcell.ColorTomato,
|
||||||
|
"transparent": tcell.ColorDefault,
|
||||||
"turquoise": tcell.ColorTurquoise,
|
"turquoise": tcell.ColorTurquoise,
|
||||||
"violet": tcell.ColorViolet,
|
"violet": tcell.ColorViolet,
|
||||||
"wheat": tcell.ColorWheat,
|
"wheat": tcell.ColorWheat,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user