Skip to content

Commit

Permalink
Merge pull request #13215 from acolombier/feat/cuepopup
Browse files Browse the repository at this point in the history
feat: add type toggle to cue popup
  • Loading branch information
ronso0 committed May 23, 2024
2 parents 94805b1 + e7dcd1c commit ebd51e1
Show file tree
Hide file tree
Showing 18 changed files with 319 additions and 68 deletions.
18 changes: 17 additions & 1 deletion res/skins/Deere/style.qss
Original file line number Diff line number Diff line change
Expand Up @@ -2387,10 +2387,26 @@ WEffectChainPresetSelector::indicator:unchecked:selected,
outline: none;
}

#CueDeleteButton:hover {
#CueSavedLoopButton {
/* tall button, about the same height as cue number + label edit box */
width: 28px;
height: 46px;
/* make the icon slightly larger than default 16px */
qproperty-iconSize: 20px;
qproperty-icon: url(skin:/../Deere/icon/ic_loop_48px.svg);
background-color: #3B3B3B;
border-radius: 2px;
outline: none;
}

#CueDeleteButton:hover, #CueSavedLoopButton:hover {
background-color: #4B4B4B;
}

#CueSavedLoopButton:checked {
background-color: #006596;
}

WRateRange {
font-size: 10px;
}
Expand Down
23 changes: 15 additions & 8 deletions res/skins/LateNight/style_classic.qss
Original file line number Diff line number Diff line change
Expand Up @@ -1429,7 +1429,8 @@ QPushButton#pushButtonAutoDJ:enabled:!checked,
WPushButton#GuiToggleButton[displayValue="0"],
#RecFeedback[displayValue="0"],
WPushButton#BroadcastButton[displayValue="0"],
WPushButton#SkinSettingsToggle[displayValue="0"] {
WPushButton#SkinSettingsToggle[displayValue="0"],
WCueMenuPopup QPushButton {
background-color: #262626;
}

Expand Down Expand Up @@ -2053,20 +2054,26 @@ QPushButton#pushButtonRepeatPlaylist:!checked {
}

/* widgets in cue popup menu */
#CueDeleteButton { /*
padding: 3px 6px; */
qproperty-icon: url(skins:LateNight/classic/buttons/btn__delete.svg);
#CueDeleteButton,
#CueSavedLoopButton {
/* color buttons are 42x24 px.
To get the final size for the Delete button consider border width.
It's a tall button, about the same height as cue number + label edit box */
width: 24px;
height: 42px;
border-width: 2px;
border-image: url(skins:LateNight/classic/buttons/btn_embedded_library.svg) 2 2 2 2;
/* make the icon slightly larger than default 16px */
qproperty-iconSize: 20px;
/* has no effect
padding: 0px; */
}
#CueDeleteButton {
image: url(skins:LateNight/classic/buttons/btn__delete.svg);
}
#CueSavedLoopButton {
image: url(skins:LateNight/classic/buttons/btn__loop.svg);
}
#CueSavedLoopButton:pressed,
#CueSavedLoopButton:checked {
background-color: #db0000;
outline: none;
}

#CueLabelEdit {
Expand Down
38 changes: 28 additions & 10 deletions res/skins/LateNight/style_palemoon.qss
Original file line number Diff line number Diff line change
Expand Up @@ -1465,7 +1465,8 @@ WPushButton#FxAssignButton1[displayValue="0"],
WEffectSelector:!editable,
#fadeModeCombobox:!editable,
#LibraryFeatureControls QPushButton:enabled,
#CueDeleteButton {
#CueDeleteButton,
#CueSavedLoopButton {
outline: none;
border-width: 2px;
border-image: url(skins:LateNight/palemoon/buttons/btn_embedded_library.svg) 2 2 2 2;
Expand Down Expand Up @@ -1494,7 +1495,9 @@ WEffectSelector:!editable,
QPushButton#pushButtonRecording:checked,
WEffectSelector:!editable:on,
#fadeModeCombobox:!editable:on,
#CueDeleteButton[pressed="true"] {
#CueDeleteButton[pressed="true"],
#CueSavedLoopButton[pressed="true"],
#CueSavedLoopButton:checked {
border-width: 2px;
border-image: url(skins:LateNight/palemoon/buttons/btn_embedded_library_active.svg) 2 2 2 2;
}
Expand Down Expand Up @@ -1643,6 +1646,7 @@ WBeatSpinBox::down-button {
/* bright buttons in dimmed containers
#BeatgridControls WPushButton[displayValue="0"], */
#CueDeleteButton,
#CueSavedLoopButton,
#SplitCue[displayValue="0"],
#PlayPreview[displayValue="0"],
/* library controls */
Expand Down Expand Up @@ -1697,7 +1701,9 @@ WPushButton#LoopAnchor[pressed="true"],
#BeatjumpControls WPushButton[value="1"],
#RateControls WPushButton[value="1"],
#BeatgridControls WPushButton[pressed="true"]/*,
#CueDeleteButton[pressed="true"]*/ {
#CueDeleteButton[pressed="true"],
#CueSavedLoopButton[pressed="true"],
#CueSavedLoopButton:checked*/ {
background-color: #7d350d;
}

