updated styling and fixed windows compiling

This commit is contained in:
itsmattkc
2019-07-01 11:39:25 -07:00
parent 026c500802
commit 8f6cb7a2cb
9 changed files with 12 additions and 48 deletions
-5
View File
@@ -1,5 +0,0 @@
<RCC>
<qresource prefix="/css">
<file>olive-dark.css</file>
</qresource>
</RCC>
+2 -2
View File
@@ -81,7 +81,7 @@ QPushButton::checked {
background: #191919;
}
/* Ensure QMenu separators are dark enough */
/* Ensure QMenu separators stand out */
QMenu::separator {
background: #191919;
background: #353535;
}
+2 -2
View File
@@ -81,7 +81,7 @@ QPushButton::checked {
background: #f0f0f0;
}
/* Ensure QMenu separators are dark enough */
/* Ensure QMenu separators stand out */
QMenu::separator {
background: #f0f0f0;
background: #d0d0d0;
}
+2 -2
View File
@@ -81,7 +81,7 @@ QPushButton::checked {
background: #c0c0c0;
}
/* Ensure QMenu separators are dark enough */
/* Ensure QMenu separators stand out */
QMenu::separator {
background: #c0c0c0;
background: #808080;
}
+4 -12
View File
@@ -23,6 +23,7 @@
#include <QApplication>
#include <QFile>
#include <QPalette>
#include <QStyle>
#include <QStyleFactory>
#include <QTextStream>
@@ -35,20 +36,11 @@ void olive::style::AppSetDefault()
QFile css_file(":/css/olive-dark.css");
if (css_file.open(QFile::ReadOnly | QFile::Text)) {
// Read in entire CSS from file and set as the application stylesheet
QTextStream css_ts(&css_file);
qApp->setStyleSheet(css_ts.readAll());
css_file.close();
}
}
void olive::style::WidgetSetNative(QWidget *w)
{
#ifdef Q_OS_WIN
w->setStyleSheet("");
w->setPalette(w->style()->standardPalette());
w->setStyleSheet(QString());
w->setStyle(QStyleFactory::create("windowsvista"));
#else
Q_UNUSED(w)
#endif
}
-13
View File
@@ -35,19 +35,6 @@ namespace style {
*/
void AppSetDefault();
/**
* @brief (Windows only) Sets a widget to use the OS' native styling (windowsvista)
*
* Used primarily to set menus to the default Windows style. It was thought this would look better on Windows than the
* cross-platform styled menus and provide a more "native" experience. Unfortunately the only way to do this (when the
* application style is set) is to manually set the menus to not use the application style, thus this function.
*
* @param w
*
* Widget to set to native styling
*/
void WidgetSetNative(QWidget *w);
}
}
-11
View File
@@ -25,8 +25,6 @@
Menu::Menu(QMenuBar *bar, const QObject* receiver, const char* member) :
QMenu(bar)
{
SetStyling();
bar->addMenu(this);
if (receiver != nullptr) {
@@ -37,8 +35,6 @@ Menu::Menu(QMenuBar *bar, const QObject* receiver, const char* member) :
Menu::Menu(Menu *menu, const QObject *receiver, const char *member) :
QMenu(menu)
{
SetStyling();
menu->addMenu(this);
if (receiver != nullptr) {
@@ -85,10 +81,3 @@ void Menu::SetBooleanAction(QAction *a, bool* boolean)
a->setChecked(*boolean);
a->setProperty("boolptr", reinterpret_cast<quintptr>(boolean));
}
void Menu::SetStyling()
{
//if (olive::config.use_native_menu_styling) {
olive::style::WidgetSetNative(this);
//}
}
+1 -1
View File
@@ -44,7 +44,7 @@ public:
static void SetBooleanAction(QAction* a, bool *boolean);
private:
void SetStyling();
};
#endif // WIDGETMENU_H
+1
View File
@@ -24,6 +24,7 @@
#include "core.h"
#include "tool/tool.h"
#include "ui/style/style.h"
#include "widget/menu/menushared.h"
MainMenu::MainMenu(QWidget *parent) :