In Erweiterung des ChannelSelectionPlus aus dem Thread "Kanalliste 2te Information" habe ich der Kanalliste mal eine Template-Funktion spendiert
Dabei geht es um das Skinnen der Kanalliste per Templates.
Über die neue Template-Funktion in Verbindung mit dem ChannelSelection-Screen im Skin gibt es jetzt eigentlich kaum noch Grenzen zur optischen Gestaltung der Kanalliste.
(im Screenshot ein Template, wo der Fortschrittsbalken als dünner Balken unterhalb der Zeile dargestellt wird)
Hinweis zur Version 0.1.0:
Diese Version ist nur mit dem letzten DP-Update kompatibel - auf älteren e2-Versionen kann damit die Standard-Ansicht der Kanalliste (default-Ansicht ohne Template) nicht genutzt werden (es wird eine leere Liste angezeigt).
Dort sollte weiterhin die Version 0.0.9r9 genutzt werden.
Hinweise zur Template-Funktion:
Wenn man das Template direkt in seine skin.xml unter der ServiceList-component einbindet, werden nur noch die dortigen "MODE_FAVOURITES..."-Templates im Kanallisten-Setup angezeigt.
Die "MODE_FAVOURITES..."_Templates werden zur Anzeige der Sender-Einträge verwendet.
Das Template "MODE_NORMAL" wird für die Anzeige der Ordner (Satelliten, Anbieter, Favoriten-Liste) verwendet.
Zur Anzeige der Kanalliste in den All, Satellites und Provider-Listen kann ein optionales "MODE_ALL"-Template verwendet werden (gibt es das Template nicht, wird das aktivierte MODE_FAVOURITES... zur Anzeige verwendet)
Das "default"-Template muss als pseudo-Template enthalten bleiben - es wird aber nicht verwendet.
Im Code der Test-Version habe ich zum schnellen Testen bereits einige wählbare Templates integriert.
Je nach Skin (HD/FHD) werden vorbereitete Templates (an die default-Skins angepasst) zur Auswahl angeboten.
Ein Beispiel für den ServiceList-Component-Eintrag in der skin.xml findet man auch am des Codes in der plugin.py.
Hier ein Beispiel für den Component-Eintrag im Skin (mit 2 verschiedenen Templates für MODE_FAVOURITES..., die dann im Setup auswählbar sind)
Der template-Eintrag im component-Eintrag der ServiceList ist unschädlich, wenn man das ChannelSelectionPlus-Plugin nicht intstalliert hat - dann wird der Eintrag in der Standard-Darstellung der ServiceList einfach ignoriert.
<component type="ServiceList" beginMargin="3" endMargin="5" piconWidth="46" piconWidthBig="84" piconOffset="5" progressBarWidth="50" progressBarMargin="3" progressBarHeight="8" serviceInfoHeightAdd="8" serviceNumberWidth="55" textOffset="10" >
<template>
{"templates":
{
"default": (34, [ # needed dummy-template - not used
MultiContentEntryPixmapAlphaBlend(pos=(0,1), size=(30,30), png=3),
MultiContentEntryText(pos=(40,2), size=(840,30), flags=RT_HALIGN_LEFT | RT_VALIGN_CENTER, font=1, text=1),
]),
"MODE_FAVOURITES": (34, [ # template for channel-entries
# empty line full width to fill empty rects
MultiContentEntryText(pos=(0,0), size=(840,34), flags=RT_HALIGN_LEFT | RT_VALIGN_TOP, font=1, text="", color=MultiContentTemplateColor(10), color_sel=MultiContentTemplateColor(11), backcolor=MultiContentTemplateColor(12),backcolor_sel=MultiContentTemplateColor(13)),
# Picon
MultiContentEntryPixmapAlphaBlend(pos=(1,1), size=(50,30), png=4),
# ServiceName
MultiContentEntryText(pos=(65,2), size=(200,35), flags=RT_HALIGN_LEFT | RT_VALIGN_TOP, font=1, text=1, color=MultiContentTemplateColor(10), color_sel=MultiContentTemplateColor(11), backcolor=MultiContentTemplateColor(12),backcolor_sel=MultiContentTemplateColor(13)),
# EventName
MultiContentEntryText(pos=(270,2), size=(560,34), flags=RT_HALIGN_LEFT | RT_VALIGN_TOP, font=1, text=2, color=MultiContentTemplateColor(16), color_sel=MultiContentTemplateColor(17), backcolor=MultiContentTemplateColor(12),backcolor_sel=MultiContentTemplateColor(13)),
# Progressbar
MultiContentEntryProgress(pos=(65,27),size=(665,3), percent=-5, borderWidth=0, foreColor=MultiContentTemplateColor(6), backColor=MultiContentTemplateColor(7)),
# Markertext
MultiContentEntryText(pos=(53,1), size=(780,34), flags=RT_HALIGN_LEFT | RT_VALIGN_CENTER, font=0, text=24, color=MultiContentTemplateColor(10), color_sel=MultiContentTemplateColor(11), backcolor=MultiContentTemplateColor(12),backcolor_sel=MultiContentTemplateColor(13)),
]),
"MODE_FAVOURITES_PERCENT": (34, [ # alternative template for channel-entries
# empty line full width to fill empty rects
MultiContentEntryText(pos=(0,0), size=(840,34), flags=RT_HALIGN_LEFT | RT_VALIGN_TOP, font=1, text="", color=MultiContentTemplateColor(10), color_sel=MultiContentTemplateColor(11), backcolor=MultiContentTemplateColor(12),backcolor_sel=MultiContentTemplateColor(13)),
# Picon
MultiContentEntryPixmapAlphaBlend(pos=(1,1), size=(50,30), png=4),
# ServiceName
MultiContentEntryText(pos=(65,2), size=(200,34), flags=RT_HALIGN_LEFT | RT_VALIGN_TOP, font=1, text=1, color=MultiContentTemplateColor(10), color_sel=MultiContentTemplateColor(11), backcolor=MultiContentTemplateColor(12),backcolor_sel=MultiContentTemplateColor(13)),
# EventName
MultiContentEntryText(pos=(270,2), size=(480,34), flags=RT_HALIGN_LEFT | RT_VALIGN_TOP, font=1, text=2, color=MultiContentTemplateColor(16), color_sel=MultiContentTemplateColor(17), backcolor=MultiContentTemplateColor(12),backcolor_sel=MultiContentTemplateColor(13)),
# PercentText
MultiContentEntryText(pos=(750,2), size=(60,34), flags=RT_HALIGN_RIGHT | RT_VALIGN_TOP, font=1, text=23, color=MultiContentTemplateColor(14), color_sel=MultiContentTemplateColor(15), backcolor=MultiContentTemplateColor(12),backcolor_sel=MultiContentTemplateColor(13)),
# Progressbar
MultiContentEntryProgress(pos=(65,27),size=(665,3), percent=-5, borderWidth=0, foreColor=MultiContentTemplateColor(6), backColor=MultiContentTemplateColor(7)),
# Markertext
MultiContentEntryText(pos=(53,1), size=(780,34), flags=RT_HALIGN_LEFT | RT_VALIGN_CENTER, font=0, text=24, color=MultiContentTemplateColor(10), color_sel=MultiContentTemplateColor(11), backcolor=MultiContentTemplateColor(12),backcolor_sel=MultiContentTemplateColor(13)),
]),
"MODE_NORMAL": (34, [ # template for folder-entries
MultiContentEntryText(pos=(0,0), size=(840,34), flags=RT_HALIGN_LEFT | RT_VALIGN_TOP, font=1, text="", color=MultiContentTemplateColor(10), color_sel=MultiContentTemplateColor(11), backcolor=MultiContentTemplateColor(12),backcolor_sel=MultiContentTemplateColor(13)),
MultiContentEntryPixmapAlphaBlend(pos=(1,0), size=(30,30), png=3),
MultiContentEntryText(pos=(40,0), size=(840,34), flags=RT_HALIGN_LEFT | RT_VALIGN_CENTER, font=1, text=1, color=MultiContentTemplateColor(10), color_sel=MultiContentTemplateColor(11), backcolor=MultiContentTemplateColor(12),backcolor_sel=MultiContentTemplateColor(13)),
]),
},
"fonts": [gFont("Regular",21),gFont("Regular",20), gFont("Regular", 32), gFont("Regular", 30)]
}
</template>
</component>
Alles anzeigen
Hier die aktuelle Liste der verfügbaren Template-Werte (ist auch im Code der plugin.py enthalten):
Template-Werte in Version 0.1.0:
#1 = serviceName # text=1
#2 = eventName # text=2
#3 = FolderPic # png=3
#4 = Picon # png=4
#5 = progress percent value # percent=-5
#6 = progressbar foreColor # foreColor=MultiContentTemplateColor(6)
#7 = progressbar foreColorSelected # ...=MultiContentTemplateColor(7)
#8 = progressbar backColor # backColor=MultiContentTemplateColor(8)
#9 = progressbar backColorSelected # backColorSelected=MultiContentTemplateColor(9)
#10 = forgroundColor # ...=MultiContentTemplateColor(10)
#11 = forgroundColorSel # ...=MultiContentTemplateColor(11)
#12 = backgroundColor # ...=MultiContentTemplateColor(12)
#13 = backgroundColorSel # ...=MultiContentTemplateColor(13)
#14 = additionalInfoColor # ...=MultiContentTemplateColor(14)
#15 = additionalInfoColorSelected # ...=MultiContentTemplateColor(15)
#16 = serviceDescriptionColor # ...=MultiContentTemplateColor(16)
#17 = serviceDescriptionColorSelected # ...=MultiContentTemplateColor(17)
#18 = servicenumber_text # text=18
#19 = addtimedisplay_text # text=19
#20 = eventName_shortdesc_text # text=20
#21 = nextEventTimeName_text # text=21
#22 = time_remaining_text # text=22
#23 = time_percent_text # text=23
#24 = marker_text # text=24
#25 = picServiceEventProgressbar # png=25
#26 = eventName_fullDescription_text # text=26
#27 = marker_icon # png=27
#28 = nextEventName_text # text=28
#29 = nextEventTime_text # text=29 for example '14.30 - 15.30'
#30 = nowEventTime_text # text=30 for example '12.00 - 14.30'
#31 = primetimeEventName_text # text=31
#32 = primetimeEventTime_text # text=32 for example '20.15 - 21.45'
#33 = moreNextEventsList_text # text=33 like EventList-Converter
#34 = primetimeEventList_text # text=34 like EventList-Converter
#35 = primetimeHeading_text # text=35 (primetime or primetime next day)
#36 = channelnumberServicename_text # text=36
#37 = picInBouquet (only merlin) # png=37 (for merlin tag bouquetServices)
#38 = providerName_text # text=38 (show the providername of the service)
#39 = providerPicon # png=39 (in subfolder 'PiconProvider' in picon-folder)
#40 = eventImage # png=40 (load eventImages from EventDataManager)
#41 = serviceNameEventName # text=41 (show 'servicename (eventname)')
#42 = width # test-value
#43 = valign # test-value
Alles anzeigen