2019-02-16 12:01:17 +02:00
|
|
|
package gui
|
|
|
|
|
2019-11-16 03:41:04 +02:00
|
|
|
// changeContext is a helper function for when we want to change a 'main' context
|
|
|
|
// which currently just means a context that affects both the main and secondary views
|
|
|
|
// other views can have their context changed directly but this function helps
|
|
|
|
// keep the main and secondary views in sync
|
2020-01-30 23:07:34 +02:00
|
|
|
func (gui *Gui) changeMainViewsContext(context string) {
|
2019-11-16 03:41:04 +02:00
|
|
|
if gui.State.MainContext == context {
|
2020-01-30 23:07:34 +02:00
|
|
|
return
|
2019-02-16 12:01:17 +02:00
|
|
|
}
|
|
|
|
|
2019-11-16 03:41:04 +02:00
|
|
|
switch context {
|
|
|
|
case "normal", "patch-building", "staging", "merging":
|
|
|
|
gui.getMainView().Context = context
|
|
|
|
gui.getSecondaryView().Context = context
|
2019-02-16 12:01:17 +02:00
|
|
|
}
|
|
|
|
|
2019-11-16 03:41:04 +02:00
|
|
|
gui.State.MainContext = context
|
2019-02-16 12:01:17 +02:00
|
|
|
}
|