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

Display server title correctly in dark mode #3008

Merged
merged 1 commit into from
Apr 19, 2023
Merged
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
35 changes: 21 additions & 14 deletions src/clientdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1358,7 +1358,6 @@ void CClientDlg::SetGUIDesign ( const EGUIDesign eNewDesign )
" image: url(:/png/fader/res/ledbuttonpressed.png); }"
"QCheckBox { color: rgb(220, 220, 220);"
" font: bold; }" );

Copy link
Collaborator

Choose a reason for hiding this comment

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

Unrelated delete of blank line?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes.

#ifdef _WIN32
// Workaround QT-Windows problem: This should not be necessary since in the
// background frame the style sheet for QRadioButton was already set. But it
Expand Down Expand Up @@ -1450,31 +1449,39 @@ void CClientDlg::SetMixerBoardDeco ( const ERecorderState newRecorderState, cons
eLastRecorderState = newRecorderState;
eLastDesign = eNewDesign;

// set base style
QString sTitleStyle = "QGroupBox::title { subcontrol-origin: margin;"
" subcontrol-position: left top;"
" left: 7px;";

if ( newRecorderState == RS_RECORDING )
{
MainMixerBoard->setStyleSheet ( "QGroupBox::title { subcontrol-origin: margin; "
" subcontrol-position: left top;"
" left: 7px;"
" color: rgb(255,255,255);"
" background-color: rgb(255,0,0); }" );
sTitleStyle += "color: rgb(255,255,255);"
"background-color: rgb(255,0,0); }";
}
else
{
if ( eNewDesign == GD_ORIGINAL )
{
MainMixerBoard->setStyleSheet ( "QGroupBox::title { subcontrol-origin: margin;"
" subcontrol-position: left top;"
" left: 7px;"
" color: rgb(220,220,220); }" );
// no need to set the background color for dark mode in fancy skin, as the background is already dark.
sTitleStyle += "color: rgb(220,220,220); }";
}
else
{
MainMixerBoard->setStyleSheet ( "QGroupBox::title { subcontrol-origin: margin;"
" subcontrol-position: left top;"
" left: 7px;"
" color: rgb(0,0,0); }" );
if ( palette().color ( QPalette::Window ) == QColor::fromRgbF ( 0.196078, 0.196078, 0.196078, 1 ) )
{
// Dark mode on macOS/Linux needs a light color

sTitleStyle += "color: rgb(220,220,220); }";
}
else
{
sTitleStyle += "color: rgb(0,0,0); }";
}
}
}

MainMixerBoard->setStyleSheet ( sTitleStyle );
}

void CClientDlg::SetPingTime ( const int iPingTime, const int iOverallDelayMs, const CMultiColorLED::ELightColor eOverallDelayLEDColor )
Expand Down