All pastes #774070 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-11-14 23:17 UTC
rendered paste body
Index: mythtv/libs/libmythui/myththemedmenu.cpp
===================================================================
--- mythtv/libs/libmythui/myththemedmenu.cpp    (revision 14863)
+++ mythtv/libs/libmythui/myththemedmenu.cpp    (working copy)
@@ -201,6 +201,7 @@
                       const QString &password_setting,
                       const QString &text);

+    void SetupBackground();
     void SetupUITypes();

     bool gestureEvent(MythUIType *origtype, MythGestureEvent *ge);
@@ -1484,6 +1482,8 @@
     buttonList.clear();
     buttonRows.clear();

+    SetupBackground();
+
     QDomElement docElem = doc.documentElement();

     menumode = docElem.attribute("name", "");
@@ -1532,6 +1532,20 @@
     return true;
 }

+/// \brief Sets up menu background, must be done before the buttons are parsed
+void MythThemedMenuPrivate::SetupBackground(void)
+{
+
+    if (m_state->buttonBackground)
+    {
+        MythUIImage *buttonBackground;
+        buttonBackground = new MythUIImage(parent, "menu button background");
+        buttonBackground->SetImage(m_state->buttonBackground);
+        buttonBackground->SetPosition(m_state->buttonArea.topLeft());
+    }
+
+}
+
 /// \brief Sets up UI according to the corresponding mythThemedMenuState.
 void MythThemedMenuPrivate::SetupUITypes(void)
 {
@@ -1551,14 +1565,6 @@
         logo->SetPosition(m_state->logoRect.topLeft());
     }

-    if (m_state->buttonBackground)
-    {
-        MythUIImage *buttonBackground;
-        buttonBackground = new MythUIImage(parent, "menu button background");
-        buttonBackground->SetImage(m_state->buttonBackground);
-        buttonBackground->SetPosition(m_state->buttonArea.topLeft());
-    }
-
     watermark = new MythUIStateType(parent, "menu watermarks");
     watermark->SetArea(m_state->watermarkRect);
     watermark->SetShowEmpty(true);