stylesheets: UI_Colors hotfix

This commit is contained in:
Megamouse 2017-08-20 16:02:39 +02:00 committed by Ivan
parent 33d3303bdf
commit a822d990d2
3 changed files with 39 additions and 15 deletions

View File

@ -287,12 +287,35 @@ void rpcs3_app::OnChangeStyleSheetRequest(const QString& sheetFilePath)
QFile file(sheetFilePath);
if (sheetFilePath == "")
{
setStyleSheet(
"QWidget#header_section { background-color: #ffffff; }"
"QLineEdit#mw_searchbar { margin-left:14px; }"
// toolbar color stylesheet
QColor tbc = guiSettings->GetValue(GUI::mw_toolBarColor).value<QColor>();
QString style_toolbar = QString(
"QLineEdit#mw_searchbar { margin-left:14px; background-color: rgba(%1, %2, %3, %4); }"
"QToolBar#mw_toolbar { background-color: rgba(%1, %2, %3, %4); }"
"QToolBar#mw_toolbar QSlider { background-color: rgba(%1, %2, %3, %4); }"
"QToolBar#mw_toolbar::separator {background-color: rgba(%5, %6, %7, %8); width: 1px; margin-top: 2px; margin-bottom: 2px;}")
.arg(tbc.red()).arg(tbc.green()).arg(tbc.blue()).arg(tbc.alpha())
.arg(tbc.red() - 20).arg(tbc.green() - 20).arg(tbc.blue() - 20).arg(tbc.alpha() - 20);
// toolbar icon color stylesheet
QColor tic = guiSettings->GetValue(GUI::mw_toolIconColor).value<QColor>();
QString style_toolbar_icons = QString(
"QLabel#toolbar_icon_color { color: rgba(%1, %2, %3, %4); }")
.arg(tic.red()).arg(tic.green()).arg(tic.blue()).arg(tic.alpha());
// gamelist toolbar stylesheet
QColor gltic = guiSettings->GetValue(GUI::gl_toolIconColor).value<QColor>();
QString style_gamelist_toolbar = QString(
"QLineEdit#tb_searchbar { background: transparent; }"
"QLabel#gamegrid_font { font-weight: 600; font-size: 8pt; font-family: Lucida Grande; color: rgba(51, 51, 51, 255); }"
);
"QLabel#gamelist_toolbar_icon_color { color: rgba(%1, %2, %3, %4); }")
.arg(gltic.red()).arg(gltic.green()).arg(gltic.blue()).arg(gltic.alpha());
// other objects' stylesheet
QString style_rest = QString(
"QWidget#header_section { background-color: #ffffff; }"
"QLabel#gamegrid_font { font-weight: 600; font-size: 8pt; font-family: Lucida Grande; color: rgba(51, 51, 51, 255); }");
setStyleSheet(style_toolbar + style_toolbar_icons + style_gamelist_toolbar + style_rest);
}
else if (file.open(QIODevice::ReadOnly | QIODevice::Text))
{

View File

@ -853,11 +853,11 @@ void game_list_frame::RepaintToolBarIcons()
if (xgui_settings->GetValue(GUI::m_enableUIColors).toBool())
{
newColor = GUI::get_Label_Color("gamelist_toolbar_icon_color");
newColor = xgui_settings->GetValue(GUI::gl_toolIconColor).value<QColor>();
}
else
{
newColor = xgui_settings->GetValue(GUI::gl_toolIconColor).value<QColor>();
newColor = GUI::get_Label_Color("gamelist_toolbar_icon_color");
}
m_catActHDD.colored = gui_settings::colorizedIcon(QIcon(":/Icons/hdd_blue.png"), GUI::gl_tool_icon_color, newColor, true);

View File

@ -76,6 +76,7 @@ void main_window::Init()
ui->menuUtilities->menuAction()->setVisible(guiSettings->GetValue(GUI::m_showDebugTab).toBool());
// add toolbar widgets (crappy Qt designer is not able to)
ui->toolBar->setObjectName("mw_toolbar");
ui->sizeSlider->setRange(0, GUI::gl_max_slider_pos);
ui->sizeSlider->setSliderPosition(guiSettings->GetValue(GUI::gl_iconSize).toInt());
ui->toolBar->addWidget(ui->sizeSliderContainer);
@ -704,11 +705,11 @@ void main_window::RepaintToolBarIcons()
if (guiSettings->GetValue(GUI::m_enableUIColors).toBool())
{
newColor = GUI::get_Label_Color("toolbar_icon_color");
newColor = guiSettings->GetValue(GUI::mw_toolIconColor).value<QColor>();
}
else
{
newColor = guiSettings->GetValue(GUI::mw_toolIconColor).value<QColor>();
newColor = GUI::get_Label_Color("toolbar_icon_color");
}
icon_play = gui_settings::colorizedIcon(QIcon(":/Icons/play.png"), GUI::mw_tool_icon_color, newColor);
@ -1042,10 +1043,6 @@ void main_window::AddRecentAction(const q_string_pair& entry)
void main_window::RepaintToolbar()
{
if (guiSettings->GetValue(GUI::m_enableUIColors).toBool())
{
ui->toolBar->setStyleSheet(GUI::stylesheet);
}
else
{
QColor tbc = guiSettings->GetValue(GUI::mw_toolBarColor).value<QColor>();
@ -1058,6 +1055,10 @@ void main_window::RepaintToolbar()
.arg(tbc.red() - 20).arg(tbc.green() - 20).arg(tbc.blue() - 20).arg(tbc.alpha() - 20)
);
}
else
{
ui->toolBar->setStyleSheet(GUI::stylesheet);
}
}
void main_window::CreateActions()
@ -1142,11 +1143,11 @@ void main_window::CreateConnects()
connect(&dlg, &settings_dialog::accepted, [this](){
if (guiSettings->GetValue(GUI::m_enableUIColors).toBool())
{
gameListFrame->RepaintIcons(GUI::get_Label_Color("gamelist_icon_background_color"));
gameListFrame->RepaintIcons(guiSettings->GetValue(GUI::gl_iconColor).value<QColor>());
}
else
{
gameListFrame->RepaintIcons(guiSettings->GetValue(GUI::gl_iconColor).value<QColor>());
gameListFrame->RepaintIcons(GUI::get_Label_Color("gamelist_icon_background_color"));
}
RepaintToolbar();
});