aboutsummaryrefslogtreecommitdiff
path: root/lib/ui
diff options
context:
space:
mode:
authorNicolai Dagestad <nicolai@dagestad.fr>2019-08-03 17:17:13 +0200
committerDrew DeVault <sir@cmpwn.com>2019-08-03 16:50:49 -0400
commit0847464da1da5c2df19e107ee3884ab7996c1756 (patch)
tree157e77e9abd57b234313fa8978e6a41ff080a85a /lib/ui
parent63f934ee71cdf2c96379c393566556b7c289cceb (diff)
Remove aerc specific code from the ui
Separatiing the ui code from aerc makes it usable as a library in other projects.
Diffstat (limited to 'lib/ui')
-rw-r--r--lib/ui/ui.go12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/ui/ui.go b/lib/ui/ui.go
index 4c3dd34..01d12dc 100644
--- a/lib/ui/ui.go
+++ b/lib/ui/ui.go
@@ -4,8 +4,6 @@ import (
"sync/atomic"
"github.com/gdamore/tcell"
-
- "git.sr.ht/~sircmpwn/aerc/config"
)
type UI struct {
@@ -18,8 +16,7 @@ type UI struct {
invalid int32 // access via atomic
}
-func Initialize(conf *config.AercConfig,
- content DrawableInteractiveBeeper) (*UI, error) {
+func Initialize(content DrawableInteractiveBeeper) (*UI, error) {
screen, err := tcell.NewScreen()
if err != nil {
@@ -32,9 +29,6 @@ func Initialize(conf *config.AercConfig,
screen.Clear()
screen.HideCursor()
- if conf.Ui.MouseEnabled {
- screen.EnableMouse()
- }
width, height := screen.Size()
@@ -101,3 +95,7 @@ func (state *UI) Tick() bool {
return more
}
+
+func (state *UI) EnableMouse() {
+ state.screen.EnableMouse()
+}