[libgda/LIBGDA_4.2] Corrected visual rendering of unknown data
- From: Vivien Malerba <vivien src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda/LIBGDA_4.2] Corrected visual rendering of unknown data
- Date: Sun, 24 Jul 2011 21:23:49 +0000 (UTC)
commit 1e34e89b11cec84abcd26b9caf11e515c5d0f556
Author: Vivien Malerba <malerba gnome-db org>
Date: Sun Jul 24 18:58:13 2011 +0200
Corrected visual rendering of unknown data
to avoid confusion with data known as invalid
.../data-entries/gdaui-data-cell-renderer-util.c | 3 ++-
libgda-ui/data-entries/gdaui-entry-wrapper.c | 4 ----
libgda-ui/data-entries/widget-embedder.c | 4 +++-
libgda-ui/gdaui-decl.h | 5 +++++
4 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/libgda-ui/data-entries/gdaui-data-cell-renderer-util.c b/libgda-ui/data-entries/gdaui-data-cell-renderer-util.c
index 1d32704..821ca28 100644
--- a/libgda-ui/data-entries/gdaui-data-cell-renderer-util.c
+++ b/libgda-ui/data-entries/gdaui-data-cell-renderer-util.c
@@ -18,6 +18,7 @@
*/
#include "gdaui-data-cell-renderer-util.h"
+#include <libgda-ui/gdaui-decl.h>
void
gdaui_data_cell_renderer_draw_invalid_area (GdkWindow *window, GdkRectangle *cell_area)
@@ -28,7 +29,7 @@ gdaui_data_cell_renderer_draw_invalid_area (GdkWindow *window, GdkRectangle *cel
cairo_rectangle (cr, cell_area->x, cell_area->y, cell_area->width, cell_area->height);
cairo_clip (cr);
- cairo_set_source_rgba (cr, .8, .1, .1, .2);
+ cairo_set_source_rgba (cr, GDAUI_COLOR_UNKNOWN_MASK);
cairo_rectangle (cr, cell_area->x, cell_area->y,
cell_area->width, cell_area->height);
cairo_fill (cr);
diff --git a/libgda-ui/data-entries/gdaui-entry-wrapper.c b/libgda-ui/data-entries/gdaui-entry-wrapper.c
index 8cc8736..b8d51dd 100644
--- a/libgda-ui/data-entries/gdaui-entry-wrapper.c
+++ b/libgda-ui/data-entries/gdaui-entry-wrapper.c
@@ -474,10 +474,8 @@ gdaui_entry_wrapper_set_value (GdauiDataEntry *iface, const GValue *value)
mgwrap->priv->null_forced = TRUE;
else
mgwrap->priv->null_forced = FALSE;
- gdaui_entry_shell_set_unknown ((GdauiEntryShell*) iface, FALSE);
}
else {
- gdaui_entry_shell_set_unknown ((GdauiEntryShell*) iface, TRUE);
(*mgwrap->priv->real_class->real_set_value) (mgwrap, NULL);
mgwrap->priv->null_forced = TRUE;
}
@@ -713,8 +711,6 @@ gdaui_entry_wrapper_set_attributes (GdauiDataEntry *iface, GdaValueAttribute att
g_warning ("Having an original value is not a write attribute on GdauiDataEntry!");
current = gdaui_data_entry_get_attributes (iface);
- gdaui_entry_shell_set_unknown ((GdauiEntryShell*) iface,
- current & GDA_VALUE_ATTR_DATA_NON_VALID ? TRUE : FALSE);
if (signal_contents_changed) {
mgwrap->priv->contents_has_changed = FALSE;
diff --git a/libgda-ui/data-entries/widget-embedder.c b/libgda-ui/data-entries/widget-embedder.c
index 1221eca..b6de50d 100644
--- a/libgda-ui/data-entries/widget-embedder.c
+++ b/libgda-ui/data-entries/widget-embedder.c
@@ -19,6 +19,8 @@
*/
#include "widget-embedder.h"
#if GTK_CHECK_VERSION (2,20,0)
+#include <gdaui-decl.h>
+
static void widget_embedder_realize (GtkWidget *widget);
static void widget_embedder_unrealize (GtkWidget *widget);
static void widget_embedder_size_request (GtkWidget *widget,
@@ -392,7 +394,7 @@ widget_embedder_expose (GtkWidget *widget,
cairo_paint (cr);
if (! bin->valid) {
- cairo_set_source_rgba (cr, .8, .1, .1, .2);
+ cairo_set_source_rgba (cr, GDAUI_COLOR_UNKNOWN_MASK);
cairo_rectangle (cr, child_area.x, child_area.y,
child_area.width, child_area.height);
cairo_fill (cr);
diff --git a/libgda-ui/gdaui-decl.h b/libgda-ui/gdaui-decl.h
index 086e28d..dc2cfb8 100644
--- a/libgda-ui/gdaui-decl.h
+++ b/libgda-ui/gdaui-decl.h
@@ -42,4 +42,9 @@ typedef struct _GdauiDataProxyIface GdauiDataProxyIface;
#define GDAUI_COLOR_NORMAL_INVALID "#ff6a6a"
#define GDAUI_COLOR_PRELIGHT_INVALID "#ff7b7b"
+/*
+ * Data of unknown status (no value available)
+ */
+#define GDAUI_COLOR_UNKNOWN_MASK .3, .3, .3, .6
+
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]