Skip to content

Commit 16d454d

Browse files
committed
Add "Window" element to skinparser
1 parent b84129a commit 16d454d

3 files changed

Lines changed: 32 additions & 3 deletions

File tree

res/skins/Shade/skin.xml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,19 @@
440440
<!-- minimal decks, visible with maximized library -->
441441
<Template src="skin:decks_row_small.xml"/>
442442

443-
<SingletonContainer>
444-
<ObjectName>Library</ObjectName>
445-
</SingletonContainer>
443+
<WidgetGroup>
444+
<SizePolicy>me,me</SizePolicy>
445+
</WidgetGroup>
446+
447+
<Window>
448+
<SizePolicy>me,me</SizePolicy>
449+
<Layout>vertical</Layout>
450+
<Children>
451+
<SingletonContainer>
452+
<ObjectName>Library</ObjectName>
453+
</SingletonContainer>
454+
</Children>
455+
</Window>
446456
</Children>
447457
</WidgetGroup>
448458
</Children>

src/skin/legacy/legacyskinparser.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,8 @@ QList<QWidget*> LegacySkinParser::parseNode(const QDomElement& node) {
631631
parseSingletonDefinition(node);
632632
} else if (nodeName == "SingletonContainer") {
633633
result = wrapWidget(parseStandardWidget<WSingletonContainer>(node));
634+
} else if (nodeName == "Window") {
635+
result = wrapWidget(parseWindow(node));
634636
} else {
635637
SKIN_WARNING(node,
636638
*m_pContext,
@@ -751,6 +753,22 @@ QWidget* LegacySkinParser::parseWidgetGroup(const QDomElement& node) {
751753
return pGroup;
752754
}
753755

756+
QWidget* LegacySkinParser::parseWindow(const QDomElement& node) {
757+
WWidgetGroup* pWindow = new WWidgetGroup(m_pParent);
758+
pWindow->setWindowFlags(Qt::Window);
759+
pWindow->setWindowTitle("Mixxx Library");
760+
pWindow->show();
761+
setupBaseWidget(node, pWindow);
762+
setupWidget(node, pWindow->toQWidget());
763+
pWindow->setup(node, *m_pContext);
764+
// Note: if we call setupConnections earlier and it sets the visible property
765+
// to true, the style is not applied correctly
766+
setupConnections(node, pWindow);
767+
pWindow->Init();
768+
parseChildren(node, pWindow);
769+
return nullptr;
770+
}
771+
754772
QWidget* LegacySkinParser::parseWidgetStack(const QDomElement& node) {
755773
ControlObject* pNextControl = controlFromConfigNode(node.toElement(), "NextControl");
756774
ConfigKey nextConfigKey;

src/skin/legacy/legacyskinparser.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ class LegacySkinParser : public QObject, public SkinParser {
101101

102102
// Grouping / layout.
103103
QWidget* parseWidgetGroup(const QDomElement& node);
104+
QWidget* parseWindow(const QDomElement& node);
104105
QWidget* parseTrackWidgetGroup(const QDomElement& node);
105106
QWidget* parseWidgetStack(const QDomElement& node);
106107
QWidget* parseSizeAwareStack(const QDomElement& node);

0 commit comments

Comments
 (0)