Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1233,7 +1233,6 @@ add_library(mixxx-lib STATIC EXCLUDE_FROM_ALL
src/widget/wtrackproperty.cpp
src/widget/wtracktableview.cpp
src/widget/wtracktableviewheader.cpp
src/widget/wtracktext.cpp
src/widget/wtrackwidgetgroup.cpp
src/widget/wwidget.cpp
src/widget/wwidgetgroup.cpp
Expand Down
2 changes: 0 additions & 2 deletions res/skins/Deere/deck_overview.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
<Mark>
<Control>intro_start_position</Control>
<VisibilityControl>[Skin],show_intro_outro_cues</VisibilityControl>
<Text></Text>
<Align>top|right</Align>
<Color>#0000FF</Color>
<TextColor>#FFFFFF</TextColor>
Expand Down Expand Up @@ -93,7 +92,6 @@
<Mark>
<Control>outro_end_position</Control>
<VisibilityControl>[Skin],show_intro_outro_cues</VisibilityControl>
<Text></Text>
<Align>top|left</Align>
<Color>#0000FF</Color>
<TextColor>#FFFFFF</TextColor>
Expand Down
2 changes: 0 additions & 2 deletions res/skins/Deere/effect_focus_button.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ Variables:
<NumberStates>2</NumberStates>
<State>
<Number>0</Number>
<Text></Text>
<Pressed scalemode="STRETCH_ASPECT">icon/ic_radio_button_off_48px.svg</Pressed>
<Unpressed scalemode="STRETCH_ASPECT">icon/ic_radio_button_off_48px.svg</Unpressed>
</State>
<State>
<Number>1</Number>
<Text></Text>
<Pressed scalemode="STRETCH_ASPECT">icon/ic_radio_button_on_48px.svg</Pressed>
<Unpressed scalemode="STRETCH_ASPECT">icon/ic_radio_button_on_48px.svg</Unpressed>
</State>
Expand Down
2 changes: 0 additions & 2 deletions res/skins/Deere/hide_show_button.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@
<NumberStates>2</NumberStates>
<State>
<Number>0</Number>
<Text></Text>
<Pressed scalemode="STRETCH_ASPECT">icon/ic_unfold_more_48px.svg</Pressed>
<Unpressed scalemode="STRETCH_ASPECT">icon/ic_unfold_more_48px.svg</Unpressed>
</State>
<State>
<Number>1</Number>
<Text></Text>
<Pressed scalemode="STRETCH_ASPECT">icon/ic_unfold_less_48px.svg</Pressed>
<Unpressed scalemode="STRETCH_ASPECT">icon/ic_unfold_less_48px.svg</Unpressed>
</State>
Expand Down
2 changes: 0 additions & 2 deletions res/skins/Deere/knob_with_button.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@
<NumberStates>2</NumberStates>
<State>
<Number>0</Number>
<Text></Text>
<Pressed scalemode="STRETCH_ASPECT">icon/ic_radio_button_off_48px.svg</Pressed>
<Unpressed scalemode="STRETCH_ASPECT">icon/ic_radio_button_off_48px.svg</Unpressed>
</State>
<State>
<Number>1</Number>
<Text></Text>
<Pressed scalemode="STRETCH_ASPECT">icon/ic_radio_button_on_48px.svg</Pressed>
<Unpressed scalemode="STRETCH_ASPECT">icon/ic_radio_button_on_48px.svg</Unpressed>
</State>
Expand Down
2 changes: 0 additions & 2 deletions res/skins/Deere/knob_with_button_left.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@
<NumberStates>2</NumberStates>
<State>
<Number>0</Number>
<Text></Text>
<Pressed scalemode="STRETCH_ASPECT">icon/ic_radio_button_off_48px.svg</Pressed>
<Unpressed scalemode="STRETCH_ASPECT">icon/ic_radio_button_off_48px.svg</Unpressed>
</State>
<State>
<Number>1</Number>
<Text></Text>
<Pressed scalemode="STRETCH_ASPECT">icon/ic_radio_button_on_48px.svg</Pressed>
<Unpressed scalemode="STRETCH_ASPECT">icon/ic_radio_button_on_48px.svg</Unpressed>
</State>
Expand Down
2 changes: 0 additions & 2 deletions res/skins/Deere/knob_with_button_right.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@
<NumberStates>2</NumberStates>
<State>
<Number>0</Number>
<Text></Text>
<Pressed scalemode="STRETCH_ASPECT">icon/ic_radio_button_off_48px.svg</Pressed>
<Unpressed scalemode="STRETCH_ASPECT">icon/ic_radio_button_off_48px.svg</Unpressed>
</State>
<State>
<Number>1</Number>
<Text></Text>
<Pressed scalemode="STRETCH_ASPECT">icon/ic_radio_button_on_48px.svg</Pressed>
<Unpressed scalemode="STRETCH_ASPECT">icon/ic_radio_button_on_48px.svg</Unpressed>
</State>
Expand Down
4 changes: 2 additions & 2 deletions res/skins/Deere/preview_deck.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
<ObjectName>PreviewDeckTextRow</ObjectName>
<Layout>horizontal</Layout>
<Children>
<Text>
<TrackProperty>
<TooltipId>text</TooltipId>
<SizePolicy>me,min</SizePolicy>
<Group><Variable name="group"/></Group>
<Elide>right</Elide>
</Text>
</TrackProperty>

<Template src="skin:left_1state_button.xml">
<SetVariable name="TooltipId">eject</SetVariable>
Expand Down
1 change: 0 additions & 1 deletion res/skins/Deere/style.qss
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,6 @@ WNumber, WNumberPos,
WPushButton,
WKey,
WTime,
WTrackText,
WTrackProperty,
WRecordingDuration,
QSpinBox,
Expand Down
2 changes: 0 additions & 2 deletions res/skins/LateNight/decks/overview.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
<Mark>
<Control>intro_start_position</Control>
<VisibilityControl>[Skin],show_intro_outro_cues</VisibilityControl>
<Text></Text>
<Align>top|right</Align>
<Color><Variable name="IntroOutroColor"/></Color>
<TextColor>#FFFFFF</TextColor>
Expand Down Expand Up @@ -112,7 +111,6 @@
<Mark>
<Control>outro_end_position</Control>
<VisibilityControl>[Skin],show_intro_outro_cues</VisibilityControl>
<Text></Text>
<Align>top|left</Align>
<Color><Variable name="IntroOutroColor"/></Color>
<TextColor>#FFFFFF</TextColor>
Expand Down
1 change: 0 additions & 1 deletion res/skins/LateNight/skin_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ Description:
</State>
<State>
<Number>1</Number>
<Text></Text>
<Alignment>left</Alignment>
</State>
<Connection>
Expand Down
1 change: 0 additions & 1 deletion res/skins/LateNight/style.qss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ WNumber, WNumberPos,
WPushButton,
WKey,
WTime,
WTrackText,
WTrackProperty,
WRecordingDuration,
QSpinBox,
Expand Down
2 changes: 0 additions & 2 deletions res/skins/Shade/deck_overview.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
<Mark>
<Control>intro_start_position</Control>
<VisibilityControl>[Skin],show_intro_outro_cues</VisibilityControl>
<Text></Text>
<Align>top|right</Align>
<Color>#0000FF</Color>
<TextColor>#FFFFFF</TextColor>
Expand Down Expand Up @@ -84,7 +83,6 @@
<Mark>
<Control>outro_end_position</Control>
<VisibilityControl>[Skin],show_intro_outro_cues</VisibilityControl>
<Text></Text>
<Align>top|left</Align>
<Color>#0000FF</Color>
<TextColor>#FFFFFF</TextColor>
Expand Down
4 changes: 2 additions & 2 deletions res/skins/Shade/preview_deck.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<Size>0e,18f</Size>
<Layout>horizontal</Layout>
<Children>
<Text>
<TrackProperty>
<TooltipId>text</TooltipId>
<Style> QLabel {
font-size: 12px;
Expand All @@ -55,7 +55,7 @@
<Group>[PreviewDeck1]</Group>
<SizePolicy>me,min</SizePolicy>
<Elide>right</Elide>
</Text>
</TrackProperty>
</Children>
</WidgetGroup>
<WidgetGroup>
Expand Down
4 changes: 2 additions & 2 deletions res/skins/Shade/sampler.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<BackPath>style/style_bg_sampler_top.png</BackPath>
<Layout>horizontal</Layout>
<Children>
<Text>
<TrackProperty>
<TooltipId>text</TooltipId>
<Style>QLabel {
font-size: 12px;
Expand All @@ -35,7 +35,7 @@
<Group><Variable name="group"/></Group>
<SizePolicy>me,max</SizePolicy>
<Elide>right</Elide>
</Text>
</TrackProperty>
<!-- Alternative "TITLE ONLY" display
<TrackProperty>
<TooltipId>track_title</TooltipId>
Expand Down
4 changes: 2 additions & 2 deletions res/skins/Shade/samplersmall.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<Pos>0,2</Pos>
<Layout>vertical</Layout>
<Children>
<Text>
<TrackProperty>
<Size>0e,40f</Size>
<TooltipId>text</TooltipId>
<Style>QLabel {
Expand All @@ -66,7 +66,7 @@
</Style>
<Group>[Sampler<Variable name="samplernum"/>]</Group>
<Elide>right</Elide>
</Text>
</TrackProperty>
<!-- Alternative "TITLE ONLY" display
<TrackProperty>
<TooltipId>track_title</TooltipId>
Expand Down
1 change: 0 additions & 1 deletion res/skins/Shade/style.qss
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ WPushButton,
#LibraryFeatureControls QRadioButton,
WRecordingDuration,
WTime,
WTrackText,
WTrackProperty,
QSpinBox,
WBeatSpinBox,
Expand Down
2 changes: 0 additions & 2 deletions res/skins/Tango/decks/overview.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ Variables:
<Mark>
<Control>intro_start_position</Control>
<VisibilityControl>[Skin],show_intro_outro_cues</VisibilityControl>
<Text></Text>
<Align>top|right</Align>
<Color>#0000FF</Color>
<TextColor>#FFFFFF</TextColor>
Expand Down Expand Up @@ -114,7 +113,6 @@ Variables:
<Mark>
<Control>outro_end_position</Control>
<VisibilityControl>[Skin],show_intro_outro_cues</VisibilityControl>
<Text></Text>
<Align>top|left</Align>
<Color>#0000FF</Color>
<TextColor>#FFFFFF</TextColor>
Expand Down
4 changes: 2 additions & 2 deletions res/skins/Tango/decks/preview_deck.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ Variables:
<Size>1me,18f</Size>
<ObjectName>PreviewTitle</ObjectName>
<Children>
<Text>
<TrackProperty>
<TooltipId>text</TooltipId>
<Size>1me,17f</Size>
<Group><Variable name="group"/></Group>
<Elide>right</Elide>
</Text>
</TrackProperty>
</Children>
</WidgetGroup>

Expand Down
1 change: 0 additions & 1 deletion res/skins/Tango/style.qss
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ WNumber, WNumberPos,
WPushButton,
WKey,
WTime,
WTrackText,
WTrackProperty,
WRecordingDuration,
QSpinBox,
Expand Down
32 changes: 6 additions & 26 deletions src/skin/legacy/legacyskinparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
#include "widget/wstatuslight.h"
#include "widget/wtime.h"
#include "widget/wtrackproperty.h"
#include "widget/wtracktext.h"
#include "widget/wtrackwidgetgroup.h"
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include "widget/wvumeter.h"
Expand Down Expand Up @@ -1062,32 +1061,13 @@ QWidget* LegacySkinParser::parseVisual(const QDomElement& node) {

QWidget* LegacySkinParser::parseText(const QDomElement& node) {
QString group = lookupNodeGroup(node);
BaseTrackPlayer* pPlayer = m_pPlayerManager->getPlayer(group);
if (!pPlayer) {
SKIN_WARNING(node, *m_pContext, QStringLiteral("No player found for group:").arg(group));
return nullptr;
}

WTrackText* pTrackText = new WTrackText(m_pParent,
m_pConfig,
m_pLibrary,
group);
setupLabelWidget(node, pTrackText);

connect(pPlayer, &BaseTrackPlayer::newTrackLoaded, pTrackText, &WTrackText::slotTrackLoaded);
connect(pPlayer, &BaseTrackPlayer::loadingTrack, pTrackText, &WTrackText::slotLoadingTrack);
connect(pTrackText,
&WTrackText::trackDropped,
m_pPlayerManager,
&PlayerManager::slotLoadLocationToPlayerMaybePlay);
connect(pTrackText, &WTrackText::cloneDeck, m_pPlayerManager, &PlayerManager::slotCloneDeck);

TrackPointer pTrack = pPlayer->getLoadedTrack();
if (pTrack) {
pTrackText->slotTrackLoaded(pTrack);
if (group.isEmpty()) {
// use WLabel, try to parse 'Text' node
return parseLabelWidget<WLabel>(node);
} else {
// use WTrackProperty to show a track tag / file name
return parseTrackProperty(node);
}

return pTrackText;
}

QWidget* LegacySkinParser::parseTrackProperty(const QDomElement& node) {
Expand Down
26 changes: 18 additions & 8 deletions src/widget/wtrackproperty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,17 @@ WTrackProperty::~WTrackProperty() {
void WTrackProperty::setup(const QDomNode& node, const SkinContext& context) {
WLabel::setup(node, context);

m_property = context.selectString(node, "Property");
QString property = context.selectString(node, "Property");
if (property.isEmpty()) {
return;
}

// Check if property with that name exists in Track class
if (Track::staticMetaObject.indexOfProperty(m_property.toUtf8().constData()) == -1) {
qWarning() << "WTrackProperty: Unknown track property:" << m_property;
if (Track::staticMetaObject.indexOfProperty(property.toUtf8().constData()) == -1) {
qWarning() << "WTrackProperty: Unknown track property:" << property;
return;
}
m_property = property;
}

void WTrackProperty::slotTrackLoaded(TrackPointer pTrack) {
Expand Down Expand Up @@ -82,7 +87,11 @@ void WTrackProperty::slotTrackChanged(TrackId trackId) {

void WTrackProperty::updateLabel() {
if (m_pCurrentTrack) {
QVariant property = m_pCurrentTrack->property(m_property.toUtf8().constData());
if (m_property.isEmpty()) {
return;
}
QVariant property =
m_pCurrentTrack->property(m_property.toUtf8().constData());
if (property.isValid() && property.canConvert<QString>()) {
setText(property.toString());
return;
Expand All @@ -99,11 +108,12 @@ void WTrackProperty::mouseMoveEvent(QMouseEvent* event) {

void WTrackProperty::mouseDoubleClickEvent(QMouseEvent* event) {
Q_UNUSED(event);
if (m_pCurrentTrack) {
ensureTrackMenuIsCreated();
m_pTrackMenu->loadTrack(m_pCurrentTrack, m_group);
m_pTrackMenu->showDlgTrackInfo(m_property);
if (!m_pCurrentTrack) {
return;
}
ensureTrackMenuIsCreated();
m_pTrackMenu->loadTrack(m_pCurrentTrack, m_group);
m_pTrackMenu->showDlgTrackInfo(m_property);
}

void WTrackProperty::dragEnterEvent(QDragEnterEvent* event) {
Expand Down
10 changes: 4 additions & 6 deletions src/widget/wtrackproperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,12 @@ class WTrackProperty : public WLabel, public TrackDropTarget {

protected:
void contextMenuEvent(QContextMenuEvent* event) override;

private slots:
void slotTrackChanged(TrackId);

private:
void dragEnterEvent(QDragEnterEvent* event) override;
void dropEvent(QDropEvent* event) override;
void mouseMoveEvent(QMouseEvent* event) override;
void mouseDoubleClickEvent(QMouseEvent* event) override;

void updateLabel();
virtual void updateLabel();

void ensureTrackMenuIsCreated();

Expand All @@ -53,4 +48,7 @@ class WTrackProperty : public WLabel, public TrackDropTarget {
QString m_property;

parented_ptr<WTrackMenu> m_pTrackMenu;

private slots:
void slotTrackChanged(TrackId);
};