[Xfce4-commits] <mousepad:master> * mousepad/mousepad-document.c: Make tab close button a bit smaller.

Nick Schermer noreply at xfce.org
Sat May 5 21:31:01 CEST 2012


Updating branch refs/heads/master
         to 976c9707d60945030612eaf79db2e577135fe4ef (commit)
       from d2cf9f1d53f4818ea92e162cf6b71b9963144ce8 (commit)

commit 976c9707d60945030612eaf79db2e577135fe4ef
Author: Nick Schermer <nick at xfce.org>
Date:   Thu Nov 29 19:20:44 2007 +0000

    	* mousepad/mousepad-document.c: Make tab close button a bit smaller.
    
    (Old svn revision: 26407)

 ChangeLog                    |    4 ++++
 mousepad/mousepad-document.c |   23 +++++++++++++++--------
 2 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0d17c79..711aa0d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,8 @@
 2007-11-29	Nick Schermer <nick at xfce.org>
+	* mousepad/mousepad-document.c: Make tab close button a bit smaller.
+
+
+2007-11-29	Nick Schermer <nick at xfce.org>
 	* mousepad/mousepad-window.c: Use a box for packing the window elements.
 	  A table was not really needed, and boxes are a bit faster in calculating
 	  child sizes.
diff --git a/mousepad/mousepad-document.c b/mousepad/mousepad-document.c
index 3a318e2..3c388dc 100644
--- a/mousepad/mousepad-document.c
+++ b/mousepad/mousepad-document.c
@@ -499,8 +499,9 @@ mousepad_document_line_numbers (MousepadDocument *document,
 GtkWidget *
 mousepad_document_get_tab_label (MousepadDocument *document)
 {
-  GtkWidget *hbox;
-  GtkWidget *button, *image;
+  GtkWidget  *hbox;
+  GtkWidget  *button, *image;
+  GtkRcStyle *style;
 
   /* create the box */
   hbox = gtk_hbox_new (FALSE, 0);
@@ -518,12 +519,18 @@ mousepad_document_get_tab_label (MousepadDocument *document)
   gtk_widget_show (document->priv->label);
 
   /* create the button */
-  button = g_object_new (GTK_TYPE_BUTTON,
-                         "relief", GTK_RELIEF_NONE,
-                         "focus-on-click", FALSE,
-                         "border-width", 0,
-                         "can-default", FALSE,
-                         "can-focus", FALSE, NULL);
+  button = gtk_button_new ();
+  gtk_button_set_focus_on_click (GTK_BUTTON (button), FALSE);
+  gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
+  GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_DEFAULT | GTK_CAN_FOCUS);
+
+  /* make button a bit smaller */
+  style = gtk_rc_style_new ();
+  style->xthickness = style->ythickness = 0;
+  gtk_widget_modify_style (button, style);
+  gtk_rc_style_unref (style);
+
+  /* pack button, add signal and tooltip */
   mousepad_util_set_tooltip (button, _("Close this tab"));
   gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
   g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (mousepad_document_tab_button_clicked), document);


More information about the Xfce4-commits mailing list