Kodi Community Forum
Dialog Pop Up - Printable Version

Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
--- Thread: Dialog Pop Up (/showthread.php?tid=355440)



Dialog Pop Up - oytschi - 2020-06-25

Hey,

I'm trying to embed a Dialog Popup Window, which I can open from my Home Screen and by pressing one of the Label Buttons, different Scripts will be executed.
The only thing I cant get working is, that there is no backgroundcolor. I created a custom-data.xml which I could open with following content:

Code:

<window id="2345" type="dialog">
    <!--<defaultcontrol>1</defaultcontrol>-->
    <backgroundcolor>0</backgroundcolor>
    <allowoverlay>yes</allowoverlay>
    <coordinates>
      <left>100</left>
      <top>100</top>
    </coordinates>
    <controls>
        ...
    </controls>
</window>

When playing around with the backgroundcolor tag, there is no change on the dialog window background itself.

Then I tried the python version with the Dialog Class which would be nice because it looks like a "real" popup with a closing option in the corner. But here I didnt found a way to embed a label with an onclick attribute Big Grin

Code:

dialog = xbmcgui.Dialog()
ok = dialog.ok('Test', 'This is an test.')

Does somebody know, why I cant change the background color of the window?

Thanks in advance Smile!


RE: Dialog Pop Up - pkscout - 2020-06-25

I'm pretty sure colors have to be either named (in the colors file or one of the system names) or a hex code.  '0' is not a color.


RE: Dialog Pop Up - roidy - 2020-06-25

(2020-06-25, 11:37)oytschi Wrote: When playing around with the backgroundcolor tag, there is no change on the dialog window background itself.
 
From the skinning manual:-

Code:
backgroundcolor
Specifies whether the window needs clearing prior to rendering, and if so which colour to use. Defaults to clearing to black. Set to 0 (or 0x00000000) to have no clearing at all. If your skin always renders opaque textures over the entire screen (eg using a backdrop image or multiple backdrop images) then setting the background color to 0 is the most optimal value and may improve performance significantly on slow GPUs.

Setting to 0 makes the window effectively transparent and you can see the previous window through it.

I think most skinners / skins just use a fullscreen image control to clear the screen

Code:
<control type="image">
  <left>0</left>
  <top>0</top>
  <width>100%</width>
  <height>100%</height>
  <texture>black.png</texture>
</control>



RE: Dialog Pop Up - oytschi - 2020-06-26

I was tyring backgroundcolor attribute with 0xFFFFFFFF and 0xFF000000 but with the same result.
The idea with the black image as own control is a good idea. I'll give it a try thank you!


RE: Dialog Pop Up - jurialmunkey - 2020-06-26

backgroundcolor tag only works for non-dialog windows. It won't work with a dialog, because dialogs by their nature have a transparent background since they are overlayed on top of the current window.


This forum uses Lukasz Tkacz MyBB addons.