Add theme option in gsettings.
This commit is contained in:
@ -46,5 +46,10 @@
|
|||||||
<summary>Switch to fullscreen mode when startup</summary>
|
<summary>Switch to fullscreen mode when startup</summary>
|
||||||
<description>If true, switch to fullscreen mode when startup.</description>
|
<description>If true, switch to fullscreen mode when startup.</description>
|
||||||
</key>
|
</key>
|
||||||
|
<key name="theme" type="s">
|
||||||
|
<default>'default'</default>
|
||||||
|
<summary>Theme</summary>
|
||||||
|
<description>Base name of the theme to apply.</description>
|
||||||
|
</key>
|
||||||
</schema>
|
</schema>
|
||||||
</schemalist>
|
</schemalist>
|
||||||
|
|||||||
@ -33,8 +33,6 @@
|
|||||||
|
|
||||||
#include "server-context-service.h"
|
#include "server-context-service.h"
|
||||||
|
|
||||||
#define DEFAULT_THEME (THEMEDIR "/default.css")
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
PROP_0,
|
PROP_0,
|
||||||
PROP_UI_TOOLKIT,
|
PROP_UI_TOOLKIT,
|
||||||
@ -292,7 +290,9 @@ update_widget (ServerContextService *context)
|
|||||||
const EekKeyboard *keyboard;
|
const EekKeyboard *keyboard;
|
||||||
const gchar *client_name;
|
const gchar *client_name;
|
||||||
EekBounds bounds;
|
EekBounds bounds;
|
||||||
|
gchar *theme_name, *theme_path;
|
||||||
EekTheme *theme;
|
EekTheme *theme;
|
||||||
|
|
||||||
#if HAVE_CLUTTER_GTK
|
#if HAVE_CLUTTER_GTK
|
||||||
ClutterActor *stage, *actor;
|
ClutterActor *stage, *actor;
|
||||||
ClutterColor stage_color = { 0xff, 0xff, 0xff, 0xff };
|
ClutterColor stage_color = { 0xff, 0xff, 0xff, 0xff };
|
||||||
@ -301,7 +301,13 @@ update_widget (ServerContextService *context)
|
|||||||
if (context->widget)
|
if (context->widget)
|
||||||
gtk_widget_destroy (context->widget);
|
gtk_widget_destroy (context->widget);
|
||||||
|
|
||||||
theme = eek_theme_new (DEFAULT_THEME, NULL, NULL);
|
theme_name = g_settings_get_string (context->settings, "theme");
|
||||||
|
theme_path = g_strdup_printf ("%s/%s.css", THEMEDIR, theme_name);
|
||||||
|
g_free (theme_name);
|
||||||
|
|
||||||
|
theme = eek_theme_new (theme_path, NULL, NULL);
|
||||||
|
g_free (theme_path);
|
||||||
|
|
||||||
keyboard = eekboard_context_service_get_keyboard (EEKBOARD_CONTEXT_SERVICE(context));
|
keyboard = eekboard_context_service_get_keyboard (EEKBOARD_CONTEXT_SERVICE(context));
|
||||||
eek_element_get_bounds (EEK_ELEMENT(keyboard), &bounds);
|
eek_element_get_bounds (EEK_ELEMENT(keyboard), &bounds);
|
||||||
if (context->ui_toolkit == UI_TOOLKIT_CLUTTER) {
|
if (context->ui_toolkit == UI_TOOLKIT_CLUTTER) {
|
||||||
|
|||||||
Reference in New Issue
Block a user