Why not compleet remove the embeded screen within the plugin and rely under the standard setup screen...... ??
Then all goes 'automatically' without any custom stuff....?
And then of course (not included below) give the correct keys to clear, ok, cancel..... "key_red, key_green, key_blue...."
Gone custom screen by using the standard what is already available... reduces also a lot of code and a crapy and ugly 'screenWidth check hack'. And it is in line what the skin 'says'.
I hope you now understand what I meen....
+class SetupZapSelectorScreen(Screen, ConfigListScreen, ProtectedScreen):
-class Setup(Screen, ConfigListScreen, ProtectedScreen):
- global PLUGIN_VERSION
- if screenWidth >= 1920:
- skin = """
- <screen position="center,center" size="765,550" >
- <widget name="config" position="8,8" size="750,475" font="Regular;30" itemHeight="36" />
- <ePixmap pixmap="skin_default/buttons/green.png" position="300,460" zPosition="0" size="210,60" alphatest="on" />
- <ePixmap pixmap="skin_default/buttons/red.png" position="38,460" zPosition="0" size="210,60" alphatest="on" />
- <ePixmap pixmap="skin_default/buttons/blue.png" position="570,460" zPosition="0" size="210,60" alphatest="on" />
- <widget name="clear" position="540,450" size="210,60" valign="center" halign="center" zPosition="1" font="Regular;22" transparent="1" -backgroundColor="blue" />
- <widget name="ok" position="270,450" size="210,60" valign="center" halign="center" zPosition="1" font="Regular;22" transparent="1" backgroundColor="green" />
- <widget name="cancel" position="8,450" size="210,60" valign="center" halign="center" zPosition="1" font="Regular;22" transparent="1" -backgroundColor="red" />
- </screen>"""
- else:
- skin = """
- <screen position="center,center" size="510,360" >
- <widget name="config" position="5,5" size="500,310" />
- <ePixmap pixmap="skin_default/buttons/green.png" position="180,300" zPosition="0" size="140,40" alphatest="on" />
- <ePixmap pixmap="skin_default/buttons/red.png" position="5,300" zPosition="0" size="140,40" alphatest="on" />
- <ePixmap pixmap="skin_default/buttons/blue.png" position="360,300" zPosition="0" size="140,40" alphatest="on" />
- <widget name="clear" position="360,300" size="140,40" valign="center" halign="center" zPosition="1" font="Regular;17" transparent="1" backgroundColor="blue" />
- <widget name="ok" position="180,300" size="140,40" valign="center" halign="center" zPosition="1" font="Regular;17" transparent="1" backgroundColor="green" />
- <widget name="cancel" position="5,300" size="140,40" valign="center" halign="center" zPosition="1" font="Regular;17" transparent="1" backgroundColor="red" />
- </screen>"""
-
def __init__(self, session, args=None):
- self.skin = SetupZapSelectorScreen.skin
self.setup_title = _("Setup Zap History:") + PLUGIN_VERSION
Screen.__init__(self, session)
ProtectedScreen.__init__(self)
- self["ok"] = Button(_("Save"))
- self["cancel"] = Button(_("Cancel"))
- self["clear"] = Button(_("Options"))
+ self["key_green"] = StaticText(_("Save"))
+ self["key_red"] = StaticText(_("Cancel"))
+ self["key_blue"] = StaticText(_("Options"))
self["actions"] = ActionMap(["SetupActions", "ColorActions"],
Edited by littlesat, 18 August 2020 - 10:40.