Skip to content

Commit

Permalink
Make hotcue skin buttons use the cue color
Browse files Browse the repository at this point in the history
Shade still does not work
  • Loading branch information
ferranpujolcamins committed Nov 11, 2019
1 parent 1bc6c77 commit fc22b25
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 285 deletions.
2 changes: 1 addition & 1 deletion res/skins/Deere/hotcue_button.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</Connection>
<Connection>
<ConfigKey><Variable name="group"/>,hotcue_<Variable name="hotcue"/>_color</ConfigKey>
<BindProperty>highlight</BindProperty>
<BindProperty>backgroundColorRgba</BindProperty>
</Connection>
</PushButton>
</Template>
124 changes: 0 additions & 124 deletions res/skins/Deere/style.qss
Original file line number Diff line number Diff line change
Expand Up @@ -1596,130 +1596,6 @@ WPushButton[value="2"]:hover {
border: 0px solid #0080BE;
}

/* Hotcue Color: No Color */
#HotcueButton[value="1"][highlight="0"],
#HotcueButton[value="2"][highlight="0"] {
background-color: #006596;
}

#HotcueButton[value="1"][highlight="0"]:hover,
#HotcueButton[value="2"][highlight="0"]:hover {
background-color: #0080BE;
}

/* Hotcue Color: Red */
#HotcueButton[value="1"][highlight="1"],
#HotcueButton[value="2"][highlight="1"] {
background-color: #c50a08;
}

#HotcueButton[value="1"][highlight="1"]:hover,
#HotcueButton[value="2"][highlight="1"]:hover {
background-color: #e50c08;
}

/* Hotcue Color: Green */
#HotcueButton[value="1"][highlight="2"],
#HotcueButton[value="2"][highlight="2"] {
background-color: #32be44;
}

#HotcueButton[value="1"][highlight="2"]:hover,
#HotcueButton[value="2"][highlight="2"]:hover {
background-color: #52de64;
}

/* Hotcue Color: Blue */
#HotcueButton[value="1"][highlight="3"],
#HotcueButton[value="2"][highlight="3"] {
background-color: #0044ff;
}

#HotcueButton[value="1"][highlight="3"]:hover,
#HotcueButton[value="2"][highlight="3"]:hover {
background-color: #0064ff;
}

/* Hotcue Color: Yellow */
#HotcueButton[value="1"][highlight="4"],
#HotcueButton[value="2"][highlight="4"] {
color: #4B4B4B;
background-color: #f8d200;
}

#HotcueButton[value="1"][highlight="4"]:hover,
#HotcueButton[value="2"][highlight="4"]:hover {
color: #4B4B4B;
background-color: #f8f200;
}

/* Hotcue Color: Celeste */
#HotcueButton[value="1"][highlight="5"],
#HotcueButton[value="2"][highlight="5"] {
color: #4B4B4B;
background-color: #42d4f4;
}

#HotcueButton[value="1"][highlight="5"]:hover,
#HotcueButton[value="2"][highlight="5"]:hover {
color: #4B4B4B;
background-color: #62f4f4;
}

/* Hotcue Color: Purple */
#HotcueButton[value="1"][highlight="6"],
#HotcueButton[value="2"][highlight="6"] {
background-color: #af00cc;
}

#HotcueButton[value="1"][highlight="6"]:hover,
#HotcueButton[value="2"][highlight="6"]:hover {
background-color: #cf00ec;
}

/* Hotcue Color: Pink */
#HotcueButton[value="1"][highlight="7"],
#HotcueButton[value="2"][highlight="7"] {
color: #4B4B4B;
background-color: #fca6d7;
}

#HotcueButton[value="1"][highlight="7"]:hover,
#HotcueButton[value="2"][highlight="7"]:hover {
color: #4B4B4B;
background-color: #fcc6f7;
}

/* Hotcue Color: White */
#HotcueButton[value="1"][highlight="8"],
#HotcueButton[value="2"][highlight="8"] {
color: #4B4B4B;
background-color: #f2f2ff;
}

#HotcueButton[value="1"][highlight="8"]:hover,
#HotcueButton[value="2"][highlight="8"]:hover {
color: #4B4B4B;
background-color: #ffffff;
}

/*"Enabled" state, e.g. for recording status
0 -- disconnected / off
1 -- connecting / enabling
2 -- connected / enabled
WPushButton[value="2"] {
color: #FDFDFD;
background-color: #4B4B4B;
border: 0px solid #006596;
}

WPushButton[value="2"]:hover {
color: #FDFDFD;
background-color: #4B4B4B;
border: 0px solid #0080BE;
}
*/

