[gnome-applets] multiload: don't set the size, it's not needed
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-applets] multiload: don't set the size, it's not needed
- Date: Tue, 13 Oct 2015 01:29:16 +0000 (UTC)
commit 7c88e54c82c01880ca807ee874c82d1710c69da7
Author: =?UTF-8?q?Ball=C3=B3=20Gy=C3=B6rgy?= <ballogyor gmail com>
Date: Sat Aug 22 09:28:42 2015 +0200
multiload: don't set the size, it's not needed
https://bugzilla.gnome.org/show_bug.cgi?id=753273
multiload/global.h | 4 +---
multiload/load-graph.c | 5 ++---
multiload/main.c | 19 -------------------
multiload/properties.c | 16 ++++++----------
4 files changed, 9 insertions(+), 35 deletions(-)
---
diff --git a/multiload/global.h b/multiload/global.h
index 43bab32..00b870b 100644
--- a/multiload/global.h
+++ b/multiload/global.h
@@ -69,7 +69,7 @@ struct _LoadGraph {
guint n, id;
guint speed, size;
- guint orient, pixel_size;
+ guint orient;
guint draw_width, draw_height;
LoadGraphDataFunc get_data;
@@ -121,8 +121,6 @@ struct _MultiloadApplet
GtkWidget *notebook;
int last_clicked;
- guint size;
-
GSettings *settings;
};
diff --git a/multiload/load-graph.c b/multiload/load-graph.c
index ac306f3..bc9ed5b 100644
--- a/multiload/load-graph.c
+++ b/multiload/load-graph.c
@@ -273,7 +273,7 @@ load_graph_new (MultiloadApplet *ma, guint n, const gchar *label,
{
LoadGraph *g;
PanelAppletOrient orient;
-
+
g = g_new0 (LoadGraph, 1);
g->netspeed_in = netspeed_new(g);
g->netspeed_out = netspeed_new(g);
@@ -283,11 +283,10 @@ load_graph_new (MultiloadApplet *ma, guint n, const gchar *label,
g->id = id;
g->speed = MAX (speed, 50);
g->size = MAX (size, 10);
- g->pixel_size = ma->size;
g->tooltip_update = FALSE;
g->show_frame = TRUE;
g->multiload = ma;
-
+
g->main_widget = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
g->box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
diff --git a/multiload/main.c b/multiload/main.c
index dbd33f0..56b8da9 100644
--- a/multiload/main.c
+++ b/multiload/main.c
@@ -177,23 +177,6 @@ start_procman_cb (GSimpleAction *action,
}
static void
-multiload_change_size_cb (PanelApplet *applet, GtkAllocation *allocation, gpointer data)
-{
- MultiloadApplet *ma = (MultiloadApplet *)data;
- PanelAppletOrient orient = panel_applet_get_orient (applet);
- gint old_size = ma->size;
-
- if (orient == PANEL_APPLET_ORIENT_LEFT || orient == PANEL_APPLET_ORIENT_RIGHT) {
- ma->size = allocation->width;
- } else {
- ma->size = allocation->height;
- }
-
- if (old_size != ma->size)
- multiload_applet_refresh(ma);
-}
-
-static void
multiload_change_orient_cb(PanelApplet *applet, gint arg1, gpointer data)
{
MultiloadApplet *ma = data;
@@ -523,8 +506,6 @@ multiload_applet_new(PanelApplet *applet, const gchar *iid, gpointer data)
g_object_unref (settings);
g_object_unref (action_group);
- g_signal_connect(G_OBJECT(applet), "size-allocate",
- G_CALLBACK(multiload_change_size_cb), ma);
g_signal_connect(G_OBJECT(applet), "change_orient",
G_CALLBACK(multiload_change_orient_cb), ma);
g_signal_connect(G_OBJECT(applet), "destroy",
diff --git a/multiload/properties.c b/multiload/properties.c
index 1f7e222..29dc718 100644
--- a/multiload/properties.c
+++ b/multiload/properties.c
@@ -161,17 +161,13 @@ spin_button_changed_cb(GtkWidget *widget, gpointer name)
for (i = 0; i < NGRAPHS; i++)
{
ma->graphs[i]->size = value ;
-
+
if (ma->graphs[i]->orient)
- gtk_widget_set_size_request (
- ma->graphs[i]->main_widget,
- ma->graphs[i]->pixel_size,
- ma->graphs[i]->size);
- else
- gtk_widget_set_size_request (
- ma->graphs[i]->main_widget,
- ma->graphs[i]->size,
- ma->graphs[i]->pixel_size);
+ gtk_widget_set_size_request (ma->graphs[i]->main_widget,
+ -1, ma->graphs[i]->size);
+ else
+ gtk_widget_set_size_request (ma->graphs[i]->main_widget,
+ ma->graphs[i]->size, -1);
}
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]