Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotcue Buttons, Context Menu + Skin Improvements. #2560

Merged
merged 12 commits into from
Mar 24, 2020
Merged
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,7 @@ add_library(mixxx-lib STATIC EXCLUDE_FROM_ALL
src/widget/weffectparameterknobcomposed.cpp
src/widget/weffectpushbutton.cpp
src/widget/weffectselector.cpp
src/widget/whotcuebutton.cpp
src/widget/wimagestore.cpp
src/widget/wkey.cpp
src/widget/wknob.cpp
Expand Down
1 change: 1 addition & 0 deletions build/depends.py
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,7 @@ def sources(self, build):
"src/widget/wvumeter.cpp",
"src/widget/wpushbutton.cpp",
"src/widget/weffectpushbutton.cpp",
"src/widget/whotcuebutton.cpp",
"src/widget/wslidercomposed.cpp",
"src/widget/wstatuslight.cpp",
"src/widget/woverview.cpp",
Expand Down
33 changes: 5 additions & 28 deletions res/skins/Deere/hotcue_button.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,46 +8,23 @@
SmallSquareButtonSize: the button size
-->
<Template>
<PushButton>
<HotcueButton>
<TooltipId>hotcue</TooltipId>
<ObjectName>HotcueButton</ObjectName>
<MinimumSize>18,22</MinimumSize>
<MaximumSize>22,22</MaximumSize>
<SizePolicy>me,f</SizePolicy>
<Group><Variable name="group"/></Group>
<Hotcue><Variable name="hotcue"/></Hotcue>
<Hover>true</Hover>
<NumberStates>2</NumberStates>
<LeftClickIsPushButton><Variable name="LeftClickIsPushButton"/></LeftClickIsPushButton>
<RightClickIsPushButton><Variable name="RightClickIsPushButton"/></RightClickIsPushButton>
<State>
<Number>0</Number>
<Text><Variable name="hotcue"/></Text>
<Pressed scalemode="STRETCH_ASPECT"></Pressed>
<Unpressed scalemode="STRETCH_ASPECT"></Unpressed>
</State>
<State>
<Number>1</Number>
<Text><Variable name="hotcue"/></Text>
<Pressed scalemode="STRETCH_ASPECT"></Pressed>
<Unpressed scalemode="STRETCH_ASPECT"></Unpressed>
</State>
<Connection>
<ConfigKey><Variable name="group"/>,hotcue_<Variable name="hotcue"/>_activate</ConfigKey>
<EmitOnPressAndRelease>true</EmitOnPressAndRelease>
<ButtonState>LeftButton</ButtonState>
<ConnectValueToWidget>false</ConnectValueToWidget>
</Connection>
<Connection>
<ConfigKey><Variable name="group"/>,hotcue_<Variable name="hotcue"/>_clear</ConfigKey>
<EmitOnPressAndRelease>true</EmitOnPressAndRelease>
<ButtonState>RightButton</ButtonState>
<ConnectValueToWidget>false</ConnectValueToWidget>
</Connection>
<Connection>
<ConfigKey><Variable name="group"/>,hotcue_<Variable name="hotcue"/>_enabled</ConfigKey>
<ConnectValueFromWidget>false</ConnectValueFromWidget>
</Connection>
<Connection>
<ConfigKey><Variable name="group"/>,hotcue_<Variable name="hotcue"/>_color</ConfigKey>
<BindProperty>backgroundColorRgba</BindProperty>
</Connection>
</PushButton>
</HotcueButton>
</Template>
10 changes: 1 addition & 9 deletions res/skins/Deere/style.qss
Original file line number Diff line number Diff line change
Expand Up @@ -1558,15 +1558,7 @@ WPushButton[value="2"]:hover {
border: 1px solid #0080BE;
}

#HotcueButton {
qproperty-shouldHighlightBackgroundOnHover: true;
}

#HotcueButton[backgroundIsDark=true][hasBackgroundColor=true] {
color: #FDFDFD;
}

#HotcueButton[backgroundIsDark=false][hasBackgroundColor=true] {
#HotcueButton[light="true"] {
color: #1f1e1e;
}

