Commit a20224f9 authored by Daiki Ueno's avatar Daiki Ueno
Browse files

Add default theme.

parent d66318a0
......@@ -244,6 +244,7 @@ data/icons/24x24/Makefile
data/icons/32x32/Makefile
data/icons/48x48/Makefile
data/icons/scalable/Makefile
data/themes/Makefile
eek/eek-${EEK_API_VERSION}.pc
eek/eek-clutter-${EEK_API_VERSION}.pc
eek/eek-gtk-${EEK_API_VERSION}.pc
......
SUBDIRS = icons
\ No newline at end of file
SUBDIRS = icons themes
themedir = $(pkgdatadir)/themes
dist_theme_DATA = default.css
.key {
color: #ffffff;
background-gradient-direction: radial;
background-gradient-start: #000000;
background-gradient-end: #232323;
}
.keyboard {
background-color: #000000;
color: #ffffff;
}
\ No newline at end of file
......@@ -64,7 +64,8 @@ eekboard_desktop_client_SOURCES = desktop-client.c desktop-client-main.c
eekboard_server_CFLAGS = \
-I$(top_srcdir) \
$(GIO2_CFLAGS) \
$(GTK_CFLAGS)
$(GTK_CFLAGS) \
-DTHEMEDIR=\"$(pkgdatadir)/themes\"
eekboard_server_LDADD = \
$(top_builddir)/eekboard/libeekboard.la \
......
......@@ -191,6 +191,8 @@ on_realize (GtkWidget *widget,
GDK_FUNC_CLOSE);
}
#define DEFAULT_THEME (THEMEDIR "/default.css")
static void
update_widget (ServerContext *context)
{
......@@ -199,6 +201,7 @@ update_widget (ServerContext *context)
gint monitor;
GdkRectangle rect;
EekBounds bounds;
EekTheme *theme;
#if HAVE_CLUTTER_GTK
ClutterActor *stage, *actor;
ClutterColor stage_color = { 0xff, 0xff, 0xff, 0xff };
......@@ -207,11 +210,14 @@ update_widget (ServerContext *context)
if (context->widget)
gtk_widget_destroy (context->widget);
theme = eek_theme_new (DEFAULT_THEME, NULL, NULL);
eek_element_get_bounds (EEK_ELEMENT(context->keyboard), &bounds);
#if HAVE_CLUTTER_GTK
context->widget = gtk_clutter_embed_new ();
stage = gtk_clutter_embed_get_stage (GTK_CLUTTER_EMBED(context->widget));
actor = eek_clutter_keyboard_new (context->keyboard);
if (theme)
eek_clutter_keyboard_set_theme (EEK_CLUTTER_KEYBOARD(actor), theme);
clutter_container_add_actor (CLUTTER_CONTAINER(stage), actor);
clutter_stage_set_color (CLUTTER_STAGE(stage), &stage_color);
......@@ -225,6 +231,8 @@ update_widget (ServerContext *context)
actor);
#else
context->widget = eek_gtk_keyboard_new (context->keyboard);
if (theme)
eek_gtk_keyboard_set_theme (EEK_GTK_KEYBOARD(context->widget), theme);
#endif
gtk_widget_set_size_request (context->widget, bounds.width, bounds.height);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment