overrode menus
This commit is contained in:
+6
-1
@@ -72,7 +72,8 @@ Config::Config()
|
||||
thumbnail_resolution(120),
|
||||
add_default_effects_to_clips(true),
|
||||
invert_timeline_scroll_axes(true),
|
||||
style(olive::styling::kOliveDefaultDark)
|
||||
style(olive::styling::kOliveDefaultDark),
|
||||
use_native_menu_styling(true)
|
||||
{}
|
||||
|
||||
void Config::load(QString path) {
|
||||
@@ -215,6 +216,9 @@ void Config::load(QString path) {
|
||||
} else if (stream.name() == "Style") {
|
||||
stream.readNext();
|
||||
style = static_cast<olive::styling::Style>(stream.text().toInt());
|
||||
} else if (stream.name() == "NativeMenuStyling") {
|
||||
stream.readNext();
|
||||
use_native_menu_styling = (stream.text() == "1");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -283,6 +287,7 @@ void Config::save(QString path) {
|
||||
stream.writeTextElement("WaveformResolution", QString::number(waveform_resolution));
|
||||
stream.writeTextElement("AddDefaultEffectsToClips", QString::number(add_default_effects_to_clips));
|
||||
stream.writeTextElement("Style", QString::number(style));
|
||||
stream.writeTextElement("NativeMenuStyling", QString::number(use_native_menu_styling));
|
||||
|
||||
stream.writeEndElement(); // configuration
|
||||
stream.writeEndDocument(); // doc
|
||||
|
||||
@@ -526,6 +526,13 @@ struct Config {
|
||||
*/
|
||||
olive::styling::Style style;
|
||||
|
||||
/**
|
||||
* @brief Use native menu styling
|
||||
*
|
||||
* Use native styling on menus rather than cross-platform Fusion.
|
||||
*/
|
||||
bool use_native_menu_styling;
|
||||
|
||||
/**
|
||||
* @brief Load config from file
|
||||
*
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <QFileDialog>
|
||||
#include <QAction>
|
||||
#include <QApplication>
|
||||
#include <QStyleFactory>
|
||||
#include <QDebug>
|
||||
|
||||
#include "panels/panels.h"
|
||||
@@ -141,6 +142,15 @@ void OliveGlobal::load_translation_from_config() {
|
||||
}
|
||||
}
|
||||
|
||||
void OliveGlobal::SetNativeStyling(QWidget *w)
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
w->setStyleSheet("");
|
||||
w->setPalette(w->style()->standardPalette());
|
||||
w->setStyle(QStyleFactory::create("windowsvista"));
|
||||
#endif
|
||||
}
|
||||
|
||||
void OliveGlobal::new_project() {
|
||||
if (can_close_project()) {
|
||||
// clear graph editor
|
||||
|
||||
@@ -115,6 +115,15 @@ public:
|
||||
*/
|
||||
void load_translation_from_config();
|
||||
|
||||
/**
|
||||
* @brief Set native UI styling on a given widget
|
||||
*
|
||||
* @param w
|
||||
*
|
||||
* The widget to set styling on.
|
||||
*/
|
||||
static void SetNativeStyling(QWidget* w);
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* @brief Undo user's last action
|
||||
|
||||
Reference in New Issue
Block a user