Don't use gtk_container_set_border_width() on plugins main widgets, panel sets it...
authorAndriy Grytsenko <andrej@rep.kiev.ua>
Fri, 5 Dec 2014 21:49:40 +0000 (23:49 +0200)
committerAndriy Grytsenko <andrej@rep.kiev.ua>
Fri, 5 Dec 2014 21:49:40 +0000 (23:49 +0200)
14 files changed:
plugins/batt/batt.c
plugins/cpu/cpu.c
plugins/cpufreq/cpufreq.c
plugins/deskno/deskno.c
plugins/dirmenu.c
plugins/launchtaskbar.c
plugins/menu.c
plugins/monitors/monitors.c
plugins/separator.c
plugins/space.c
plugins/thermal/thermal.c
plugins/tray.c
plugins/wincmd.c
src/plugin.c

index 15ca557..42eda69 100644 (file)
@@ -386,7 +386,7 @@ static gint configureEvent(GtkWidget *widget, GdkEventConfigure *event,
     /* Perform an update so the bar will look right in its new orientation */
     update_display(lx_b, FALSE);
 
-    /* we enforce border width here as it seems GtkEventBox doesn't apply it initially */
+    /* we enforce border width here because panel sets it to 0 */
     gtk_container_set_border_width(lx_b->box, lx_b->border);
 
     RET(TRUE);
@@ -504,7 +504,6 @@ static GtkWidget * constructor(LXPanel *panel, config_setting_t *settings)
         lx_b->height = lx_b->thickness;
         gtk_widget_set_size_request(lx_b->drawingArea, -1, lx_b->height);
     }
-    gtk_container_set_border_width(lx_b->box, lx_b->border);
 
     g_signal_connect (G_OBJECT (lx_b->drawingArea),"configure-event",
           G_CALLBACK (configureEvent), (gpointer) lx_b);
index 5dfb5f8..721aa9d 100644 (file)
@@ -238,7 +238,6 @@ static GtkWidget *cpu_constructor(LXPanel *panel, config_setting_t *settings)
     p = gtk_event_box_new();
     gtk_widget_set_has_window(p, FALSE);
     lxpanel_plugin_set_data(p, c, cpu_destructor);
-    gtk_container_set_border_width(GTK_CONTAINER(p), 1);
 
     /* Allocate drawing area as a child of top level widget.  Enable button press events. */
     c->da = gtk_drawing_area_new();
index c61f137..192c7bd 100644 (file)
@@ -350,7 +350,6 @@ static GtkWidget *cpufreq_constructor(LXPanel *panel, config_setting_t *settings
 
     cf->main = lxpanel_button_new_for_icon(panel, PROC_ICON, NULL, NULL);
     lxpanel_plugin_set_data(cf->main, cf, cpufreq_destructor);
-    gtk_container_set_border_width(GTK_CONTAINER(cf->main), 2);
 
     cf->has_cpufreq = 0;
 
index 765d064..e3bd1be 100644 (file)
@@ -125,7 +125,6 @@ static GtkWidget *deskno_constructor(LXPanel *panel, config_setting_t *settings)
     /* Allocate top level widget and set into Plugin widget pointer. */
     p = gtk_event_box_new();
     lxpanel_plugin_set_data(p, dc, deskno_destructor);
-    gtk_container_set_border_width(GTK_CONTAINER (p), 1);
 
     /* Allocate label widget and add to top level. */
     dc->label = gtk_label_new(NULL);
index 7ca6cfb..125b5e1 100644 (file)
@@ -279,7 +279,6 @@ static GtkWidget *dirmenu_constructor(LXPanel *panel, config_setting_t *settings
                             ((dm->image != NULL) ? dm->image : "file-manager"),
                             NULL, "Temp");
     lxpanel_plugin_set_data(p, dm, dirmenu_destructor);
-    gtk_container_set_border_width(GTK_CONTAINER(p), 0);
 
     /* Initialize the widget. */
     dirmenu_apply_configuration(p);
index 9b42843..ef816e4 100644 (file)
@@ -724,7 +724,6 @@ static void launchtaskbar_constructor_task(LaunchTaskBarPlugin *ltbp)
                                                  panel_get_height(ltbp->panel));
         panel_icon_grid_set_constrain_width(PANEL_ICON_GRID(ltbp->tb_icon_grid), TRUE);
         gtk_box_pack_start(GTK_BOX(ltbp->plugin), ltbp->tb_icon_grid, TRUE, TRUE, 0);
-        gtk_container_set_border_width(GTK_CONTAINER(ltbp->tb_icon_grid), 0);
         taskbar_update_style(ltbp);
 
         /* Add GDK event filter. */
