New Skin For Dialogs Windows
This commit is contained in:
@@ -7,7 +7,7 @@ import xbmcaddon
|
||||
import xbmcgui
|
||||
|
||||
from channelselector import get_thumb
|
||||
from platformcode import config
|
||||
from platformcode import config, logger
|
||||
|
||||
|
||||
class KeyListener(xbmcgui.WindowXMLDialog):
|
||||
@@ -168,6 +168,9 @@ class Main(xbmcgui.WindowXMLDialog):
|
||||
|
||||
|
||||
def open_shortcut_menu():
|
||||
main = Main('ShortCutMenu.xml', config.get_runtime_path())
|
||||
XML = 'ShortCutMenu.xml'
|
||||
if config.get_setting('icon_set') == 'dark':
|
||||
XML = 'Dark' + XML
|
||||
main = Main(XML, config.get_runtime_path())
|
||||
main.doModal()
|
||||
del main
|
||||
|
||||
@@ -354,7 +354,7 @@ class SettingsWindow(xbmcgui.WindowXMLDialog):
|
||||
return ok
|
||||
|
||||
def add_control_label(self, c):
|
||||
control = xbmcgui.ControlLabel(0, -100, self.controls_width, 30, "", alignment=4, font=self.font,
|
||||
control = xbmcgui.ControlLabel(0, -100, self.controls_width, 40, "", alignment=4, font=self.font,
|
||||
textColor=c["color"])
|
||||
|
||||
self.addControl(control)
|
||||
@@ -366,20 +366,20 @@ class SettingsWindow(xbmcgui.WindowXMLDialog):
|
||||
c["control"] = control
|
||||
|
||||
def add_control_list(self, c):
|
||||
control = xbmcgui.ControlButton(0, -100, self.controls_width, self.height_control,
|
||||
control = xbmcgui.ControlButton(0, -100, self.controls_width + 20, self.height_control,
|
||||
c["label"], os.path.join(self.mediapath, 'Controls', 'MenuItemFO.png'),
|
||||
os.path.join(self.mediapath, 'Controls', 'MenuItemNF.png'),
|
||||
0, textColor=c["color"],
|
||||
10, textColor=c["color"],
|
||||
font=self.font)
|
||||
|
||||
label = xbmcgui.ControlLabel(0, -100, self.controls_width - 30, self.height_control,
|
||||
"", font=self.font, textColor=c["color"], alignment=4 | 1)
|
||||
label = xbmcgui.ControlLabel(0, -100, self.controls_width - 80, self.height_control,
|
||||
"", font=self.font, textColor=c["color"], alignment= 1 | 4)
|
||||
|
||||
upBtn = xbmcgui.ControlButton(0, -100, 20, 15, "",
|
||||
upBtn = xbmcgui.ControlButton(0, -100, 15, 7, "",
|
||||
focusTexture=os.path.join(self.mediapath, 'Controls', 'spinUp-Focus.png'),
|
||||
noFocusTexture=os.path.join(self.mediapath, 'Controls', 'spinUp-noFocus.png'))
|
||||
|
||||
downBtn = xbmcgui.ControlButton(0, -100 + 15, 20, 15, "",
|
||||
downBtn = xbmcgui.ControlButton(0, -100 + 15, 15, 7, "",
|
||||
focusTexture=os.path.join(self.mediapath, 'Controls', 'spinDown-Focus.png'),
|
||||
noFocusTexture=os.path.join(self.mediapath, 'Controls', 'spinDown-noFocus.png'))
|
||||
|
||||
@@ -431,14 +431,14 @@ class SettingsWindow(xbmcgui.WindowXMLDialog):
|
||||
def add_control_bool(self, c):
|
||||
# Versiones antiguas no admite algunas texturas
|
||||
if xbmcgui.__version__ in ["1.2", "2.0"]:
|
||||
control = xbmcgui.ControlRadioButton(0 - 10, -100, self.controls_width + 10, self.height_control,
|
||||
control = xbmcgui.ControlRadioButton(0, -100, self.controls_width + 20, self.height_control,
|
||||
label=c["label"], font=self.font, textColor=c["color"],
|
||||
focusTexture=os.path.join(self.mediapath, 'Controls',
|
||||
'MenuItemFO.png'),
|
||||
noFocusTexture=os.path.join(self.mediapath, 'Controls',
|
||||
'MenuItemNF.png'))
|
||||
else:
|
||||
control = xbmcgui.ControlRadioButton(0 - 10, -100, self.controls_width + 10,
|
||||
control = xbmcgui.ControlRadioButton(0, -100, self.controls_width + 20,
|
||||
self.height_control, label=c["label"], font=self.font,
|
||||
textColor=c["color"],
|
||||
focusTexture=os.path.join(self.mediapath, 'Controls',
|
||||
@@ -491,11 +491,11 @@ class SettingsWindow(xbmcgui.WindowXMLDialog):
|
||||
self.getControl(10005).getPosition()[1])
|
||||
|
||||
# Obtenemos las dimensiones del area de controles
|
||||
self.controls_width = self.getControl(10007).getWidth() - 20
|
||||
self.controls_height = self.getControl(10007).getHeight()
|
||||
self.controls_width = self.getControl(10007).getWidth() - 30
|
||||
self.controls_height = self.getControl(10007).getHeight() -100
|
||||
self.controls_pos_x = self.getControl(10007).getPosition()[0] + self.getControl(10001).getPosition()[0] + 10
|
||||
self.controls_pos_y = self.getControl(10007).getPosition()[1] + self.getControl(10001).getPosition()[1]
|
||||
self.height_control = 35
|
||||
self.height_control = 40
|
||||
self.font = "font12"
|
||||
|
||||
# En versiones antiguas: creamos 5 controles, de lo conrtario al hacer click al segundo control,
|
||||
@@ -619,7 +619,7 @@ class SettingsWindow(xbmcgui.WindowXMLDialog):
|
||||
|
||||
if c["type"] != "list":
|
||||
if c["type"] == "bool":
|
||||
c["control"].setPosition(self.controls_pos_x - 10, c["y"])
|
||||
c["control"].setPosition(self.controls_pos_x, c["y"])
|
||||
else:
|
||||
c["control"].setPosition(self.controls_pos_x, c["y"])
|
||||
|
||||
@@ -629,8 +629,8 @@ class SettingsWindow(xbmcgui.WindowXMLDialog):
|
||||
c["label"].setPosition(self.controls_pos_x + self.controls_width - 30, c["y"])
|
||||
else:
|
||||
c["label"].setPosition(self.controls_pos_x, c["y"])
|
||||
c["upBtn"].setPosition(self.controls_pos_x + c["control"].getWidth() - 25, c["y"] + 3)
|
||||
c["downBtn"].setPosition(self.controls_pos_x + c["control"].getWidth() - 25, c["y"] + 18)
|
||||
c["upBtn"].setPosition(self.controls_pos_x + c["control"].getWidth() - 40, c["y"] + 15)
|
||||
c["downBtn"].setPosition(self.controls_pos_x + c["control"].getWidth() - 25, c["y"] + 15)
|
||||
|
||||
self.set_visible(c, True)
|
||||
|
||||
@@ -962,7 +962,7 @@ class ControlEdit(xbmcgui.ControlButton):
|
||||
self.label = ""
|
||||
self.text = ""
|
||||
self.textControl = xbmcgui.ControlLabel(self.getX(), self.getY(), self.getWidth(), self.getHeight(), self.text,
|
||||
font=kwargs["font"], textColor=kwargs["textColor"], alignment=4 | 1)
|
||||
font=kwargs["font"], textColor=kwargs["textColor"], alignment= 4 | 1)
|
||||
self.window.addControl(self.textControl)
|
||||
|
||||
def setLabel(self, val):
|
||||
|
||||
Reference in New Issue
Block a user