gnome-system-monitor r2273 - trunk/src



Author: bdejean
Date: Sat Jan 12 16:30:16 2008
New Revision: 2273
URL: http://svn.gnome.org/viewvc/gnome-system-monitor?rev=2273&view=rev

Log:
No need to look for the main notebook (to get its style).
Instead, we store it in ProcData::notebook.


Modified:
   trunk/src/interface.cpp
   trunk/src/load-graph.cpp
   trunk/src/procman.h

Modified: trunk/src/interface.cpp
==============================================================================
--- trunk/src/interface.cpp	(original)
+++ trunk/src/interface.cpp	Sat Jan 12 16:30:16 2008
@@ -687,7 +687,7 @@
 
 
 	/* create the main notebook */
-	notebook = gtk_notebook_new ();
+	procdata->notebook = notebook = gtk_notebook_new ();
   	gtk_box_pack_start (GTK_BOX (main_box), 
 	                    notebook, 
 	                    TRUE, 

Modified: trunk/src/load-graph.cpp
==============================================================================
--- trunk/src/load-graph.cpp	(original)
+++ trunk/src/load-graph.cpp	Sat Jan 12 16:30:16 2008
@@ -60,7 +60,6 @@
 	guint graph_buffer_offset;
 
 	GdkColor *colors;
-	GtkWidget *notebook;
 
 	gfloat* data_block;
 	gfloat* data[NUM_POINTS];
@@ -153,7 +152,7 @@
 	tmp_cr = cairo_create (g->background_buffer);
 
 	// set the background colour
-	GtkStyle *style = gtk_widget_get_style (g->notebook);
+	GtkStyle *style = gtk_widget_get_style (ProcData::get_instance()->notebook);
 	gdk_cairo_set_source_color (tmp_cr, &style->bg[GTK_STATE_NORMAL]);
 	cairo_paint (tmp_cr);
 
@@ -810,21 +809,6 @@
 
 	gtk_widget_show_all (g->main_widget);
 
-        /* GtkStyle gives us the theme background color, we also have
-         * to trawl through parent widgets to get to GtkNotebook
-         * *sigh*
-         */
-        g->notebook = g->main_widget;
-        while (g_ascii_strncasecmp(gtk_widget_get_name(g->notebook),
-                                   "GtkNotebook", 12)) {
-                g->notebook = gtk_widget_get_parent(g->notebook);
-                if (g->notebook == NULL) {
-                        // Fall back to using the main_widget for styles
-                        g->notebook = g->main_widget;
-                        break;
-                }
-        }
-        
 	load_graph_start(g);
 	load_graph_stop(g);
 	

Modified: trunk/src/procman.h
==============================================================================
--- trunk/src/procman.h	(original)
+++ trunk/src/procman.h	Sat Jan 12 16:30:16 2008
@@ -180,6 +180,7 @@
 	GtkWidget	*endprocessbutton;
 	GtkWidget	*popup_menu;
 	GtkWidget	*disk_list;
+	GtkWidget	*notebook;
 	ProcConfig	config;
 	LoadGraph	*cpu_graph;
 	LoadGraph	*mem_graph;



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