diff options
-rw-r--r-- | plugins/gtkui/ddbcellrenderertextmultiline.c | 5 | ||||
-rw-r--r-- | plugins/gtkui/ddbcellrenderertextmultiline.vala | 22 |
2 files changed, 3 insertions, 24 deletions
diff --git a/plugins/gtkui/ddbcellrenderertextmultiline.c b/plugins/gtkui/ddbcellrenderertextmultiline.c index f9e9c43a..4a573705 100644 --- a/plugins/gtkui/ddbcellrenderertextmultiline.c +++ b/plugins/gtkui/ddbcellrenderertextmultiline.c @@ -25,9 +25,9 @@ #include <gtk/gtk.h> #include <stdlib.h> #include <string.h> -#include <stdio.h> #include <gdk/gdkkeysyms.h> #include <gdk/gdk.h> +#include <stdio.h> #define DDB_TYPE_CELL_EDITABLE_TEXT_VIEW (ddb_cell_editable_text_view_get_type ()) @@ -112,10 +112,9 @@ static gboolean ddb_cell_editable_text_view_real_key_press_event (GtkWidget* bas gboolean result = FALSE; gboolean res; self = (DdbCellEditableTextView*) base; - fprintf (stdout, "key_press_event\n"); res = TRUE; if ((*event).keyval == GDK_Return) { - if (((*event).state & GDK_CONTROL_MASK) != 0) { + if (((*event).state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) != 0) { res = GTK_WIDGET_CLASS (ddb_cell_editable_text_view_parent_class)->key_press_event ((GtkWidget*) GTK_TEXT_VIEW (self), event); } else { gtk_cell_editable_editing_done ((GtkCellEditable*) self); diff --git a/plugins/gtkui/ddbcellrenderertextmultiline.vala b/plugins/gtkui/ddbcellrenderertextmultiline.vala index c19a1297..a19a0f53 100644 --- a/plugins/gtkui/ddbcellrenderertextmultiline.vala +++ b/plugins/gtkui/ddbcellrenderertextmultiline.vala @@ -23,12 +23,10 @@ namespace Ddb { public bool editing_canceled = false; public string tree_path; -// private bool on_key_press_event (Gdk.EventKey event) { private override bool key_press_event (Gdk.EventKey event) { - stdout.printf ("key_press_event\n"); bool res = true; if (event.keyval == Gdk.KeySyms.Return) { - if ((event.state & Gdk.ModifierType.CONTROL_MASK) != 0) { + if ((event.state & (Gdk.ModifierType.CONTROL_MASK | Gdk.ModifierType.SHIFT_MASK)) != 0) { res = base.key_press_event (event); } else { @@ -46,29 +44,11 @@ namespace Ddb { else { res = base.key_press_event (event); } - /**** seems like auto-adjusting height is impossible when inside of cellrenderer - // test buffer height - Gtk.TextBuffer buf = get_buffer (); - Gtk.TextIter begin, end; - buf.get_iter_at_offset (out begin, 0); - buf.get_iter_at_offset (out end, -1); - int y_begin, y_end; - int h_begin, h_end; - get_line_yrange (begin, out y_begin, out h_begin); - get_line_yrange (end, out y_end, out h_end); - stdout.printf ("new y: %d %d, %d %d\n", y_begin, h_begin, y_end, h_end); - if (allocation.height < y_end) { - stdout.printf ("set_size_request %d\n", y_end + h_end); - set_size_request (-1, y_end + h_end); - } - */ return res; } public void start_editing (Gdk.Event event) { - // override keypress -// key_press_event.connect (on_key_press_event); } } |