feat(ui): allow temporarily revealing the UI with the alt button if hidden
This commit is contained in:
parent
3f1ac02fe7
commit
784bb77d91
6
app.go
6
app.go
|
@ -70,6 +70,7 @@ type State struct {
|
|||
RecentManager *gtk.RecentManager
|
||||
BackgroundColorCssProvider *gtk.CssProvider
|
||||
PageCacheTrimTimeoutHandle *glib.SourceHandle
|
||||
UITemporarilyRevealed bool
|
||||
}
|
||||
|
||||
//go:embed about.jpg
|
||||
|
@ -236,6 +237,11 @@ func (app *App) handleKeyPress(key uint, shift bool, ctrl bool) {
|
|||
} else {
|
||||
app.W.MenuItemNextPage.Activate()
|
||||
}
|
||||
case gdk.KEY_Alt_L:
|
||||
if app.Config.HideUI {
|
||||
app.S.UITemporarilyRevealed = !app.S.UITemporarilyRevealed
|
||||
app.toggleHideUI(!app.S.UITemporarilyRevealed)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -202,6 +202,7 @@ func (app *App) setHideUI(hideUI bool) {
|
|||
app.Config.HideUI = hideUI
|
||||
app.toggleHideUI(hideUI)
|
||||
app.W.MenuItemHideUI.SetActive(hideUI)
|
||||
app.S.UITemporarilyRevealed = false
|
||||
}
|
||||
|
||||
func (app *App) setShrink(shrink bool) {
|
||||
|
|
|
@ -35,6 +35,12 @@ func (app *App) imageAreaInit() {
|
|||
})
|
||||
|
||||
app.W.ScrolledWindow.Connect("button-press-event", func(self *gtk.ScrolledWindow, event *gdk.Event) bool {
|
||||
if app.S.UITemporarilyRevealed {
|
||||
app.S.UITemporarilyRevealed = false
|
||||
app.toggleHideUI(true)
|
||||
return true
|
||||
}
|
||||
|
||||
be := &gdk.EventButton{Event: event}
|
||||
switch be.Button() {
|
||||
case 1:
|
||||
|
|
Loading…
Reference in a new issue