From d5b4f7bb3e16d8e06fdcc9a53a4ec393ab4bf1b1 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Sat, 14 Oct 2023 12:45:13 +0200 Subject: 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. --- pkg/gui/types/context.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pkg/gui/types/context.go') 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 -- cgit v1.2.3