From 1b31eebb7a69d9dc88566e9656d433ecfb452415 Mon Sep 17 00:00:00 2001 From: jonjamcam Date: Fri, 10 Apr 2020 19:20:50 -0400 Subject: [PATCH] upper voice chat button (#1255) * upper voice chat button * fixing voice chat colors Co-authored-by: jonjamcam --- src/Common/gui/LocalTrackGroupView.cpp | 22 +++++++++---------- src/Common/gui/LocalTrackGroupView.h | 2 +- src/resources/css/themes/Flat/LocalTrack.css | 4 ++-- .../css/themes/Game_nm/LocalTrack.css | 7 +++--- src/resources/css/themes/Ice/LocalTrack.css | 6 ++--- 5 files changed, 20 insertions(+), 21 deletions(-) diff --git a/src/Common/gui/LocalTrackGroupView.cpp b/src/Common/gui/LocalTrackGroupView.cpp index df38ffebb..fde94432f 100644 --- a/src/Common/gui/LocalTrackGroupView.cpp +++ b/src/Common/gui/LocalTrackGroupView.cpp @@ -32,18 +32,18 @@ LocalTrackGroupView::LocalTrackGroupView(int channelIndex, MainWindow *mainWindo toolButton = createToolButton(); - topPanelLayout->addWidget(toolButton, 0, Qt::AlignTop | Qt::AlignRight); - voiceChatButton = createVoiceChatButton(); + toolVoiceChatLayout = new QBoxLayout(QBoxLayout::TopToBottom); + toolVoiceChatLayout->setContentsMargins(5, 5, 5, 5); + toolVoiceChatLayout->setSpacing(5); + toolVoiceChatLayout->addWidget(toolButton, 0, Qt::AlignTop | Qt::AlignCenter); + toolVoiceChatLayout->addWidget(voiceChatButton, 0, Qt::AlignBottom | Qt::AlignRight); + topPanelLayout->addLayout(toolVoiceChatLayout); + xmitButton = createXmitButton(); + layout()->addWidget(xmitButton); - xmitVoiceChatLayout = new QBoxLayout(QBoxLayout::LeftToRight); - xmitVoiceChatLayout->setContentsMargins(0, 0, 0, 0); - xmitVoiceChatLayout->setSpacing(2); - xmitVoiceChatLayout->addWidget(xmitButton); - xmitVoiceChatLayout->addWidget(voiceChatButton); - mainLayout->addLayout(xmitVoiceChatLayout, mainLayout->rowCount(), 0); connect(toolButton, &QPushButton::clicked, this, &LocalTrackGroupView::showMenu); @@ -468,16 +468,14 @@ void LocalTrackGroupView::setPeakMeterMode(bool peakMeterOnly) { if (this->peakMeterOnly != peakMeterOnly) { this->peakMeterOnly = peakMeterOnly; - topPanel->setVisible(!peakMeterOnly); - instrumentsButton->setVisible(topPanel->isVisible()); + toolButton->setVisible(!peakMeterOnly); + instrumentsButton->setVisible(!peakMeterOnly); for (auto view : getTracks()) { view->setPeakMetersOnlyMode(peakMeterOnly); } - xmitVoiceChatLayout->setDirection(peakMeterOnly ? QBoxLayout::BottomToTop : QBoxLayout::LeftToRight); - updateXmitButtonText(); updateGeometry(); } diff --git a/src/Common/gui/LocalTrackGroupView.h b/src/Common/gui/LocalTrackGroupView.h index cce4d18a1..af5ebd3bc 100644 --- a/src/Common/gui/LocalTrackGroupView.h +++ b/src/Common/gui/LocalTrackGroupView.h @@ -51,7 +51,7 @@ class LocalTrackGroupView : public TrackGroupView void setInstrumentIcon(int instrumentIndex); int getInstrumentIcon() const; - QBoxLayout *xmitVoiceChatLayout; + QBoxLayout *toolVoiceChatLayout; protected: diff --git a/src/resources/css/themes/Flat/LocalTrack.css b/src/resources/css/themes/Flat/LocalTrack.css index 9af7fc03c..d58b4b76e 100644 --- a/src/resources/css/themes/Flat/LocalTrack.css +++ b/src/resources/css/themes/Flat/LocalTrack.css @@ -126,12 +126,12 @@ LocalTrackView #inputPanel:hover #voiceChatButton:!checked { - background-color: rgba(0, 0, 0, 55) + background-color: rgba(100, 100, 100, 55); } #voiceChatButton:hover { - background-color: rgba(40, 40, 40, 55); + background-color: rgba(160, 160, 160, 55); } LocalTrackView #buttonLooper:disabled diff --git a/src/resources/css/themes/Game_nm/LocalTrack.css b/src/resources/css/themes/Game_nm/LocalTrack.css index 7772934a4..a37fa0960 100644 --- a/src/resources/css/themes/Game_nm/LocalTrack.css +++ b/src/resources/css/themes/Game_nm/LocalTrack.css @@ -117,9 +117,10 @@ LocalTrackViewStandalone #voiceChatButton:!checked, #voiceChatButton:checked { - background-color: #58A9AA; - border-color: rgb(0, 110, 100); - color: rgb(0, 60, 60); + border-image: url('/images/button_checked.png') 7px 8px 7px 7px; + color: green; + background-color: none; + } #voiceChatButton:hover diff --git a/src/resources/css/themes/Ice/LocalTrack.css b/src/resources/css/themes/Ice/LocalTrack.css index 0218d550f..737f9b90c 100644 --- a/src/resources/css/themes/Ice/LocalTrack.css +++ b/src/resources/css/themes/Ice/LocalTrack.css @@ -148,14 +148,14 @@ LocalTrackView[unlighted="true"] #inputPanel:hover #voiceChatButton:!checked { - background-color: rgb(136, 174, 255); + background-color: rgba(180, 207, 250, 60); + border: 1px outset rgba(0, 0, 140, 120, 60); border-radius: 6px; } #voiceChatButton:hover { - background-color: rgb(155, 188, 255); - border-radius: 6px; + background-color: rgba(207, 224, 252, 60); } LocalTrackView #buttonLooper:disabled