[gedit] Fix the close button style.
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] Fix the close button style.
- Date: Sun, 26 Dec 2010 14:33:03 +0000 (UTC)
commit 6c40ec361507c55d7fd30cc897ed513f820c56f2
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Sun Dec 26 15:32:38 2010 +0100
Fix the close button style.
gedit/gedit-close-button.c | 42 ++++++++++++++++++------------------------
1 files changed, 18 insertions(+), 24 deletions(-)
---
diff --git a/gedit/gedit-close-button.c b/gedit/gedit-close-button.c
index ab8276c..1c3f6bd 100644
--- a/gedit/gedit-close-button.c
+++ b/gedit/gedit-close-button.c
@@ -25,17 +25,33 @@
G_DEFINE_TYPE (GeditCloseButton, gedit_close_button, GTK_TYPE_BUTTON)
static void
-gedit_close_button_constructed (GObject *button)
+gedit_close_button_class_init (GeditCloseButtonClass *klass)
+{
+}
+
+static void
+gedit_close_button_init (GeditCloseButton *button)
{
+ GtkWidget *image;
GtkStyleContext *context;
GtkCssProvider *css;
GError *error = NULL;
const gchar button_style[] =
- ".button {\n"
+ "* {\n"
+ " -GtkButton-default-border : 0;\n"
+ " -GtkButton-default-outside-border : 0;\n"
" -GtkButton-inner-border: 0;\n"
+ " -GtkWidget-focus-line-width : 0;\n"
+ " -GtkWidget-focus-padding : 0;\n"
" padding: 0;\n"
"}";
+ image = gtk_image_new_from_stock (GTK_STOCK_CLOSE,
+ GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image);
+
+ gtk_container_add (GTK_CONTAINER (button), image);
+
/* make it as small as possible */
css = gtk_css_provider_new ();
if (!gtk_css_provider_load_from_data (css, button_style,
@@ -51,28 +67,6 @@ gedit_close_button_constructed (GObject *button)
g_object_unref (css);
}
-static void
-gedit_close_button_class_init (GeditCloseButtonClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- object_class->constructed = gedit_close_button_constructed;
-}
-
-static void
-gedit_close_button_init (GeditCloseButton *button)
-{
-
- GtkWidget *image;
-
-
- image = gtk_image_new_from_stock (GTK_STOCK_CLOSE,
- GTK_ICON_SIZE_MENU);
- gtk_widget_show (image);
-
- gtk_container_add (GTK_CONTAINER (button), image);
-}
-
GtkWidget *
gedit_close_button_new ()
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]