Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
Vivy
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Wiki externe
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Elliu
Vivy
Validations
96fb877e
Vérifiée
Valider
96fb877e
rédigé
3 years ago
par
Kubat
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
UI: Use the new theming system to set Vivy's theme
parent
0fe85263
Aucune branche associée trouvée
Branches contenant la validation
Aucune étiquette associée trouvée
2 requêtes de fusion
!22
Theme system
,
!21
Add clean logs support + dependent MR
Modifications
2
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
src/VivyApplication.cc
+14
-3
14 ajouts, 3 suppressions
src/VivyApplication.cc
src/VivyApplication.hh
+5
-2
5 ajouts, 2 suppressions
src/VivyApplication.hh
avec
19 ajouts
et
5 suppressions
src/VivyApplication.cc
+
14
−
3
Voir le fichier @
96fb877e
#include
"VivyApplication.hh"
#include
"UI/MainWindow.hh"
#include
"UI/DockWidgetTitleBar.hh"
#include
"UI/Theme/Theme.hh"
#include
"Lib/Document/VivyDocumentStore.hh"
#include
"Lib/Document/VivyDocument.hh"
#include
"Lib/Script/ScriptStore.hh"
...
...
@@ -40,6 +41,8 @@ VivyApplication::VivyApplication(int &argc, char **argv)
}
}
VivyApplication
::~
VivyApplication
()
noexcept
{}
void
VivyApplication
::
setTheme
(
Theme
theme
)
noexcept
{
...
...
@@ -48,6 +51,14 @@ VivyApplication::setTheme(Theme theme) noexcept
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"
)
:
QStringLiteral
(
":qdarkstyle/light/style.qss"
);
...
...
@@ -82,8 +93,8 @@ VivyApplication::exec() noexcept
setAttribute
(
Qt
::
AA_DontShowIconsInMenus
,
false
);
setAttribute
(
Qt
::
AA_DontShowShortcutsInContextMenus
,
false
);
setFont
(
getApplicationFont
(
Font
::
Default
));
setTheme
(
Theme
::
Dark
);
// TODO: Set system theme for now (because we
// don't have a central theme provider).
setTheme
(
Theme
::
QtCreator
);
// TODO: Set system theme for now (because we
// don't have a central theme provider).
// Cursor blinking
setCursorFlashTime
(
0
);
...
...
@@ -105,7 +116,7 @@ VivyApplication::exec() noexcept
case
ApplicationType
::
GUI
:
{
// 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
());
LogConsole
*
logConsole
=
new
LogConsole
(
mainWindowPtr
.
get
());
std
::
shared_ptr
<
ConsoleLogSinkDispatcher
>
consoleLogSinkDispatcher
=
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
src/VivyApplication.hh
+
5
−
2
Voir le fichier @
96fb877e
...
...
@@ -50,6 +50,7 @@ class VivyDocumentStore;
class
AbstractDocument
;
class
ScriptDocument
;
class
VivyDocument
;
class
Theme
;
// Vivy application class
class
VivyApplication
:
public
QApplication
{
...
...
@@ -73,7 +74,7 @@ public:
DefaultBoldItalic
};
enum
class
Theme
{
System
,
Dark
,
Light
};
enum
class
Theme
{
System
,
Dark
,
Light
,
QtCreator
};
private
:
int
fontIdMonospace
;
...
...
@@ -83,7 +84,8 @@ private:
int
fontIdBold
;
int
fontIdBoldItalic
;
std
::
shared_ptr
<
MainWindow
>
mainWindowPtr
{
nullptr
};
std
::
unique_ptr
<
Vivy
::
Theme
>
qtCreatorThemePtr
{
nullptr
};
std
::
unique_ptr
<
MainWindow
>
mainWindowPtr
{
nullptr
};
bool
useFakeVim
{
false
};
ApplicationType
selectedType
{
ApplicationType
::
GUI
};
...
...
@@ -93,6 +95,7 @@ private:
public
:
VivyApplication
(
int
&
argc
,
char
**
argv
);
~
VivyApplication
()
noexcept
override
;
int
exec
()
noexcept
;
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter