Fix Menu Rapido

This commit is contained in:
Alhaziel01
2020-05-14 18:44:11 +02:00
parent 19904a31bb
commit 3e14ab8c32
3 changed files with 53 additions and 46 deletions

View File

@@ -95,6 +95,7 @@ class Main(xbmcgui.WindowXMLDialog):
self.setCoordinateResolution(2)
for menuentry in menu:
if not menuentry.channel: menuentry.channel = prevchannel
item = xbmcgui.ListItem(menuentry.title)
if not submenu and menuentry.channel in ['news', 'channelselector', 'search', 'videolibrary']:
item.setProperty('sub', 'Controls/spinUp-Focus.png')
@@ -110,7 +111,7 @@ class Main(xbmcgui.WindowXMLDialog):
def onClick(self, control_id):
if control_id == 32500:
action = self.getControl(32500).getSelectedItem().getProperty('run')
xbmc.executebuiltin('Dialog.Close(all,true)')
self.close()
xbmc.executebuiltin('ActivateWindow(10025, "plugin://plugin.video.kod/?' + base64.b64encode(action) + '")')
@@ -118,7 +119,7 @@ class Main(xbmcgui.WindowXMLDialog):
def onAction(self, action):
# exit
if action.getId() in [xbmcgui.ACTION_PREVIOUS_MENU, xbmcgui.ACTION_NAV_BACK]:
xbmc.executebuiltin('Dialog.Close(all,true)')
self.close()
if submenu: open_shortcut_menu()
if action.getId() == xbmcgui.ACTION_CONTEXT_MENU:
@@ -126,25 +127,27 @@ class Main(xbmcgui.WindowXMLDialog):
if action == 3:
if submenu:
xbmc.executebuiltin('Dialog.Close(all,true)')
self.close()
open_shortcut_menu()
elif self.getControl(32500).getSelectedItem().getProperty('channel') in ['news', 'channelselector', 'search', 'videolibrary']:
channel_name = self.getControl(32500).getSelectedItem().getProperty('channel')
if channel_name == 'channelselector':
import channelselector
xbmc.executebuiltin('Dialog.Close(all,true)')
open_shortcut_menu(channelselector.getchanneltypes())
self.close()
open_shortcut_menu(channelselector.getchanneltypes(), channel_name)
else:
from core.item import Item
channel = __import__('specials.%s' % channel_name, fromlist=["specials.%s" % channel_name])
xbmc.executebuiltin('Dialog.Close(all,true)')
open_shortcut_menu(channel.mainlist(Item().fromjson(action)))
self.close()
open_shortcut_menu(channel.mainlist(Item().fromjson(action)), channel_name)
def open_shortcut_menu(newmenu=''):
def open_shortcut_menu(newmenu='', channel=''):
global menu
global submenu
global prevchannel
prevchannel = channel
if newmenu:
menu = newmenu
submenu = True
@@ -154,7 +157,6 @@ def open_shortcut_menu(newmenu=''):
XML = 'ShortCutMenu.xml'
if config.get_setting('icon_set') == 'dark':
XML = 'Dark' + XML
xbmc.executebuiltin('Dialog.Close(all,true)')
main = Main(XML, config.get_runtime_path())
main.doModal()
del main

View File