@@ -807,9 +806,6 @@ static GtkWidget *_launchtaskbar_constructor(LXPanel *panel, config_setting_t *s
                                              3, 0, panel_get_height(panel));
     gtk_box_pack_start(GTK_BOX(p), ltbp->lb_icon_grid, FALSE, TRUE, 0);
 
-    gtk_container_set_border_width(GTK_CONTAINER(p), 0);
-    gtk_container_set_border_width(GTK_CONTAINER(ltbp->lb_icon_grid), 0);
-
     /* Read parameters from the configuration file. */
     config_setting_lookup_int(settings, "LaunchTaskBarMode", &ltbp->mode);
     switch (ltbp->mode) {
index 2093dec..dd738f8 100644 (file)
@@ -925,7 +925,6 @@ menu_constructor(LXPanel *panel, config_setting_t *settings)
     m->box = gtk_event_box_new();
     gtk_widget_set_has_window(m->box, FALSE);
     lxpanel_plugin_set_data(m->box, m, menu_destructor);
-    gtk_container_set_border_width(GTK_CONTAINER(m->box), 0);
 
     /* Save construction pointers */
     m->panel = panel;
index ccf8395..f491bf3 100644 (file)
@@ -619,7 +619,6 @@ monitors_constructor(LXPanel *panel, config_setting_t *settings)
 
     p = gtk_hbox_new(TRUE, 2);
     lxpanel_plugin_set_data(p, mp, monitors_destructor);
-    gtk_container_set_border_width(GTK_CONTAINER(p), 1);
 
     /* First time we use this plugin : only display CPU usage */
     mp->displayed_monitors[CPU_POSITION] = 1;
index b6ce9b3..24bc4f3 100644 (file)
@@ -29,7 +29,6 @@ static GtkWidget *separator_constructor(LXPanel *panel, config_setting_t *settin
     instance = gtk_event_box_new();
     gtk_widget_set_has_window(instance, FALSE);
     gtk_widget_add_events(instance, GDK_BUTTON_PRESS_MASK);
-    gtk_container_set_border_width(GTK_CONTAINER(instance), 1);
 
     /* Allocate separator as a child of top level. */
     sep = panel_separator_new(panel);
index 9433ae8..2b84196 100644 (file)
@@ -54,7 +54,6 @@ static GtkWidget *space_constructor(LXPanel *panel, config_setting_t *settings)
     lxpanel_plugin_set_data(p, sp, g_free);
     gtk_widget_set_has_window(p,FALSE);
     gtk_widget_add_events(p, GDK_BUTTON_PRESS_MASK);
-    gtk_container_set_border_width(GTK_CONTAINER(p), 0);
 
     /* Apply the configuration and show the widget. */
     space_apply_configuration(p);
index 98a2cba..839bf04 100644 (file)
@@ -506,7 +506,6 @@ thermal_constructor(LXPanel *panel, config_setting_t *settings)
     p = gtk_event_box_new();
     lxpanel_plugin_set_data(p, th, thermal_destructor);
     gtk_widget_set_has_window(p, FALSE);
-    gtk_container_set_border_width( GTK_CONTAINER(p), 2 );
 
     th->namew = gtk_label_new("ww");
     gtk_container_add(GTK_CONTAINER(p), th->namew);
index 47e148e..0b5a83b 100644 (file)
@@ -635,7 +635,6 @@ static GtkWidget *tray_constructor(LXPanel *panel, config_setting_t *settings)
                                          3, 0, panel_get_height(panel));
     lxpanel_plugin_set_data(p, tr, tray_destructor);
     gtk_widget_set_name(p, "tray");
-    gtk_container_set_border_width(GTK_CONTAINER(p), 1);
     panel_icon_grid_set_aspect_width(PANEL_ICON_GRID(p), TRUE);
 
     return p;
index 4d79c18..a5b34b5 100644 (file)
@@ -185,7 +185,6 @@ static GtkWidget *wincmd_constructor(LXPanel *panel, config_setting_t *settings)
     /* Allocate top level widget and set into Plugin widget pointer. */
     p = lxpanel_button_new_for_icon(panel, wc->image, NULL, NULL);
     lxpanel_plugin_set_data(p, wc, wincmd_destructor);
-    gtk_container_set_border_width(GTK_CONTAINER(p), 0);
     gtk_widget_set_tooltip_text(p, _("Left click to iconify all windows.  Middle click to shade them."));
 
     /* Show the widget and return. */
index f334a80..d48aa35 100644 (file)
@@ -518,6 +518,7 @@ GtkWidget *lxpanel_add_plugin(LXPanel *p, const char *name, config_setting_t *cf
     if (s)
         padding = config_setting_get_int(s);
     s = config_setting_get_member(cfg, "border");
+    /* FIXME: this is useless setting, it should be 0 or panel becomes weird */
     if (s)
         border = config_setting_get_int(s);
     /* prepare config and create it if need */