diff options
author | jenkins4kodi <jenkins4kodi@users.noreply.github.com> | 2015-07-14 01:50:54 +0200 |
---|---|---|
committer | jenkins4kodi <jenkins4kodi@users.noreply.github.com> | 2015-07-14 01:50:54 +0200 |
commit | 22688ad83516d3c6ca0d86c1ec2288396050712f (patch) | |
tree | 5eb379279e9cd0393eba4988ec6354ebbab15d98 | |
parent | bdd1c88d23f9fa5e4b7268fe00827d0f0d851f04 (diff) | |
parent | a20c6691a1ff7441f9e8b919fbbdbc8ba92f41cc (diff) |
Merge pull request #7500 from xhaggi/isengard-fix-render-order-for-addon-dialogs
-rw-r--r-- | xbmc/interfaces/legacy/Window.h | 5 | ||||
-rw-r--r-- | xbmc/interfaces/legacy/WindowDialog.cpp | 5 | ||||
-rw-r--r-- | xbmc/interfaces/legacy/WindowInterceptor.h | 6 | ||||
-rw-r--r-- | xbmc/interfaces/legacy/WindowXML.cpp | 15 | ||||
-rw-r--r-- | xbmc/interfaces/legacy/WindowXML.h | 2 |
5 files changed, 31 insertions, 2 deletions
diff --git a/xbmc/interfaces/legacy/Window.h b/xbmc/interfaces/legacy/Window.h index 2ac7edbb68..212343f70f 100644 --- a/xbmc/interfaces/legacy/Window.h +++ b/xbmc/interfaces/legacy/Window.h @@ -31,6 +31,11 @@ namespace XBMCAddon { namespace xbmcgui { + enum RenderOrder { + WINDOW = 0, + DIALOG = 1 + }; + // Forward declare the interceptor as the AddonWindowInterceptor.h // file needs to include the Window class because of the template class InterceptorBase; diff --git a/xbmc/interfaces/legacy/WindowDialog.cpp b/xbmc/interfaces/legacy/WindowDialog.cpp index 710b4a1d61..fd2c746116 100644 --- a/xbmc/interfaces/legacy/WindowDialog.cpp +++ b/xbmc/interfaces/legacy/WindowDialog.cpp @@ -32,7 +32,10 @@ namespace XBMCAddon Window(true), WindowDialogMixin(this) { CSingleLock lock(g_graphicsContext); - setWindow(new Interceptor<CGUIWindow>("CGUIWindow",this,getNextAvailalbeWindowId())); + InterceptorBase* interceptor = new Interceptor<CGUIWindow>("CGUIWindow", this, getNextAvailalbeWindowId()); + // set the render order to the dialog's default because this dialog is mapped to CGUIWindow instead of CGUIDialog + interceptor->SetRenderOrder(RenderOrder::DIALOG); + setWindow(interceptor); } WindowDialog::~WindowDialog() { deallocating(); } diff --git a/xbmc/interfaces/legacy/WindowInterceptor.h b/xbmc/interfaces/legacy/WindowInterceptor.h index 6fefac0fcb..0a004b688c 100644 --- a/xbmc/interfaces/legacy/WindowInterceptor.h +++ b/xbmc/interfaces/legacy/WindowInterceptor.h @@ -67,7 +67,9 @@ namespace XBMCAddon virtual CGUIWindow* get() = 0; - virtual void setActive(bool active) { } ; + virtual void SetRenderOrder(int renderOrder) { } + + virtual void setActive(bool active) { } virtual bool isActive() { return false; } friend class ref; @@ -174,6 +176,8 @@ namespace XBMCAddon virtual bool IsDialog() const { XBMC_TRACE; return checkedb(IsDialog()); }; virtual bool IsMediaWindow() const { XBMC_TRACE; return checkedb(IsMediaWindow());; }; + virtual void SetRenderOrder(int renderOrder) { XBMC_TRACE; P::m_renderOrder = renderOrder; } + virtual void setActive(bool active) { XBMC_TRACE; P::m_active = active; } virtual bool isActive() { XBMC_TRACE; return P::m_active; } }; diff --git a/xbmc/interfaces/legacy/WindowXML.cpp b/xbmc/interfaces/legacy/WindowXML.cpp index 64c512d22b..11a0983b28 100644 --- a/xbmc/interfaces/legacy/WindowXML.cpp +++ b/xbmc/interfaces/legacy/WindowXML.cpp @@ -494,6 +494,21 @@ namespace XBMCAddon g_windowManager.RemoveDialog(interceptor->GetID()); WindowXML::OnDeinitWindow(nextWindowID); } + + bool WindowXMLDialog::LoadXML(const String &strPath, const String &strLowerPath) + { + XBMC_TRACE; + if (WindowXML::LoadXML(strPath, strLowerPath)) + { + // Set the render order to the dialog's default in case it's not specified in the skin xml + // because this dialog is mapped to CGUIMediaWindow instead of CGUIDialog. + // This must be done here, because the render order will be reset before loading the skin xml. + if (ref(window)->GetRenderOrder() == RenderOrder::WINDOW) + window->SetRenderOrder(RenderOrder::DIALOG); + return true; + } + return false; + } } diff --git a/xbmc/interfaces/legacy/WindowXML.h b/xbmc/interfaces/legacy/WindowXML.h index e57ca80e78..fb65314103 100644 --- a/xbmc/interfaces/legacy/WindowXML.h +++ b/xbmc/interfaces/legacy/WindowXML.h @@ -238,6 +238,8 @@ namespace XBMCAddon SWIGHIDDENVIRTUAL bool OnAction(const CAction &action); SWIGHIDDENVIRTUAL void OnDeinitWindow(int nextWindowID); + SWIGHIDDENVIRTUAL bool LoadXML(const String &strPath, const String &strPathLower); + SWIGHIDDENVIRTUAL inline void show() { XBMC_TRACE; WindowDialogMixin::show(); } SWIGHIDDENVIRTUAL inline void close() { XBMC_TRACE; WindowDialogMixin::close(); } |