Expand Down Expand Up @@ -2512,20 +2518,32 @@ QPushButton#pushButtonRepeatPlaylist:!checked {
/* AutoDJ button icons */

/* widgets in cue popup menu */
WCueMenuPopup #CueDeleteButton {
qproperty-icon: url(skins:LateNight/palemoon/buttons/btn__delete.svg);
WCueMenuPopup #CueDeleteButton,
WCueMenuPopup #CueSavedLoopButton {
width: 24px;
height: 42px;
/* make the icon slightly larger than default 16px */
qproperty-iconSize: 20px;
}
WCueMenuPopup #CueDeleteButton {
/* Note: we can't use qproperty-icon here because it's evauated only once
and therefore won't style the checked state */
image: url(skins:LateNight/palemoon/buttons/btn__delete.svg);
}
WCueMenuPopup #CueDeleteButton:pressed {
background-color: #b24c12;
outline: none;
image: url(skins:LateNight/palemoon/buttons/btn__delete_active.svg);
}

WCueMenuPopup #CueDeleteButton:pressed {
WCueMenuPopup #CueSavedLoopButton {
image: url(skins:LateNight/palemoon/buttons/btn__loop.svg);
}
WCueMenuPopup #CueSavedLoopButton:pressed,
WCueMenuPopup #CueSavedLoopButton:checked {
background-color: #b24c12;
outline: none;
/* not applied: */
qproperty-icon: url(skins:LateNight/palemoon/buttons/btn__delete_active.svg);
image: url(skins:LateNight/palemoon/buttons/btn__loop_active.svg);
}

WCueMenuPopup #CueLabelEdit {
/*border: 1px solid #c2b3a5;*/
border-radius: 0px;
Expand Down
17 changes: 17 additions & 0 deletions res/skins/Shade/style.qss
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,23 @@ WCueMenuPopup QLabel {
qproperty-iconSize: 20px;
outline: none;
}
#CueSavedLoopButton {
/* set any border to allow styles for other properties as well */
border: 1px solid #060613;
/* To get the final size for the Delete button consider border width.
tall button, about the same height as cue number + label edit box */
width: 24px;
height: 43px;
padding: 0px;
background-color: #aab2b7;
qproperty-icon: url(skin:/btn/btn_hotcue_loop.png);
/* make the icon slightly larger than default 16px */
qproperty-iconSize: 20px;
outline: none;
}
#CueSavedLoopButton:pressed, #CueSavedLoopButton:checked {
background-color: #F90562;
}
#CueLabelEdit {
border: 1px solid #060613;
border-radius: 0px;
Expand Down
3 changes: 3 additions & 0 deletions res/skins/Shade/style_dark.qss
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ WEffectSelector::indicator:unchecked:selected,
#CueDeleteButton {
background-color: #8a8a8a;
}
#CueSavedLoopButton:pressed, #CueSavedLoopButton:checked {
background-color: #b79d00;
}
#CueLabelEdit {
background-color: #3F3041;
}
Expand Down
6 changes: 6 additions & 0 deletions res/skins/Shade/style_summer_sunset.qss
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ WEffectSelector::indicator:unchecked:selected,
#CueDeleteButton {
background-color: #cdbb5d;
}
#CueSavedLoopButton {
background-color: #cdbb5d;
}
#CueSavedLoopButton:pressed, #CueSavedLoopButton:checked {
background-color: #54fd05;
}
#CueLabelEdit {
background-color: #706633;
}
Expand Down
1 change: 1 addition & 0 deletions res/skins/Tango/buttons/btn_loop_beatjump_on_black.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 16 additions & 5 deletions res/skins/Tango/style.qss
Original file line number Diff line number Diff line change
Expand Up @@ -2465,7 +2465,8 @@ WTrackMenu QMenu QCheckBox::indicator {
}

