Attach method to set color to *ModalForm #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The aim of this PR is to help to fix an issue in k9s to when spawning modal forms. An example can be found here, where the
NewModalForm
function hardcodes the title color totcell.ColorAqua
.A skin where everything is set on black, taken from here, shows that the title's color remains hardcoded, despite me setting manually in the k9s code the title color to red. This is a ss from the scale command from scale extender:
![image](https://private-user-images.githubusercontent.com/30158449/238156800-958ba6f7-6513-4696-869e-e4a4ea588d03.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA1OTEwNjEsIm5iZiI6MTcyMDU5MDc2MSwicGF0aCI6Ii8zMDE1ODQ0OS8yMzgxNTY4MDAtOTU4YmE2ZjctNjUxMy00Njk2LTg2OWUtZTRhNGVhNTg4ZDAzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzEwVDA1NTI0MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBiMjZkMDk4OGUzZWFlYzdhZTFlMWQzN2U5ZWVjMmI1NmViMGU3ZTQ4ZTcyNjgwODEzYzdhY2M3NTdkNTMzYzImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.hSGWfY0AZNPzwfYgbbjgbS8jm1CprqHS6e7j72QI5Vs)
Calling
confirm.SetTitleColor(whateverColor)
does not seem to work as the call does not target same destination asconfirm.frame.SetTitleColor
(which is the fix).In order to not change to signature of
NewModalForm
I attached the function that can help solve the issue and allow configuration of title color in k9s.