[gnome-panel] Remove focus padding from status area



commit 9b4dc568cbf61cb9228e1b5afdb524b02a397db3
Author: William Jon McCann <jmccann redhat com>
Date:   Wed Jun 3 22:00:28 2009 -0400

    Remove focus padding from status area
    
    Allow status icons to be activated by clicks at the edge of the
    screen.  Fitt's Law etc.
    
    http://bugzilla.gnome.org/show_bug.cgi?id=311190
---
 applets/notification_area/main.c |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/applets/notification_area/main.c b/applets/notification_area/main.c
index ad9597f..69cf7ea 100644
--- a/applets/notification_area/main.c
+++ b/applets/notification_area/main.c
@@ -209,6 +209,28 @@ free_applet_data (AppletData *data)
   g_slice_free (AppletData, data);
 }
 
+static inline void
+force_no_focus_padding (GtkWidget *widget)
+{
+  static gboolean first_time = TRUE;
+
+  if (first_time)
+    {
+      gtk_rc_parse_string ("\n"
+                           "   style \"na-tray-style\"\n"
+                           "   {\n"
+                           "      GtkWidget::focus-line-width=0\n"
+                           "      GtkWidget::focus-padding=0\n"
+                           "   }\n"
+                           "\n"
+                           "    widget \"*.na-tray\" style \"na-tray-style\"\n"
+                           "\n");
+      first_time = FALSE;
+    }
+
+  gtk_widget_set_name (widget, "na-tray");
+}
+
 static gboolean
 applet_factory (PanelApplet *applet,
                 const gchar *iid,
@@ -251,7 +273,8 @@ applet_factory (PanelApplet *applet,
   panel_applet_set_background_widget (applet, GTK_WIDGET (applet));
 
   gtk_container_add (GTK_CONTAINER (applet), GTK_WIDGET (tray));
-  
+  force_no_focus_padding (GTK_WIDGET (applet));
+
 #ifndef NOTIFICATION_AREA_INPROCESS
   gtk_window_set_default_icon_name (NOTIFICATION_AREA_ICON);
 #endif



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]