[libgda/LIBGDA_4.2] Gdaui: misc. corrections
- From: Vivien Malerba <vivien src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda/LIBGDA_4.2] Gdaui: misc. corrections
- Date: Thu, 29 Dec 2011 17:43:46 +0000 (UTC)
commit 4042ed9ed463a4d1a313f4291b9d6c94b177007b
Author: Vivien Malerba <malerba gnome-db org>
Date: Thu Dec 29 18:42:31 2011 +0100
Gdaui: misc. corrections
libgda-ui/gdaui-basic-form.c | 10 ++++++++++
libgda-ui/gdaui-rt-editor.c | 23 ++++++++++++++++++++---
2 files changed, 30 insertions(+), 3 deletions(-)
---
diff --git a/libgda-ui/gdaui-basic-form.c b/libgda-ui/gdaui-basic-form.c
index 1de008c..78f8e45 100644
--- a/libgda-ui/gdaui-basic-form.c
+++ b/libgda-ui/gdaui-basic-form.c
@@ -1640,6 +1640,16 @@ parameter_changed_cb (GdaHolder *param, SingleEntry *sentry)
else
gdaui_entry_shell_set_unknown (GDAUI_ENTRY_SHELL (entry),
!gda_holder_is_valid (param));
+
+ /* correctly update the NULLOK status */
+ GdaValueAttribute attr;
+ gboolean nullok;
+ attr = gdaui_data_entry_get_attributes (entry);
+ nullok = !gda_holder_get_not_null (param);
+ if (((attr & GDA_VALUE_ATTR_CAN_BE_NULL) && !nullok) ||
+ (! (attr & GDA_VALUE_ATTR_CAN_BE_NULL) && nullok))
+ gdaui_data_entry_set_attributes (entry, nullok ? GDA_VALUE_ATTR_CAN_BE_NULL : 0,
+ GDA_VALUE_ATTR_CAN_BE_NULL);
}
/**
diff --git a/libgda-ui/gdaui-rt-editor.c b/libgda-ui/gdaui-rt-editor.c
index 2d8ef21..1b10a80 100644
--- a/libgda-ui/gdaui-rt-editor.c
+++ b/libgda-ui/gdaui-rt-editor.c
@@ -287,6 +287,13 @@ text_view_realized_cb (GtkWidget *tv, GdauiRtEditor *rte)
}
}
+static gboolean
+focus_changed_cb (GtkWidget *textview, GdkEventFocus *ev, GdauiRtEditor *rte)
+{
+ show_hide_toolbar (rte);
+ return FALSE;
+}
+
static void
gdaui_rt_editor_init (GdauiRtEditor *rte)
{
@@ -324,6 +331,10 @@ gdaui_rt_editor_init (GdauiRtEditor *rte)
G_CALLBACK (insert_text_after_cb), rte);
g_signal_connect (rte->priv->textview, "populate-popup",
G_CALLBACK (populate_popup_cb), rte);
+ g_signal_connect (rte->priv->textview, "focus-in-event",
+ G_CALLBACK (focus_changed_cb), rte);
+ g_signal_connect (rte->priv->textview, "focus-out-event",
+ G_CALLBACK (focus_changed_cb), rte);
/* tags. REM: leave the LIST* and BULLET tags defined 1st as they will be with less priority
* and it affects the result returned by gtk_text_iter_get_tags() */
@@ -389,7 +400,8 @@ gdaui_rt_editor_init (GdauiRtEditor *rte)
gtk_toolbar_set_icon_size (GTK_TOOLBAR (toolbar), GTK_ICON_SIZE_MENU);
rte->priv->toolbar = toolbar;
gtk_box_pack_end (GTK_BOX (rte), toolbar, FALSE, FALSE, 0);
- gtk_widget_show (toolbar);
+
+ show_hide_toolbar (rte);
}
/**
@@ -1948,8 +1960,13 @@ show_hide_toolbar (GdauiRtEditor *editor)
{
gboolean enable_markup = TRUE;
GtkAction *action;
-
- if (gtk_text_view_get_editable (editor->priv->textview))
+ gboolean doshow = FALSE;
+
+ if (gtk_text_view_get_editable (editor->priv->textview) &&
+ gtk_widget_has_focus (GTK_WIDGET (editor->priv->textview)))
+ doshow = TRUE;
+
+ if (doshow)
gtk_widget_show (editor->priv->toolbar);
else
gtk_widget_hide (editor->priv->toolbar);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]