|
SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
Conditional themes
Hi,
I am trying to apply a theme to a widget depending on some condition at runtime (one import, different look&feel for different STVs), like this: Code:
cond=... OptionsMenu +- item1 +- item2 +- item3 +- other code / widgets +- If cond +- > true +- +- theme1 +- > false +- +- theme2 The closest I could get is to define two separate OptionMenus with their respective themes, but link all other menu contents from one widget to the other by reference: Code:
cond=... If cond +- > true +- OptionsMenu1 +- item1 +- item2 +- item3 +- other code / widgets +- theme1 +- > false +- OptionsMenu2 +- link to item1 +- link to item2 +- link to item3 +- link to other code / widgets +- theme2 Thanks, Dirk |
#2
|
||||
|
||||
If I understand you right, you're trying to make an addon that's compatible with two different base STVs that use different theme sets. Seems to me the right way to handle that would be to choose which theme set you want to link up to at import time, and then run through your code fixing up the (unconditional) theme refs. That seems cleaner than having conditional runtime refs to themes that may not actually be present.
If your themes are self-contained in your addon, and you just want a different look-and-feel depending on some runtime variable, then maybe the thing to do is to put as much of the conditional code as possible into the theme itself, so you don't have to be testing the condition on every use of the theme.
__________________
-- Greg |
#3
|
|||
|
|||
Greg, thanks a lot for your answer !
Quote:
Quote:
Quote:
Dirk |
#4
|
||||
|
||||
Quote:
Quote:
__________________
Jeffrey Kardatzke Founder of SageTV |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|