/* widgets in cue popup menu */
#CueDeleteButton {
#CueDeleteButton,
#CueSavedLoopButton {
/* color buttons are 42x24 px.
To get the final size for the Delete button consider border width.
tall button, about the same height as cue number + label edit box */
Expand All @@ -2474,10 +2475,20 @@ WTrackMenu QMenu QCheckBox::indicator {
border: 1px solid #666;
background-color: #333;
border-radius: 2px;
qproperty-icon: url(skin:/../Tango/buttons/btn_delete.svg);
/* make the icon slightly larger than default 16px */
qproperty-iconSize: 20px;
}
}
#CueDeleteButton {
/* Note: we can't use qproperty-icon here because it's evauated only once
and therefore won't style the checked state */
image: url(skin:/../Tango/buttons/btn_delete.svg);
}
#CueSavedLoopButton:!checked {
image: url(skin:/../Tango/buttons/btn_loop_beatjump_off.svg);
}
#CueSavedLoopButton:checked {
border: 1px solid #666;
background-color: #ff7b00;
image: url(skin:/../Tango/buttons/btn_loop_beatjump_on_black.svg);
}
#CueLabelEdit {
border: 1px solid #ff6600;
border-radius: 0px;
Expand Down
2 changes: 1 addition & 1 deletion res/skins/default.qss
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ QPushButton#LibraryBPMButton:!checked {

/* Add default icons for cue menu buttons */
WCueMenuPopup #CueDeleteButton {
qproperty-icon: url(:/images/ic_delete.svg);
image: url(:/images/ic_delete.svg);
}

WColorPicker QPushButton[noColor="true"] {
Expand Down
5 changes: 5 additions & 0 deletions src/control/pollingcontrolproxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ class PollingControlProxy {
return m_pControl->defaultValue();
}

/// Return the key of the underlying control
const ConfigKey& getKey() const {
return m_pControl->getKey();
}

/// Sets the control value to v. Thread safe, non-blocking.
void set(double v) {
m_pControl->set(v, nullptr);
Expand Down
3 changes: 3 additions & 0 deletions src/waveform/renderers/waveformmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,11 @@ WaveformMark::WaveformMark(const QString& group,
m_showUntilNext{} {
QString positionControl;
QString endPositionControl;
QString typeControl;
if (hotCue != Cue::kNoHotCue) {
positionControl = "hotcue_" + QString::number(hotCue + 1) + "_position";
endPositionControl = "hotcue_" + QString::number(hotCue + 1) + "_endposition";
typeControl = "hotcue_" + QString::number(hotCue + 1) + "_type";
m_showUntilNext = true;
} else {
positionControl = context.selectString(node, "Control");
Expand All @@ -121,6 +123,7 @@ WaveformMark::WaveformMark(const QString& group,
}
if (!endPositionControl.isEmpty()) {
m_pEndPositionCO = std::make_unique<ControlProxy>(group, endPositionControl);
m_pTypeCO = std::make_unique<ControlProxy>(group, typeControl);
}

QString visibilityControl = context.selectString(node, "VisibilityControl");
Expand Down
14 changes: 11 additions & 3 deletions src/waveform/renderers/waveformmark.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,17 @@ class WaveformMark {
return m_pPositionCO->get();
}
double getSampleEndPosition() const {
if (m_pEndPositionCO) {
return m_pEndPositionCO->get();
if (!m_pEndPositionCO ||
// A hotcue may have an end position although it isn't a saved
// loop anymore. This happens when the user changes the cue
// type. However, we persist the end position if the user wants
// to restore the cue to a saved loop
(m_pTypeCO &&
static_cast<mixxx::CueType>(m_pTypeCO->get()) !=
mixxx::CueType::Loop)) {
return Cue::kNoPosition;
}
return Cue::kNoPosition;
return m_pEndPositionCO->get();
}
QString getItem() const {
return m_pPositionCO->getKey().item;
Expand Down Expand Up @@ -163,6 +170,7 @@ class WaveformMark {
private:
std::unique_ptr<ControlProxy> m_pPositionCO;
std::unique_ptr<ControlProxy> m_pEndPositionCO;
std::unique_ptr<ControlProxy> m_pTypeCO;
std::unique_ptr<ControlProxy> m_pVisibleCO;

std::unique_ptr<Graphics> m_pGraphics;
Expand Down
3 changes: 0 additions & 3 deletions src/widget/wcolorpicker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ WColorPicker::WColorPicker(Options options, const ColorPalette& palette, QWidget
QGridLayout* pLayout = new QGridLayout();
pLayout->setContentsMargins(0, 0, 0, 0);

pLayout->setSizeConstraint(QLayout::SetFixedSize);
setSizePolicy(QSizePolicy());

// Unfortunately, not all styles supported by Qt support setting a
// background color for QPushButtons (see
// https://bugreports.qt.io/browse/QTBUG-11089). For example, when using
Expand Down
Loading

0 comments on commit ebd51e1

Please sign in to comment.