1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

Standardise on 'screen mode' name

We had some conflicting names so we're standardising on screen mode
This commit is contained in:
Jesse Duffield
2025-01-11 14:25:10 +11:00
parent 2c321011db
commit 28d10c26a4
9 changed files with 40 additions and 33 deletions

View File

@ -53,7 +53,7 @@ type WindowArrangementArgs struct {
// staged and unstaged changes)
SplitMainPanel bool
// The current screen mode (normal, half, full)
ScreenMode types.WindowMaximisation
ScreenMode types.ScreenMode
// The content shown on the bottom left of the screen when showing a loader
// or toast e.g. 'Rebasing /'
AppStatus string

View File

@ -12,7 +12,7 @@ type ScreenModeActions struct {
func (self *ScreenModeActions) Next() error {
self.c.State().GetRepoState().SetScreenMode(
nextIntInCycle(
[]types.WindowMaximisation{types.SCREEN_NORMAL, types.SCREEN_HALF, types.SCREEN_FULL},
[]types.ScreenMode{types.SCREEN_NORMAL, types.SCREEN_HALF, types.SCREEN_FULL},
self.c.State().GetRepoState().GetScreenMode(),
),
)
@ -24,7 +24,7 @@ func (self *ScreenModeActions) Next() error {
func (self *ScreenModeActions) Prev() error {
self.c.State().GetRepoState().SetScreenMode(
prevIntInCycle(
[]types.WindowMaximisation{types.SCREEN_NORMAL, types.SCREEN_HALF, types.SCREEN_FULL},
[]types.ScreenMode{types.SCREEN_NORMAL, types.SCREEN_HALF, types.SCREEN_FULL},
self.c.State().GetRepoState().GetScreenMode(),
),
)
@ -53,7 +53,7 @@ func (self *ScreenModeActions) rerenderView(view *gocui.View) {
context.HandleRender()
}
func nextIntInCycle(sl []types.WindowMaximisation, current types.WindowMaximisation) types.WindowMaximisation {
func nextIntInCycle(sl []types.ScreenMode, current types.ScreenMode) types.ScreenMode {
for i, val := range sl {
if val == current {
if i == len(sl)-1 {
@ -65,7 +65,7 @@ func nextIntInCycle(sl []types.WindowMaximisation, current types.WindowMaximisat
return sl[0]
}
func prevIntInCycle(sl []types.WindowMaximisation, current types.WindowMaximisation) types.WindowMaximisation {
func prevIntInCycle(sl []types.ScreenMode, current types.ScreenMode) types.ScreenMode {
for i, val := range sl {
if val == current {
if i > 0 {