Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gui] new infobool Window.Is() #8985

Merged
merged 1 commit into from Feb 15, 2016
Merged

Conversation

xhaggi
Copy link
Member

@xhaggi xhaggi commented Jan 29, 2016

After we merged different skin xml's and use it by more than one window/dialog it should be possible to check if the window context is equal to a given window id. This PR introduce a new boolean window condition Window.Is(windowid). This boolean condition makes only sense in shared xml's like DialogMusicInfo.xml etc.

Examples

  1. Display a control only on dialog songinformation.
<visible>Window.Is(songinformation)</visible>
  1. Hide a control in dialog songinformation if dialog musicinformation is active.
<visible>Window.Is(songinformation) + !Window.IsActive(musicinformation)</visible>

@phil65 @razzeee @Montellese mind taking a look.

@da-anda
Copy link
Member

da-anda commented Jan 30, 2016

as this is a way to detect the surrounding context, wouldn't it make sense to also name it "context" in some way? If you decouple it from a specific window ID, AFAIK also add-ons could define a certain context and the dialogs would work in same way. Just a thought.

@xhaggi
Copy link
Member Author

xhaggi commented Jan 31, 2016

If you decouple it from a specific window ID, AFAIK also add-ons could define a certain context and the dialogs would work in same way. Just a thought.

could you please explain what you want to achieve?

@da-anda
Copy link
Member

da-anda commented Jan 31, 2016

if you use window IDs as "context" there is no way to trigger the same context from anywhere else, like from add-ons. Just imagine a music add-on wanting to mimic library features - would it be possible for the add-on to fire this dialog and have the same layout/context applied if you use window IDs? Just trying to make this more generic and not bound to a fixed window structure.
My future vision would be that there will be no fixed window structure at all but only contexts that skins can make use of as they wish (in custom views/windows, ...), and this PR could be the start in this direction.

Please note that I'm in no way objecting it - only wanted to share my view of how it could be made more flexible.

@@ -3163,6 +3164,15 @@ bool CGUIInfoManager::GetMultiInfoBool(const GUIInfo &info, int contextWindow, c
bReturn = true;
}
break;
case WINDOW_IS:
if (info.GetData1()) {

This comment was marked as spam.

@xhaggi
Copy link
Member Author

xhaggi commented Jan 31, 2016

@da-anda sure makes sense but not at the current state. for now it should be possible to check if a condition should be applied for a specific window which shares the same skin file.

@xhaggi
Copy link
Member Author

xhaggi commented Jan 31, 2016

@Montellese thanks for the review. will address the formatting issues. any other objections?

@razzeee
Copy link
Member

razzeee commented Feb 12, 2016

@xhaggi did you have any time to tackle this?

@xhaggi
Copy link
Member Author

xhaggi commented Feb 13, 2016

sure will do it next week

@xhaggi
Copy link
Member Author

xhaggi commented Feb 15, 2016

@razzeee updated

@razzeee
Copy link
Member

razzeee commented Feb 15, 2016

jenkins build and merge

@razzeee razzeee added this to the Krypton 17.0-alpha1 milestone Feb 15, 2016
razzeee added a commit that referenced this pull request Feb 15, 2016
@razzeee razzeee merged commit 0871790 into xbmc:master Feb 15, 2016
@xhaggi xhaggi deleted the gui-infobool-window-is branch January 19, 2017 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants