Add MouseEnabled config setting

This patch adds the ability to control whether aerc captures mouseevents
or not. By default it will be set to not capture events.
This commit is contained in:
Jeffas 2019-07-16 19:06:22 +01:00 committed by Drew DeVault
parent 8534720e72
commit 06af5391a3
4 changed files with 15 additions and 1 deletions

View file

@ -32,6 +32,11 @@ empty-message=(no messages)
# Default: (no folders) # Default: (no folders)
empty-dirlist=(no folders) empty-dirlist=(no folders)
# Enable mouse events in the ui, e.g. clicking and scrolling with the mousewheel
#
# Default: false
mouse-enabled=false
[viewer] [viewer]
# #
# Specifies the pager to use when displaying emails. Note that some filters # Specifies the pager to use when displaying emails. Note that some filters

View file

@ -31,6 +31,7 @@ type UIConfig struct {
PreviewHeight int `ini:"preview-height"` PreviewHeight int `ini:"preview-height"`
EmptyMessage string `ini:"empty-message"` EmptyMessage string `ini:"empty-message"`
EmptyDirlist string `ini:"empty-dirlist"` EmptyDirlist string `ini:"empty-dirlist"`
MouseEnabled bool `ini:"mouse-enabled"`
} }
const ( const (
@ -320,6 +321,7 @@ func LoadConfigFromFile(root *string, sharedir string) (*AercConfig, error) {
PreviewHeight: 12, PreviewHeight: 12,
EmptyMessage: "(no messages)", EmptyMessage: "(no messages)",
EmptyDirlist: "(no folders)", EmptyDirlist: "(no folders)",
MouseEnabled: false,
}, },
} }
// These bindings are not configurable // These bindings are not configurable

View file

@ -96,6 +96,11 @@ These options are configured in the *[ui]* section of aerc.conf.
Default: (no folders) Default: (no folders)
*mouse-enabled*
Enable mouse events in the ui, e.g. clicking and scrolling with the mousewheel
Default: false
## VIEWER ## VIEWER
These options are configured in the *[viewer]* section of aerc.conf. These options are configured in the *[viewer]* section of aerc.conf.

View file

@ -32,7 +32,9 @@ func Initialize(conf *config.AercConfig,
screen.Clear() screen.Clear()
screen.HideCursor() screen.HideCursor()
if conf.Ui.MouseEnabled {
screen.EnableMouse() screen.EnableMouse()
}
width, height := screen.Size() width, height := screen.Size()