Skip to content
Extraits de code Groupes Projets

Theme system

Fusionnées Kubat a demandé de fusionner theme vers log-macros
2 files
+ 19
5
Comparer les modifications
  • Côte à côte
  • En ligne

Fichiers

+ 14
3
#include "VivyApplication.hh"
#include "VivyApplication.hh"
#include "UI/MainWindow.hh"
#include "UI/MainWindow.hh"
#include "UI/DockWidgetTitleBar.hh"
#include "UI/DockWidgetTitleBar.hh"
 
#include "UI/Theme/Theme.hh"
#include "Lib/Document/VivyDocumentStore.hh"
#include "Lib/Document/VivyDocumentStore.hh"
#include "Lib/Document/VivyDocument.hh"
#include "Lib/Document/VivyDocument.hh"
#include "Lib/Script/ScriptStore.hh"
#include "Lib/Script/ScriptStore.hh"
@@ -40,6 +41,8 @@ VivyApplication::VivyApplication(int &argc, char **argv)
@@ -40,6 +41,8 @@ VivyApplication::VivyApplication(int &argc, char **argv)
}
}
}
}
 
VivyApplication::~VivyApplication() noexcept {}
 
void
void
VivyApplication::setTheme(Theme theme) noexcept
VivyApplication::setTheme(Theme theme) noexcept
{
{
@@ -48,6 +51,14 @@ VivyApplication::setTheme(Theme theme) noexcept
@@ -48,6 +51,14 @@ VivyApplication::setTheme(Theme theme) noexcept
return;
return;
}
}
 
else if (theme == Theme::QtCreator) {
 
qtCreatorThemePtr.reset(new Vivy::Theme("QtCreator"));
 
QSettings settings(QStringLiteral(":theme/design.creatortheme"), QSettings::IniFormat);
 
qtCreatorThemePtr->readSettings(&settings);
 
qtCreatorThemePtr->applyToApplication();
 
return;
 
}
 
const QString sheet = theme == Theme::Dark ? QStringLiteral(":qdarkstyle/dark/style.qss")
const QString sheet = theme == Theme::Dark ? QStringLiteral(":qdarkstyle/dark/style.qss")
: QStringLiteral(":qdarkstyle/light/style.qss");
: QStringLiteral(":qdarkstyle/light/style.qss");
@@ -82,8 +93,8 @@ VivyApplication::exec() noexcept
@@ -82,8 +93,8 @@ VivyApplication::exec() noexcept
setAttribute(Qt::AA_DontShowIconsInMenus, false);
setAttribute(Qt::AA_DontShowIconsInMenus, false);
setAttribute(Qt::AA_DontShowShortcutsInContextMenus, false);
setAttribute(Qt::AA_DontShowShortcutsInContextMenus, false);
setFont(getApplicationFont(Font::Default));
setFont(getApplicationFont(Font::Default));
setTheme(Theme::Dark); // TODO: Set system theme for now (because we
setTheme(Theme::QtCreator); // TODO: Set system theme for now (because we
// don't have a central theme provider).
// don't have a central theme provider).
// Cursor blinking
// Cursor blinking
setCursorFlashTime(0);
setCursorFlashTime(0);
@@ -105,7 +116,7 @@ VivyApplication::exec() noexcept
@@ -105,7 +116,7 @@ VivyApplication::exec() noexcept
case ApplicationType::GUI: {
case ApplicationType::GUI: {
// Show the main window, also set up the log console
// Show the main window, also set up the log console
mainWindowPtr = std::make_shared<MainWindow>();
mainWindowPtr = std::make_unique<MainWindow>();
QDockWidget *logConsoleDock = new QDockWidget("Console", mainWindowPtr.get());
QDockWidget *logConsoleDock = new QDockWidget("Console", mainWindowPtr.get());
LogConsole *logConsole = new LogConsole(mainWindowPtr.get());
LogConsole *logConsole = new LogConsole(mainWindowPtr.get());
std::shared_ptr<ConsoleLogSinkDispatcher> consoleLogSinkDispatcher =
std::shared_ptr<ConsoleLogSinkDispatcher> consoleLogSinkDispatcher =
Chargement en cours