@@ -7,12 +7,10 @@
</coordinates>
<defaultcontrol always="true">32500</defaultcontrol>
<animation type="WindowOpen" reversible="false">
<effect type="slide" start="0,100" end="0,0" center="640,225" delay="160" tween="cubic" time="200" />
<effect type="fade" delay="160" end="100" time="220" />
</animation>
<animation type="WindowClose" reversible="false">
<effect type="slide" start="0,0" end="0,-100" center="640,225" delay="160" tween="cubic" time="200" />
<effect type="fade" start="100" end="0" time="200" />
<effect type="fade" delay="160" start="100" end="0" time="200" />
</animation>
<controls>
<control type="button">
@@ -24,14 +22,22 @@
<texturenofocus colordiffuse="88FFFFFF">Shortcut/white.png</texturenofocus>
<onclick>Action(close)</onclick>
</control>
<control type="image">
<left>0</left>
<top>0</top>
<width>880</width>
<height>220</height>
<texture border="2" colordiffuse="FFEEEEEE">Shortcut/white.png</texture>
</control>
<control type="group">
<animation type="WindowOpen" reversible="false">
<effect type="slide" start="0,100" end="0,0" center="640,225" delay="160" tween="cubic" time="200" />
<effect type="fade" delay="160" end="100" time="220" />
</animation>
<animation type="WindowClose" reversible="false">
<effect type="slide" start="0,0" end="0,-100" center="640,225" delay="160" tween="cubic" time="200" />
<effect type="fade" delay="160" start="100" end="0" time="200" />
</animation>
<control type="image">
<left>0</left>
<top>0</top>
<width>880</width>
<height>220</height>
<texture border="2" colordiffuse="FFEEEEEE">Shortcut/white.png</texture>
</control>
<control type="group">
<control type="image">
<left>-21</left>
@@ -53,7 +59,6 @@
<animation effect="slide" start="0,0" end="10,0" time="0" condition="true">Conditional</animation>
<animation effect="slide" end="120,0" time="0" condition="!Control.IsVisible(5)">Conditional</animation>
<itemlayout height="220" width="220">
<!-- <top>2</top> -->
<control type="image">
<top>0</top>
<left>0</left>
@@ -69,11 +74,9 @@
<texture colordiffuse="60FFFFFF">Shortcut/black.png</texture>
</control>
<control type="image">
<left>35</left>
<top>35</top>
<width>150</width>
<height>150</height>
<texture>$INFO[ListItem.Property(thumb)]</texture>
<width>220</width>
<height>220</height>
<texture>$INFO[ListItem.Property(thumbnail)]</texture>
<aspectratio>keep</aspectratio>
<align>center</align>
</control>
@@ -97,8 +100,9 @@
<animation effect="fade" start="100" end="0" time="0">Focus</animation>
</control>
<control type="image">
<top>1</top>
<width>220</width>
<height>220</height>
<height>218</height>
<texture colordiffuse="FF0082C2">Shortcut/button-fo.png</texture>
<animation effect="fade" start="100" end="0" time="0">Unfocus</animation>
</control>
@@ -118,20 +122,19 @@
<texture colordiffuse="60FFFFFF">Shortcut/black.png</texture>
</control>
<control type="image">
<left>35</left>
<top>35</top>
<width>150</width>
<height>150</height>
<texture>$INFO[ListItem.Property(thumb)]</texture>
<width>220</width>
<height>220</height>
<texture>$INFO[ListItem.Property(thumbnail)]</texture>
<aspectratio>keep</aspectratio>
<align>center</align>
</control>
<control type="textbox">
<left>0</left>
<top>146</top>
<top>160</top>
<width>220</width>
<height>74</height>
<font>font12</font>
<textcolor>FF232323</textcolor>
<label>$INFO[ListItem.Label]</label>
<align>center</align>
<aligny>center</aligny>
@@ -160,8 +163,6 @@
<textureslidernibfocus>-</textureslidernibfocus>
<showonepage>false</showonepage>
<orientation>horizontal</orientation>
<onleft>32500</onleft>
<onright>32500</onright>
<ondown>32500</ondown>
<onup>32500</onup>
<animation effect="slide" end="120,0" time="0" condition="!Control.IsVisible(5)">Conditional</animation>

View File

@@ -7,12 +7,10 @@
</coordinates>
<defaultcontrol always="true">32500</defaultcontrol>
<animation type="WindowOpen" reversible="false">
<effect type="slide" start="0,100" end="0,0" center="640,225" delay="160" tween="cubic" time="200" />
<effect type="fade" delay="160" end="100" time="220" />
</animation>
<animation type="WindowClose" reversible="false">
<effect type="slide" start="0,0" end="0,-100" center="640,225" delay="160" tween="cubic" time="200" />
<effect type="fade" start="100" end="0" time="200" />
<effect type="fade" delay="160" start="100" end="0" time="200" />
</animation>
<controls>
<control type="button">
@@ -24,14 +22,22 @@
<texturenofocus colordiffuse="88232323">Shortcut/white.png</texturenofocus>
<onclick>Action(close)</onclick>
</control>
<control type="image">
<left>0</left>
<top>0</top>
<width>880</width>
<height>220</height>
<texture border="2" colordiffuse="FF232323">Shortcut/white.png</texture>
</control>
<control type="group">
<animation type="WindowOpen" reversible="false">
<effect type="slide" start="0,100" end="0,0" center="640,225" delay="160" tween="cubic" time="200" />
<effect type="fade" delay="160" end="100" time="220" />
</animation>
<animation type="WindowClose" reversible="false">
<effect type="slide" start="0,0" end="0,-100" center="640,225" delay="160" tween="cubic" time="200" />
<effect type="fade" delay="160" start="100" end="0" time="200" />
</animation>
<control type="image">
<left>0</left>
<top>0</top>
<width>880</width>
<height>220</height>
<texture border="2" colordiffuse="FF232323">Shortcut/white.png</texture>
</control>
<control type="group">
<control type="image">
<left>-21</left>
@@ -157,8 +163,6 @@
<textureslidernibfocus>-</textureslidernibfocus>
<showonepage>false</showonepage>
<orientation>horizontal</orientation>
<!-- <onleft>32500</onleft>
<onright>32500</onright> -->
<ondown>32500</ondown>
<onup>32500</onup>
<animation effect="slide" end="120,0" time="0" condition="!Control.IsVisible(5)">Conditional</animation>