#PlayToggle[value="0"] {
image: url(skin:/icon/ic_play_48px.svg) no-repeat center center;
}
Expand Down
2 changes: 1 addition & 1 deletion res/skins/LateNight/button_hotcue.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</Connection>
<Connection>
<ConfigKey><Variable name="group"/>,hotcue_<Variable name="number"/>_color</ConfigKey>
<BindProperty>highlight</BindProperty>
<BindProperty>backgroundColorRgba</BindProperty>
</Connection>
</PushButton>
</Template>
44 changes: 0 additions & 44 deletions res/skins/LateNight/style.qss
Original file line number Diff line number Diff line change
Expand Up @@ -356,50 +356,6 @@ QHeaderView::down-arrow {
#SpecialCueButton[displayValue="1"] {
background-color: #0000D4;
}
/* Hotcue Color: Red
this is also the default color if Auto-Color
in Preferences > Decks is Off */
#HotcueButton[displayValue="1"][highlight="0"],
#HotcueButton[displayValue="2"][highlight="0"],
#HotcueButton[displayValue="1"][highlight="1"],
#HotcueButton[displayValue="2"][highlight="1"] {
background-color: #db0000;
}
/* Hotcue Color: Green */
#HotcueButton[displayValue="1"][highlight="2"],
#HotcueButton[displayValue="2"][highlight="2"] {
background-color: #32be44;
}
/* Hotcue Color: Blue */
#HotcueButton[displayValue="1"][highlight="3"],
#HotcueButton[displayValue="2"][highlight="3"] {
background-color: #0044ff;
}
/* Hotcue Color: Yellow */
#HotcueButton[displayValue="1"][highlight="4"],
#HotcueButton[displayValue="2"][highlight="4"] {
background-color: #f8d200;
}
/* Hotcue Color: Celeste */
#HotcueButton[displayValue="1"][highlight="5"],
#HotcueButton[displayValue="2"][highlight="5"] {
background-color: #42d4f4;
}
/* Hotcue Color: Purple */
#HotcueButton[displayValue="1"][highlight="6"],
#HotcueButton[displayValue="2"][highlight="6"] {
background-color: #af00cc;
}
/* Hotcue Color: Pink */
#HotcueButton[displayValue="1"][highlight="7"],
#HotcueButton[displayValue="2"][highlight="7"] {
background-color: #fca6d7;
}
/* Hotcue Color: White */
#HotcueButton[displayValue="1"][highlight="8"],
#HotcueButton[displayValue="2"][highlight="8"] {
background-color: #f2f2ff;
}

#BeatgridButtonsToggle {
image: url(skin:/buttons/btn_beatgrid_buttons_toggle.svg) no-repeat center center;
Expand Down
2 changes: 1 addition & 1 deletion res/skins/Shade/deck_hotcue_button.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</Connection>
<Connection>
<ConfigKey>[Channel<Variable name="channum"/>],hotcue_<Variable name="hotcue"/>_color</ConfigKey>
<BindProperty>highlight</BindProperty>
<BindProperty>backgroundColorRgba</BindProperty>
</Connection>
</PushButton>
</Template>
45 changes: 0 additions & 45 deletions res/skins/Shade/style.qss
Original file line number Diff line number Diff line change
Expand Up @@ -552,48 +552,3 @@ QPushButton#pushButtonRepeatPlaylist {
image: url(skin:/btn/btn_autodj_repeat_playlist.svg) no-repeat center center;
}
/* AutoDJ button icons */

/* Hotcue Color: No Color */
#HotcueButton[highlight="0"] {
background-color: #fd0564;
}

/* Hotcue Color: Red */
#HotcueButton[highlight="1"] {
background-color: #c50a08;
}

/* Hotcue Color: Green */
#HotcueButton[highlight="2"] {
background-color: #32be44;
}

/* Hotcue Color: Blue */
#HotcueButton[highlight="3"] {
background-color: #0044ff;
}

/* Hotcue Color: Yellow */
#HotcueButton[highlight="4"] {
background-color: #f8d200;
}

/* Hotcue Color: Celeste */
#HotcueButton[highlight="5"] {
background-color: #42d4f4;
}

/* Hotcue Color: Purple */
#HotcueButton[highlight="6"] {
background-color: #af00cc;
}

