diff --git a/configure.ac b/configure.ac index eb82ef2..cb64446 100644 --- a/configure.ac +++ b/configure.ac @@ -2,8 +2,8 @@ # # input-pad - The input pad # -# Copyright (c) 2010-2014 Takao Fujiwara -# Copyright (c) 2010-2014 Red Hat, Inc. +# Copyright (c) 2010-2015 Takao Fujiwara +# Copyright (c) 2010-2015 Red Hat, Inc. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -94,7 +94,7 @@ PKG_CHECK_MODULES(GMODULE2, ) PKG_CHECK_MODULES(GTK3, [ - gtk+-3.0 >= 3.10 + gtk+-3.0 >= 3.12 ]) GTK_API_VERSION=3.0 AC_SUBST(GTK_API_VERSION) diff --git a/input-pad/Makefile.am b/input-pad/Makefile.am index 30618d2..9e781da 100644 --- a/input-pad/Makefile.am +++ b/input-pad/Makefile.am @@ -109,7 +109,7 @@ libinput_pad_1_0_la_LDFLAGS = \ $(no_undefined) \ $(NULL) -resources.c: input-pad.gresource.xml +resources.c: input-pad.gresource.xml app-menu.ui dialog.ui window-gtk.ui $(GLIB_COMPILE_RESOURCES) $< --target=$@ --generate-source input-pad-marshal.h: input-pad-marshal.list diff --git a/input-pad/dialog.ui b/input-pad/dialog.ui index 213ab54..b12db54 100644 --- a/input-pad/dialog.ui +++ b/input-pad/dialog.ui @@ -326,10 +326,7 @@ You also can copy pad files from /usr/share/input-pad/pad to $HOME/.config/pad t GTK_JUSTIFY_LEFT False False - 0 - 0.5 - 0 - 0 + start ConfigLayoutsAddTreeView @@ -403,10 +400,7 @@ You also can copy pad files from /usr/share/input-pad/pad to $HOME/.config/pad t GTK_JUSTIFY_LEFT False False - 0 - 0.5 - 0 - 0 + start ConfigLayoutsRemoveTreeView @@ -538,79 +532,67 @@ You also can copy pad files from /usr/share/input-pad/pad to $HOME/.config/pad t 10 12 - + True - 12 - 12 + 0 + none - + True - 0 - none + vertical + 6 + 12 + 12 + - + True - 12 - 12 + True + 5 + 450 + 350 + automatic + automatic + out - + True - vertical - 6 - - - - True - True - 5 - 450 - 350 - automatic - automatic - out - - - True - none - - - True - vertical - - - - - - - 1 - + + 1 + - - - True - <b>Keyboard Option</b> - True - - + + + + + True + <b>Keyboard Option</b> + True diff --git a/input-pad/window-gtk.c b/input-pad/window-gtk.c index 505d141..2562753 100644 --- a/input-pad/window-gtk.c +++ b/input-pad/window-gtk.c @@ -1,7 +1,7 @@ /* vim:set et sts=4: */ /* input-pad - The input pad - * Copyright (C) 2010-2014 Takao Fujiwara - * Copyright (C) 2010-2014 Red Hat, Inc. + * Copyright (C) 2010-2015 Takao Fujiwara + * Copyright (C) 2010-2015 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -129,7 +129,6 @@ struct _InputPadGtkWindowPrivate { gchar **group_variants; gchar **group_options; guint char_button_sensitive : 1; - GdkRGBA *color_gray; /* The kbdui_name is used for each window instance. */ gchar *kbdui_name; InputPadGtkKbdui *kbdui; @@ -992,7 +991,6 @@ on_button_config_options_close_clicked (GtkButton *button, gpointer data) GList *list = NULL; GList *list_button = NULL; GtkWidget *expander; - GtkWidget *alignment; GtkWidget *vbox; GtkWidget *checkbutton; GtkWidget *combobox; @@ -1018,10 +1016,6 @@ on_button_config_options_close_clicked (GtkButton *button, gpointer data) expander = GTK_WIDGET (list->data); tmp_list = gtk_container_get_children (GTK_CONTAINER (expander)); - alignment = GTK_WIDGET (tmp_list->data); - g_list_free (tmp_list); - - tmp_list = gtk_container_get_children (GTK_CONTAINER (alignment)); vbox = GTK_WIDGET (tmp_list->data); g_list_free (tmp_list); @@ -2024,17 +2018,34 @@ append_unicode_table (GtkWidget *table, int row, col; css_provider = gtk_css_provider_new (); - gtk_css_provider_load_from_data (css_provider, - "GtkButton { padding-left: 1px;" \ - " padding-right: 1px;" \ - " padding-top: 1px;" \ - " padding-bottom: 1px;" \ - " border-top-width: 0px;" \ - " border-left-width: 0px;" \ - " border-bottom-width: 0px;" \ - " border-right-width: 0px; }", - -1, - &error); + if (input_pad->child) + gtk_css_provider_load_from_data ( + css_provider, + "GtkButton { padding-left: 1px;" \ + " padding-right: 1px;" \ + " padding-top: 1px;" \ + " padding-bottom: 1px;" \ + " border-top-width: 0px;" \ + " border-left-width: 0px;" \ + " border-bottom-width: 0px;" \ + " border-right-width: 0px; }", + -1, + &error); + else + /* FIXME: cannot change background in GTK3 button. */ + gtk_css_provider_load_from_data ( + css_provider, + "GtkButton { padding-left: 1px;" \ + " padding-right: 1px;" \ + " padding-top: 1px;" \ + " padding-bottom: 1px;" \ + " border-top-width: 0px;" \ + " border-left-width: 0px;" \ + " border-bottom-width: 0px;" \ + " border-right-width: 0px;" \ + " background-color: LightGray; }", + -1, + &error); for (num = start; num <= end; num++) { button = input_pad_gtk_button_new_with_unicode (num); @@ -2047,15 +2058,9 @@ append_unicode_table (GtkWidget *table, gtk_grid_attach (GTK_GRID (table), button, col, row, 1, 1); gtk_widget_show (button); - if (input_pad->child) { + if (input_pad->child) gtk_widget_set_sensitive (button, input_pad->priv->char_button_sensitive); - } else if (input_pad->priv->color_gray) { - /* char button is stdout only */ - /* FIXME: cannot change background in GTK3 button. */ - gtk_widget_override_background_color (button, GTK_STATE_NORMAL, - input_pad->priv->color_gray); - } g_signal_connect (G_OBJECT (button), "pressed", G_CALLBACK (on_button_pressed), input_pad); @@ -2178,17 +2183,34 @@ append_custom_char_view_table (GtkWidget *scrolled, InputPadTable *table_data) #endif css_provider = gtk_css_provider_new (); - gtk_css_provider_load_from_data (css_provider, - "GtkButton { padding-left: 1px;" \ - " padding-right: 1px;" \ - " padding-top: 1px;" \ - " padding-bottom: 1px;" \ - " border-top-width: 0px;" \ - " border-left-width: 0px;" \ - " border-bottom-width: 0px;" \ - " border-right-width: 0px; }", - -1, - &error); + if (input_pad->child) + gtk_css_provider_load_from_data ( + css_provider, + "GtkButton { padding-left: 1px;" \ + " padding-right: 1px;" \ + " padding-top: 1px;" \ + " padding-bottom: 1px;" \ + " border-top-width: 0px;" \ + " border-left-width: 0px;" \ + " border-bottom-width: 0px;" \ + " border-right-width: 0px; }", + -1, + &error); + else + /* FIXME: cannot change background in GTK3 button. */ + gtk_css_provider_load_from_data ( + css_provider, + "GtkButton { padding-left: 1px;" \ + " padding-right: 1px;" \ + " padding-top: 1px;" \ + " padding-bottom: 1px;" \ + " border-top-width: 0px;" \ + " border-left-width: 0px;" \ + " border-bottom-width: 0px;" \ + " border-right-width: 0px;" \ + " background-color: LightGray; }", + -1, + &error); table = gtk_grid_new (); /* gtk_table_attach_defaults assigns GTK_EXPAND and @@ -2279,15 +2301,9 @@ append_custom_char_view_table (GtkWidget *scrolled, InputPadTable *table_data) col, row, 1, 1); gtk_widget_show (button); - if (input_pad->child) { + if (input_pad->child) gtk_widget_set_sensitive (button, input_pad->priv->char_button_sensitive); - } else if (input_pad->priv->color_gray) { - /* char button is stdout only */ - /* FIXME: cannot change background in GTK3 button. */ - gtk_widget_override_background_color (button, GTK_STATE_NORMAL, - input_pad->priv->color_gray); - } g_signal_connect (G_OBJECT (button), "pressed", G_CALLBACK (on_button_pressed), (gpointer) table_data->priv->signal_window); @@ -2919,7 +2935,6 @@ config_options_treeview_set (InputPadGtkWindow *input_pad, { InputPadXKBOptionGroupList *groups = NULL; GtkWidget *expander; - GtkWidget *alignment; GtkWidget *vbox; GtkWidget *checkbutton; GtkWidget *label; @@ -2937,12 +2952,9 @@ config_options_treeview_set (InputPadGtkWindow *input_pad, (gpointer) groups->option_group); g_object_set_data (G_OBJECT (expander), "checked", GINT_TO_POINTER (checked)); - alignment = gtk_alignment_new (0, 0, 1, 0); - gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 6, 0, 18, 0); - gtk_container_add (GTK_CONTAINER (expander), alignment); - gtk_widget_show (alignment); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); - gtk_container_add (GTK_CONTAINER (alignment), vbox); + gtk_widget_set_margin_start (vbox, 18); + gtk_container_add (GTK_CONTAINER (expander), vbox); gtk_widget_show (vbox); InputPadXKBOptionList *options = groups->options; @@ -4424,18 +4436,12 @@ static void input_pad_gtk_window_set_priv (InputPadGtkWindow *window) { InputPadGtkWindowPrivate *priv = input_pad_gtk_window_get_instance_private (window); - GdkRGBA color; if (priv->group == NULL) { priv->group = input_pad_group_parse_all_files (NULL, NULL); } priv->char_button_sensitive = TRUE; - if (!gdk_rgba_parse (&color, "gray")) { - color.red = color.green = color.blue = 1.; - color.alpha = 1.; - } - priv->color_gray = gdk_rgba_copy (&color); if (kbdui_name) { priv->kbdui_name = g_strdup (kbdui_name); } @@ -4468,10 +4474,6 @@ input_pad_gtk_window_real_destroy (GtkWidget *widget) input_pad_group_destroy (window->priv->group); window->priv->group = NULL; } - if (window->priv->color_gray) { - gdk_rgba_free (window->priv->color_gray); - window->priv->color_gray = NULL; - } #ifdef MODULE_XTEST_GDK_BASE if (use_module_xtest) { input_pad_gtk_window_xtest_gdk_destroy (window);