Commit graph

10 commits

Author SHA1 Message Date
Jason Stewart
27978a859b ui: avoid panic when terminal window is shrunk
When using a tiling window manager, aerc terminal dimensions may be
greatly reduced after a new window has been created by :open. When the
ui attempts to render to formerly-valid coordinates, SetCell & Printf
may panic. Replace panic() with no-op in both functions to prevent
aerc from crashing after a window shrink.

Signed-off-by: Jason Stewart <support@eggplantsd.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-09-26 17:32:00 +02:00
Tim Culverhouse
17c4781911 ui: export context.viewport, screen.show, add SetCursorStyle
Export context.viewport for use in implementing tcell-term.

Bump tcell version to enable SetCursorStyle feature. Add this function
to the ui for future use with tcell-term.

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-09-14 22:12:37 +02:00
Moritz Poldrack
aaf0a0c656 lint: apply new formatting rules
Run `make fmt`.

Signed-off-by: Moritz Poldrack <git@moritz.sh>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-08-01 10:44:52 +02:00
y0ast
03650474e2 update tcell to v2 and enable TrueColor support
Also update to the tcell v2 PaletteColor api, which should keep the chosen
theme of the user intact.

Note, that if $TRUECOLOR is defined and a truecolor given, aerc will now stop
clipping the value to one of the theme colors.
Generally this is desired behaviour though.
2020-12-18 07:23:22 +01:00
Ben Burwell
bcd03c4c4a Add popovers
A popover is a special UI element which can be layered over the rest of
the UI (i.e. it is painted last) and can fall anywhere on the screen,
not just with the bounds of its parent's viewport/context. With these
special abilities comes the restriction that only one popover may be
visible on screen at once.

Popovers are requested from the UI context passed to Draw calls and
specify the anchor point and the desired dimensions. The popover is then
fit to the available space and placed relative to the anchor point.
2019-12-21 09:23:20 -05:00
Drew DeVault
d35213eaab Add cursor handling in ex line 2019-01-14 08:07:24 -05:00
Drew DeVault
6728a11fdf Apply gofmt 2018-06-11 20:04:21 -04:00
Drew DeVault
d67c8a60ef Clean up some old code 2018-06-11 19:52:21 -04:00
Markus Ongyerth
80e891a802 switch to tcell from termbox
This is a simple mostly straight forward switch to tcell in favor of
termbox.
It uses the tcell native api (not the compat layer) but does not make
use of most features.

Further changes should include moving to tcell's views.TextArea and the
general built in widget behaviour instead of the current ad hoc
implementation.

Regression: Cursor isn't shown in ex-line
2018-06-01 16:04:43 -07:00
Drew DeVault
1418e1b9dc Split UI library and widgets 2018-02-26 22:54:39 -05:00
Renamed from ui/context.go (Browse further)