/* Hotcue Color: Pink */
#HotcueButton[highlight="7"] {
background-color: #fca6d7;
}

/* Hotcue Color: White */
#HotcueButton[highlight="8"] {
background-color: #f2f2ff;
}
5 changes: 0 additions & 5 deletions res/skins/Shade/style_dark.qss
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,3 @@ WLibrary QPushButton {
WLibrary QRadioButton::indicator:checked {
background: url(skin:/btn/btn_lib_radio_button_on_dark.svg) center center;
}

/* Hotcue Color: No Color */
#HotcueButton[highlight="0"] {
background-color: #b39a00;
}
5 changes: 0 additions & 5 deletions res/skins/Shade/style_summer_sunset.qss
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,3 @@ WLibrary QPushButton {
QPushButton#pushButtonAnalyze:hover {
border: 1px solid #52F904;
}

/* Hotcue Color: No Color */
#HotcueButton[highlight="0"] {
background-color: #52f904;
}
2 changes: 1 addition & 1 deletion res/skins/Tango/button_hotcue_deck.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Variables:
</Connection>
<Connection>
<ConfigKey><Variable name="group"/>,hotcue_<Variable name="HotCue"/>_color</ConfigKey>
<BindProperty>highlight</BindProperty>
<BindProperty>backgroundColorRgba</BindProperty>
</Connection>
</PushButton>
</Template>
58 changes: 0 additions & 58 deletions res/skins/Tango/style.qss
Original file line number Diff line number Diff line change
Expand Up @@ -985,64 +985,6 @@ WLabel#TrackComment {
border: 1px solid #eeeeee;
}

/* Hotcue Color: No Color */
#HotcueButton[displayValue="1"][highlight="0"],
#HotcueButton[displayValue="2"][highlight="0"] {
background-color: #666;
}

/* Hotcue Color: Red */
#HotcueButton[displayValue="1"][highlight="1"],
#HotcueButton[displayValue="2"][highlight="1"] {
background-color: #c50a08;
}

/* Hotcue Color: Green */
#HotcueButton[displayValue="1"][highlight="2"],
#HotcueButton[displayValue="2"][highlight="2"] {
background-color: #32be44;
}

/* Hotcue Color: Blue */
#HotcueButton[displayValue="1"][highlight="3"],
#HotcueButton[displayValue="2"][highlight="3"] {
background-color: #0044ff;
}

/* Hotcue Color: Yellow */
#HotcueButton[displayValue="1"][highlight="4"],
#HotcueButton[displayValue="2"][highlight="4"] {
color: #333;
background-color: #f8d200;
}

/* Hotcue Color: Celeste */
#HotcueButton[displayValue="1"][highlight="5"],
#HotcueButton[displayValue="2"][highlight="5"] {
color: #333;
background-color: #42d4f4;
}

/* Hotcue Color: Purple */
#HotcueButton[displayValue="1"][highlight="6"],
#HotcueButton[displayValue="2"][highlight="6"] {
background-color: #af00cc;
}

/* Hotcue Color: Pink */
#HotcueButton[displayValue="1"][highlight="7"],
#HotcueButton[displayValue="2"][highlight="7"] {
color: #333;
background-color: #fca6d7;
}

/* Hotcue Color: White */
#HotcueButton[displayValue="1"][highlight="8"],
#HotcueButton[displayValue="2"][highlight="8"] {
color: #333;
background-color: #f2f2ff;
}

#CueButton {
/* is styled like #HotcueButton, lights up if play position
is at main Cue point */
Expand Down
24 changes: 24 additions & 0 deletions src/widget/wwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,30 @@ WWidget::~WWidget() {
delete m_pTouchShift;
}

double WWidget::getBackgroundColorRgba() const {
if (m_backgroundColorRgba >= 0) {
return m_backgroundColorRgba;
}
return -1;
}

void WWidget::setBackgroundColorRgba(double rgba) {
QColor backgroundColor = QColor::fromRgba(rgba);
QColor textColor = Color::chooseColorByBrightness(
backgroundColor, Qt::white, Qt::black);

QString style =
"background-color: %1;"
"color: %2;";

if (rgba >= 0) {
setStyleSheet(style.arg(backgroundColor.name()).arg(textColor.name()));
} else {
setStyleSheet("");
}
m_backgroundColorRgba = rgba;
}

bool WWidget::touchIsRightButton() {
return (m_pTouchShift->get() != 0.0);
}
Expand Down
Loading

0 comments on commit fc22b25

Please sign in to comment.