Expand Down
22 changes: 4 additions & 18 deletions res/skins/LateNight/button_hotcue.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
<SizePolicy>me,f</SizePolicy>
<Layout>horizontal</Layout>
<Children>
<PushButton>
<HotcueButton>
<TooltipId>hotcue</TooltipId>
<ObjectName>HotcueButton</ObjectName>
<MinimumSize>26,26</MinimumSize>
<MaximumSize>26,26</MaximumSize>
<SizePolicy>me,f</SizePolicy>
<Group><Variable name="group"/></Group>
<Hotcue><Variable name="number"/></Hotcue>
<NumberStates>2</NumberStates>
<State>
<Number>0</Number>
Expand All @@ -24,23 +26,7 @@
<Unpressed scalemode="STRETCH">skin:/buttons_<Variable name="btn_scheme"/>/btn_<Variable name="btn_type"/>_square_set.svg</Unpressed>
<Pressed scalemode="STRETCH">skin:/buttons_<Variable name="btn_scheme"/>/btn_<Variable name="btn_type"/>_square_active.svg</Pressed>
</State>
<Connection>
<ConfigKey><Variable name="group"/>,hotcue_<Variable name="number"/>_activate</ConfigKey>
<ButtonState>LeftButton</ButtonState>
</Connection>
<Connection>
<ConfigKey><Variable name="group"/>,hotcue_<Variable name="number"/>_clear</ConfigKey>
<ButtonState>RightButton</ButtonState>
</Connection>
<Connection>
<ConfigKey><Variable name="group"/>,hotcue_<Variable name="number"/>_enabled</ConfigKey>
<ConnectValueFromWidget>false</ConnectValueFromWidget>
</Connection>
<Connection>
<ConfigKey><Variable name="group"/>,hotcue_<Variable name="number"/>_color</ConfigKey>
<BindProperty>backgroundColorRgba</BindProperty>
</Connection>
</PushButton>
</HotcueButton>
</Children>
</WidgetGroup>
</Template>
11 changes: 3 additions & 8 deletions res/skins/LateNight/style.qss
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ QPushButton#pushButtonAutoDJ:enabled:!checked,
brighter bg color to enhance contrast in darker containers
and with small size respectively */
#DeckRow_5_LoopCuesTransport WPushButton[value="0"],
#HotcueButton[displayValue="0"],
#HotcueButton,
#FxAssignButton[displayValue="0"], #FxFocusButton[displayValue="0"],
#FxToggleButton[displayValue="0"], #FxParameterButton[displayValue="0"],
#SplitCueButton[value="0"],
Expand Down Expand Up @@ -684,13 +684,8 @@ QPushButton#pushButtonRecording:checked,
#RecFeedback[displayValue="2"],
#BeatgridButtons WPushButton[value="1"],
#KeyMatchButton[displayValue="1"],
#KeyUpButton[displayValue="1"], #KeyDownButton[displayValue="1"],
#HotcueButton[displayValue="1"][highlight="0"],
#HotcueButton[displayValue="2"][highlight="0"],
#HotcueButton[displayValue="1"][highlight="1"],
#HotcueButton[displayValue="2"][highlight="1"] {
background-color: #db0000;
}
#KeyUpButton[displayValue="1"],
#KeyDownButton[displayValue="1"],
ronso0 marked this conversation as resolved.
Show resolved Hide resolved

ronso0 marked this conversation as resolved.
Show resolved Hide resolved
#BroadcastButton[displayValue="3"] {
/* pink */
Expand Down
4 changes: 2 additions & 2 deletions res/skins/LateNight/style_flip.qss
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ WSearchLineEdit {
#GuiToggleButton[displayValue="0"], #RecFeedback[displayValue="0"],
#BroadcastButton[displayValue="0"], #SettingsButton[displayValue="0"],
#DeckRow_5_LoopCuesTransport WPushButton[value="0"],
#HotcueButton[displayValue="0"],
#HotcueButton,
#FxAssignButton[displayValue="0"], #FxFocusButton[displayValue="0"],
#FxToggleButton[displayValue="0"], #FxParameterButton[displayValue="0"],
#SplitCueButton[value="0"],
Expand Down Expand Up @@ -909,7 +909,7 @@ WEffectSelector {
WLibrary,
#SidebarBox {
/* only 1px padding to compensate the 2px border of inner widgets
(QTreeView, QTableView, QTextBrowser) */
(QTreeView, QTableView, QTextBrowser) */
padding: 1px 1px 0px 1px;
border-bottom: 0px;
border-left: 1px solid qlineargradient(
Expand Down
Binary file modified res/skins/Shade/btn/btn_hotcue_1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/skins/Shade/btn/btn_hotcue_1_over.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/skins/Shade/btn/btn_hotcue_1_overdown.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/skins/Shade/btn/btn_hotcue_2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/skins/Shade/btn/btn_hotcue_2_over.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/skins/Shade/btn/btn_hotcue_2_overdown.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/skins/Shade/btn/btn_hotcue_3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/skins/Shade/btn/btn_hotcue_3_over.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/skins/Shade/btn/btn_hotcue_3_overdown.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/skins/Shade/btn/btn_hotcue_4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/skins/Shade/btn/btn_hotcue_4_over.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/skins/Shade/btn/btn_hotcue_4_overdown.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/skins/Shade/btn/btn_hotcue_5.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/skins/Shade/btn/btn_hotcue_5_over.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/skins/Shade/btn/btn_hotcue_5_overdown.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/skins/Shade/btn/btn_hotcue_6.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/skins/Shade/btn/btn_hotcue_6_over.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/skins/Shade/btn/btn_hotcue_6_overdown.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/skins/Shade/btn/btn_hotcue_7.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/skins/Shade/btn/btn_hotcue_7_over.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/skins/Shade/btn/btn_hotcue_7_overdown.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/skins/Shade/btn/btn_hotcue_8.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/skins/Shade/btn/btn_hotcue_8_over.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/skins/Shade/btn/btn_hotcue_8_overdown.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 6 additions & 20 deletions res/skins/Shade/hotcue_button.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<Template>
<PushButton>
<HotcueButton>
<TooltipId>hotcue</TooltipId>
<ObjectName>HotcueButton</ObjectName>
<Pos><Variable name="pos"/></Pos>
<Group><Variable name="group"/></Group>
<Hotcue><Variable name="hotcue"/></Hotcue>
<NumberStates>2</NumberStates>
<State>
<Number>0</Number>
Expand All @@ -11,24 +13,8 @@
</State>
<State>
<Number>1</Number>
<Pressed>skin:/btn/btn_hotcue_<Variable name="hotcue"/>.png</Pressed>
<Unpressed>skin:/btn/btn_hotcue_<Variable name="hotcue"/>.png</Unpressed>
<Pressed>skin:/btn/btn_hotcue_<Variable name="hotcue"/>_overdown.png</Pressed>
<Unpressed>skin:/btn/btn_hotcue_<Variable name="hotcue"/>_over.png</Unpressed>
</State>
<Connection>
<ConfigKey><Variable name="group"/>,hotcue_<Variable name="hotcue"/>_activate</ConfigKey>
<ButtonState>LeftButton</ButtonState>
</Connection>
<Connection>
<ConfigKey><Variable name="group"/>,hotcue_<Variable name="hotcue"/>_clear</ConfigKey>
<ButtonState>RightButton</ButtonState>
</Connection>
<Connection>
<ConfigKey><Variable name="group"/>,hotcue_<Variable name="hotcue"/>_enabled</ConfigKey>
<ConnectValueFromWidget>false</ConnectValueFromWidget>
</Connection>
<Connection>
<ConfigKey><Variable name="group"/>,hotcue_<Variable name="hotcue"/>_color</ConfigKey>
<BindProperty>backgroundColorRgba</BindProperty>
</Connection>
</PushButton>
</HotcueButton>
</Template>
22 changes: 4 additions & 18 deletions res/skins/Tango/button_hotcue_deck.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ Variables:
HotCue: hotcue number
-->
<Template>
<PushButton>
<HotcueButton>
<TooltipId>hotcue</TooltipId>
<ObjectName>HotcueButton</ObjectName>
<MinimumSize>15,24</MinimumSize>
<MaximumSize>23,24</MaximumSize>
<SizePolicy>me,f</SizePolicy>
<Group><Variable name="group"/></Group>
<Hotcue><Variable name="HotCue"/></Hotcue>
<NumberStates>2</NumberStates>
<State>
<Number>0</Number>
Expand All @@ -25,21 +27,5 @@ Variables:
<Text><Variable name="HotCue"/></Text>
<Alignment>center</Alignment>
</State>
<Connection>
<ConfigKey><Variable name="group"/>,hotcue_<Variable name="HotCue"/>_activate</ConfigKey>
<ButtonState>LeftButton</ButtonState>
</Connection>
<Connection>
<ConfigKey><Variable name="group"/>,hotcue_<Variable name="HotCue"/>_clear</ConfigKey>
<ButtonState>RightButton</ButtonState>
</Connection>
<Connection>
<ConfigKey><Variable name="group"/>,hotcue_<Variable name="HotCue"/>_enabled</ConfigKey>
<ConnectValueFromWidget>false</ConnectValueFromWidget>
</Connection>
<Connection>
<ConfigKey><Variable name="group"/>,hotcue_<Variable name="HotCue"/>_color</ConfigKey>
<BindProperty>backgroundColorRgba</BindProperty>
</Connection>
</PushButton>
</HotcueButton>
</Template>
18 changes: 4 additions & 14 deletions res/skins/Tango/button_hotcue_sam_pre.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ Variables:
HotCue: hotcue number
-->
<Template>
<PushButton>
<HotcueButton>
<TooltipId>hotcue</TooltipId>
<ObjectName>HotcueButton</ObjectName>
<MinimumSize>14,18</MinimumSize>
<MaximumSize>20,18</MaximumSize>
<SizePolicy>me,f</SizePolicy>
<Group><Variable name="group"/></Group>
<Hotcue><Variable name="HotCue"/></Hotcue>
<NumberStates>2</NumberStates>
<State>
<Number>0</Number>
Expand All @@ -26,17 +28,5 @@ Variables:
<Text><Variable name="HotCue"/></Text>
<Alignment>center</Alignment>
</State>
<Connection>
<ConfigKey><Variable name="group"/>,hotcue_<Variable name="HotCue"/>_activate</ConfigKey>
<ButtonState>LeftButton</ButtonState>
</Connection>
<Connection>
<ConfigKey><Variable name="group"/>,hotcue_<Variable name="HotCue"/>_clear</ConfigKey>
<ButtonState>RightButton</ButtonState>
</Connection>
<Connection>
<ConfigKey><Variable name="group"/>,hotcue_<Variable name="HotCue"/>_enabled</ConfigKey>
<ConnectValueFromWidget>false</ConnectValueFromWidget>
</Connection>
</PushButton>
</HotcueButton>
</Template>
8 changes: 4 additions & 4 deletions res/skins/Tango/style.qss
Original file line number Diff line number Diff line change
Expand Up @@ -1006,12 +1006,12 @@ WLabel#TrackComment {
border: 1px solid #eeeeee;
}

#HotcueButton[backgroundIsDark=true][hasBackgroundColor=true] {
color: #eeeeee;
#HotcueButton[light="true"] {
color: #0f0f0f;
}

#HotcueButton[backgroundIsDark=false][hasBackgroundColor=true] {
color: #0f0f0f;
#HotcueButton[light="true"]:hover {
border: 1px solid #0f0f0f;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this blends with the bg and makes the button shrink.
also, the distinction between light & dark should be shifted: dark is applied to default orange already.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually I think we could stick to the white border for all colors, except for white ;) where I'd use 50% grey for example

}

#CueButton {
Expand Down
7 changes: 2 additions & 5 deletions src/engine/controls/cuecontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ static const double CUE_MODE_NUMARK = 3.0;
static const double CUE_MODE_MIXXX_NO_BLINK = 4.0;
static const double CUE_MODE_CUP = 5.0;

constexpr double kNoColorControlValue = -1;

namespace {

// Helper function to convert control values (i.e. doubles) into RgbColor
Expand Down Expand Up @@ -335,7 +333,6 @@ void CueControl::detachCue(HotcueControl* pControl) {
}
disconnect(pCue.get(), 0, this, 0);
pControl->resetCue();
pControl->setColor(std::nullopt);
}

void CueControl::trackLoaded(TrackPointer pNewTrack) {
Expand Down Expand Up @@ -1769,7 +1766,7 @@ HotcueControl::HotcueControl(QString group, int i)

// The rgba value of the color assigned to this color.
m_hotcueColor = new ControlObject(keyForControl(i, "color"));
m_hotcueColor->set(kNoColorControlValue);
m_hotcueColor->set(QRgb(ColorPalette::kDefaultCueColor));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I'm still not really sure that this is a good idea. All other COs contain -1 when the hotcue is not set, and since it's possible to modify the CO value via developer mode we need range checks anyway IMHO.

connect(m_hotcueColor,
&ControlObject::valueChanged,
this,
Expand Down Expand Up @@ -1892,7 +1889,7 @@ void HotcueControl::setColor(mixxx::RgbColor::optional_t newColor) {
if (newColor) {
m_hotcueColor->set(*newColor);
} else {
m_hotcueColor->set(kNoColorControlValue);
m_hotcueColor->set(QRgb(ColorPalette::kDefaultCueColor));
}
}
void HotcueControl::resetCue() {
Expand Down