Add default theme.
This commit is contained in:
		@ -244,6 +244,7 @@ data/icons/24x24/Makefile
 | 
				
			|||||||
data/icons/32x32/Makefile
 | 
					data/icons/32x32/Makefile
 | 
				
			||||||
data/icons/48x48/Makefile
 | 
					data/icons/48x48/Makefile
 | 
				
			||||||
data/icons/scalable/Makefile
 | 
					data/icons/scalable/Makefile
 | 
				
			||||||
 | 
					data/themes/Makefile
 | 
				
			||||||
eek/eek-${EEK_API_VERSION}.pc
 | 
					eek/eek-${EEK_API_VERSION}.pc
 | 
				
			||||||
eek/eek-clutter-${EEK_API_VERSION}.pc
 | 
					eek/eek-clutter-${EEK_API_VERSION}.pc
 | 
				
			||||||
eek/eek-gtk-${EEK_API_VERSION}.pc
 | 
					eek/eek-gtk-${EEK_API_VERSION}.pc
 | 
				
			||||||
 | 
				
			|||||||
@ -1 +1 @@
 | 
				
			|||||||
SUBDIRS = icons
 | 
					SUBDIRS = icons themes
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										2
									
								
								data/themes/Makefile.am
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								data/themes/Makefile.am
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,2 @@
 | 
				
			|||||||
 | 
					themedir = $(pkgdatadir)/themes
 | 
				
			||||||
 | 
					dist_theme_DATA = default.css
 | 
				
			||||||
							
								
								
									
										11
									
								
								data/themes/default.css
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								data/themes/default.css
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,11 @@
 | 
				
			|||||||
 | 
					.key {
 | 
				
			||||||
 | 
					    color: #ffffff;
 | 
				
			||||||
 | 
					    background-gradient-direction: radial;
 | 
				
			||||||
 | 
					    background-gradient-start: #000000;
 | 
				
			||||||
 | 
					    background-gradient-end: #232323;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.keyboard {
 | 
				
			||||||
 | 
					    background-color: #000000;
 | 
				
			||||||
 | 
					    color: #ffffff;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -64,7 +64,8 @@ eekboard_desktop_client_SOURCES = desktop-client.c desktop-client-main.c
 | 
				
			|||||||
eekboard_server_CFLAGS = \
 | 
					eekboard_server_CFLAGS = \
 | 
				
			||||||
	-I$(top_srcdir) \
 | 
						-I$(top_srcdir) \
 | 
				
			||||||
	$(GIO2_CFLAGS) \
 | 
						$(GIO2_CFLAGS) \
 | 
				
			||||||
	$(GTK_CFLAGS)
 | 
						$(GTK_CFLAGS) \
 | 
				
			||||||
 | 
						-DTHEMEDIR=\"$(pkgdatadir)/themes\"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
eekboard_server_LDADD = \
 | 
					eekboard_server_LDADD = \
 | 
				
			||||||
	$(top_builddir)/eekboard/libeekboard.la \
 | 
						$(top_builddir)/eekboard/libeekboard.la \
 | 
				
			||||||
 | 
				
			|||||||
@ -191,6 +191,8 @@ on_realize (GtkWidget *widget,
 | 
				
			|||||||
                              GDK_FUNC_CLOSE);
 | 
					                              GDK_FUNC_CLOSE);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define DEFAULT_THEME (THEMEDIR "/default.css")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void
 | 
					static void
 | 
				
			||||||
update_widget (ServerContext *context)
 | 
					update_widget (ServerContext *context)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@ -199,6 +201,7 @@ update_widget (ServerContext *context)
 | 
				
			|||||||
    gint monitor;
 | 
					    gint monitor;
 | 
				
			||||||
    GdkRectangle rect;
 | 
					    GdkRectangle rect;
 | 
				
			||||||
    EekBounds bounds;
 | 
					    EekBounds bounds;
 | 
				
			||||||
 | 
					    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 };
 | 
				
			||||||
@ -207,11 +210,14 @@ update_widget (ServerContext *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);
 | 
				
			||||||
    eek_element_get_bounds (EEK_ELEMENT(context->keyboard), &bounds);
 | 
					    eek_element_get_bounds (EEK_ELEMENT(context->keyboard), &bounds);
 | 
				
			||||||
#if HAVE_CLUTTER_GTK
 | 
					#if HAVE_CLUTTER_GTK
 | 
				
			||||||
    context->widget = gtk_clutter_embed_new ();
 | 
					    context->widget = gtk_clutter_embed_new ();
 | 
				
			||||||
    stage = gtk_clutter_embed_get_stage (GTK_CLUTTER_EMBED(context->widget));
 | 
					    stage = gtk_clutter_embed_get_stage (GTK_CLUTTER_EMBED(context->widget));
 | 
				
			||||||
    actor = eek_clutter_keyboard_new (context->keyboard);
 | 
					    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_container_add_actor (CLUTTER_CONTAINER(stage), actor);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    clutter_stage_set_color (CLUTTER_STAGE(stage), &stage_color);
 | 
					    clutter_stage_set_color (CLUTTER_STAGE(stage), &stage_color);
 | 
				
			||||||
@ -225,6 +231,8 @@ update_widget (ServerContext *context)
 | 
				
			|||||||
                      actor);
 | 
					                      actor);
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
    context->widget = eek_gtk_keyboard_new (context->keyboard);
 | 
					    context->widget = eek_gtk_keyboard_new (context->keyboard);
 | 
				
			||||||
 | 
					    if (theme)
 | 
				
			||||||
 | 
					        eek_gtk_keyboard_set_theme (EEK_GTK_KEYBOARD(context->widget), theme);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
    gtk_widget_set_size_request (context->widget, bounds.width, bounds.height);
 | 
					    gtk_widget_set_size_request (context->widget, bounds.width, bounds.height);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user