summaryrefslogtreecommitdiffstats
path: root/pkg/gui/types/context.go
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2023-10-14 12:45:13 +0200
committerStefan Haller <stefan@haller-berlin.de>2023-10-16 09:03:07 +0200
commitd5b4f7bb3e16d8e06fdcc9a53a4ec393ab4bf1b1 (patch)
tree11e0902b2c1d7c3691cba457bad1c63f08fdeb77 /pkg/gui/types/context.go
parent3cee4de39ca120ee207fb8f5cc82dcdb0517e324 (diff)
Rerender certain views when their width changes
Situations where a view's width changes: - changing screen modes - enter staging or patch building - resizing the terminal window For the first of these we currently have special code to force a rerender, since some views render different content depending on whether they are in full-screen mode. We'll be able to remove that code now, since this new generic mechanism takes care of that too. But we will need this more general mechanism for cases where views truncate their content to the view width; we'll add one example for that later in this branch.
Diffstat (limited to 'pkg/gui/types/context.go')
-rw-r--r--pkg/gui/types/context.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/gui/types/context.go b/pkg/gui/types/context.go
index c47945aee..aca694228 100644
--- a/pkg/gui/types/context.go
+++ b/pkg/gui/types/context.go
@@ -60,6 +60,9 @@ type IBaseContext interface {
// determined independently.
HasControlledBounds() bool
+ // true if the view needs to be rerendered when its width changes
+ NeedsRerenderOnWidthChange() bool
+
// returns the desired title for the view upon activation. If there is no desired title (returns empty string), then
// no title will be set
Title() string