the window and not the canvas widget.
** changed copyright dates to 2012.
** psensor: fixed systray and application indicator visible at the
same time. (Closes LP: #971098)
** changed copyright dates to 2012.
** psensor: fixed systray and application indicator visible at the
same time. (Closes LP: #971098)
+** psensor: fixed wrong background color, get the background color of
+ the window and not the canvas widget.
int g_xoff, int g_yoff,
int g_width, int g_height,
int width, int height, struct config *config,
int g_xoff, int g_yoff,
int g_width, int g_height,
int width, int height, struct config *config,
+ GtkWidget *widget,
+ GtkWidget *window)
{
GtkStyleContext *style_ctx;
struct color *bgcolor;
{
GtkStyleContext *style_ctx;
struct color *bgcolor;
bgcolor = config->graph_bgcolor;
bgcolor = config->graph_bgcolor;
- style_ctx = gtk_widget_get_style_context(widget);
+ style_ctx = gtk_widget_get_style_context(window);
gtk_style_context_get_background_color(style_ctx,
GTK_STATE_FLAG_NORMAL,
&rgba);
gtk_style_context_get_background_color(style_ctx,
GTK_STATE_FLAG_NORMAL,
&rgba);
if (config->alpha_channel_enabled)
cairo_set_source_rgba(cr,
rgba.red,
if (config->alpha_channel_enabled)
cairo_set_source_rgba(cr,
rgba.red,
cairo_set_source_rgba(cr,
bgcolor->f_red,
bgcolor->f_green,
cairo_set_source_rgba(cr,
bgcolor->f_red,
bgcolor->f_green,
- bgcolor->f_blue, config->graph_bg_alpha);
+ bgcolor->f_blue,
+ config->graph_bg_alpha);
else
cairo_set_source_rgb(cr,
bgcolor->f_red,
else
cairo_set_source_rgb(cr,
bgcolor->f_red,
- bgcolor->f_green, bgcolor->f_blue);
-
-
+ bgcolor->f_green,
+ bgcolor->f_blue);
cairo_rectangle(cr, g_xoff, g_yoff, g_width, g_height);
cairo_fill(cr);
cairo_rectangle(cr, g_xoff, g_yoff, g_width, g_height);
cairo_fill(cr);
void
graph_update(struct psensor **sensors,
GtkWidget *w_graph,
void
graph_update(struct psensor **sensors,
GtkWidget *w_graph,
+ struct config *config,
+ GtkWidget *window)
{
struct color *fgcolor = config->graph_fgcolor;
int et, bt, width, height, g_width, g_height;
{
struct color *fgcolor = config->graph_fgcolor;
int et, bt, width, height, g_width, g_height;
cairo_text_extents_t te_btime, te_etime, te_max, te_min;
struct psensor **sensor_cur;
GtkAllocation galloc;
cairo_text_extents_t te_btime, te_etime, te_max, te_min;
struct psensor **sensor_cur;
GtkAllocation galloc;
+ GtkStyleContext *style_ctx;
+ GdkRGBA rgba;
if (!gtk_widget_is_drawable(w_graph))
return ;
if (!gtk_widget_is_drawable(w_graph))
return ;
draw_graph_background(cr,
g_xoff, g_yoff, g_width, g_height,
width, height, config,
draw_graph_background(cr,
g_xoff, g_yoff, g_width, g_height,
width, height, config,
- cairo_set_source_rgb(cr,
- fgcolor->f_red, fgcolor->f_green, fgcolor->f_blue);
+ /** Set the color for text drawing */
+ style_ctx = gtk_widget_get_style_context(w_graph);
+ gtk_style_context_get_color(style_ctx, GTK_STATE_FLAG_NORMAL, &rgba);
+ cairo_set_source_rgb(cr, rgba.red, rgba.green, rgba.blue);
/* draw graph begin time */
cairo_move_to(cr, g_xoff, height - GRAPH_V_PADDING);
/* draw graph begin time */
cairo_move_to(cr, g_xoff, height - GRAPH_V_PADDING);
#include "psensor.h"
#include "cfg.h"
#include "psensor.h"
#include "cfg.h"
-void graph_update(struct psensor **, GtkWidget *, struct config *config);
+void graph_update(struct psensor **,
+ GtkWidget *,
+ struct config *config,
+ GtkWidget *window);
g_mutex_lock(ui->sensors_mutex);
g_mutex_lock(ui->sensors_mutex);
- graph_update(ui->sensors, ui->w_graph, ui->config);
+ graph_update(ui->sensors, ui->w_graph, ui->config, ui->main_window);
ui_sensorlist_update(ui);
ui_sensorlist_update(ui);
struct ui_psensor *ui_psensor = (struct ui_psensor *)data;
graph_update(ui_psensor->sensors,
struct ui_psensor *ui_psensor = (struct ui_psensor *)data;
graph_update(ui_psensor->sensors,
- ui_psensor->w_graph, ui_psensor->config);
+ ui_psensor->w_graph,
+ ui_psensor->config,
+ ui_psensor->main_window);