Fixed redrawing causing corruption of background.
authorjon <jon@jdtp.(none)>
Sun, 20 Mar 2011 15:46:38 +0000 (15:46 +0000)
committerjon <jon@jdtp.(none)>
Sun, 20 Mar 2011 15:46:38 +0000 (15:46 +0000)
lib-stock-home-widget.c
lib-stock-home-widget.h

index 628d73f..3ee9f82 100644 (file)
@@ -46,7 +46,7 @@ OnClickRefresh(GtkWidget *widget, GdkEventButton *event, StockPluginContext *psC
                                        psContext->psSettings->ppszTickers[0],fPrice,pszColour,fChange,szTime);
 
                        gtk_label_set_markup(GTK_LABEL(psContext->psLabel),szBuffer);
                                        psContext->psSettings->ppszTickers[0],fPrice,pszColour,fChange,szTime);
 
                        gtk_label_set_markup(GTK_LABEL(psContext->psLabel),szBuffer);
-                       gtk_widget_queue_draw(GTK_WIDGET(psContext->psLabel));
+                       gtk_widget_queue_draw(GTK_WIDGET(psContext->psParent));
                }
                /*
                  If it fails, leave the old price as the user can see the timestamp
                }
                /*
                  If it fails, leave the old price as the user can see the timestamp
@@ -286,7 +286,7 @@ static GtkWidget *stock_create_gui(gchar                            *pszStockLabel,
        eventbox = gtk_event_box_new();
 
        gtk_event_box_set_visible_window(GTK_EVENT_BOX(eventbox),FALSE);
        eventbox = gtk_event_box_new();
 
        gtk_event_box_set_visible_window(GTK_EVENT_BOX(eventbox),FALSE);
-       gtk_container_set_border_width(GTK_CONTAINER(eventbox),3);
+       gtk_container_set_border_width(GTK_CONTAINER(eventbox),10);
 
        gtk_container_add(GTK_CONTAINER(eventbox),label);
 
 
        gtk_container_add(GTK_CONTAINER(eventbox),label);
 
@@ -364,6 +364,7 @@ stock_plugin_init (StockPlugin *desktop_plugin)
        
        psContext->hSG          = hSG;
        psContext->nTimerID = -1;
        
        psContext->hSG          = hSG;
        psContext->nTimerID = -1;
+       psContext->psParent = GTK_WIDGET(desktop_plugin);
 
        /* Assign private data to plugin */
        desktop_plugin->context = psContext;
 
        /* Assign private data to plugin */
        desktop_plugin->context = psContext;
@@ -443,7 +444,11 @@ stock_plugin_expose(GtkWidget* widget, GdkEventExpose *event)
        DebugOut(("X: %d Y: %d Width: %d Height %d",psRect->x,psRect->y,psRect->width,psRect->height));
        
        cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0.5);
        DebugOut(("X: %d Y: %d Width: %d Height %d",psRect->x,psRect->y,psRect->width,psRect->height));
        
        cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0.5);
+       #if 1
        cairo_rounded_rectangle(cr, 0, 0, width, height, 10.0);
        cairo_rounded_rectangle(cr, 0, 0, width, height, 10.0);
+       #else
+       cairo_rectangle(cr, 0, 0, width, height);
+       #endif
        cairo_fill(cr);
        
        cairo_destroy(cr);
        cairo_fill(cr);
        
        cairo_destroy(cr);
@@ -454,10 +459,8 @@ static void
 stock_plugin_class_init (StockPluginClass *klass)
 {
        GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
 stock_plugin_class_init (StockPluginClass *klass)
 {
        GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
-       #if 1
        widget_class->realize                   = stock_plugin_realize;
        widget_class->expose_event              = stock_plugin_expose;
        widget_class->realize                   = stock_plugin_realize;
        widget_class->expose_event              = stock_plugin_expose;
-       #endif
        G_OBJECT_CLASS(klass)->finalize = stock_plugin_finalize;
 }
 
        G_OBJECT_CLASS(klass)->finalize = stock_plugin_finalize;
 }
 
index 0c2fbf4..1f48194 100644 (file)
@@ -36,6 +36,7 @@ typedef struct _StockPluginContext
        /* Used for updating when stock price changes */
        GtkWidget       *psLabel;
        GtkWidget       *psEventBox;
        /* Used for updating when stock price changes */
        GtkWidget       *psLabel;
        GtkWidget       *psEventBox;
+       GtkWidget       *psParent;
 
        /* Stock Getter Handle */
        SGHandle hSG;
 
        /* Stock Getter Handle */
        SGHandle hSG;