aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'widgets')
-rw-r--r--widgets/e-table/ChangeLog6
-rw-r--r--widgets/e-table/e-table-item.c2
-rw-r--r--widgets/e-table/e-table-selection-model.c13
-rw-r--r--widgets/e-table/e-table-selection-model.h4
-rw-r--r--widgets/table/e-table-item.c2
-rw-r--r--widgets/table/e-table-selection-model.c13
-rw-r--r--widgets/table/e-table-selection-model.h4
7 files changed, 44 insertions, 0 deletions
diff --git a/widgets/e-table/ChangeLog b/widgets/e-table/ChangeLog
index b420e86ddb..316e470c83 100644
--- a/widgets/e-table/ChangeLog
+++ b/widgets/e-table/ChangeLog
@@ -1,3 +1,9 @@
+2000-08-09 Christopher James Lahey <clahey@helixcode.com>
+
+ * e-table-item.c, e-table-selection-model.c,
+ e-table-selection-model.h: Make right click select if the current
+ row is not selected.
+
2000-08-08 Miguel de Icaza <miguel@helixcode.com>
* e-table-header-item.c: Tag some strings for translation.
diff --git a/widgets/e-table/e-table-item.c b/widgets/e-table/e-table-item.c
index baee6586f7..19a146de25 100644
--- a/widgets/e-table/e-table-item.c
+++ b/widgets/e-table/e-table-item.c
@@ -1417,6 +1417,8 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e)
gnome_canvas_item_w2i (item, &e->button.x, &e->button.y);
if (!find_cell (eti, e->button.x, e->button.y, &col, &row, &x1, &y1))
return TRUE;
+
+ e_table_selection_model_maybe_do_something(eti->selection, row, col, 0);
gtk_signal_emit (GTK_OBJECT (eti), eti_signals [RIGHT_CLICK],
row, col, e, &return_val);
diff --git a/widgets/e-table/e-table-selection-model.c b/widgets/e-table/e-table-selection-model.c
index a40298c992..09b1d6bf93 100644
--- a/widgets/e-table/e-table-selection-model.c
+++ b/widgets/e-table/e-table-selection-model.c
@@ -446,6 +446,19 @@ void e_table_selection_model_do_something (ETableSelectionModel
}
}
+void e_table_selection_model_maybe_do_something (ETableSelectionModel *selection,
+ guint row,
+ guint col,
+ GdkModifierType state)
+{
+ if (e_table_selection_model_is_row_selected(selection, row)) {
+ selection->cursor_row = row;
+ selection->cursor_col = col;
+ } else {
+ e_table_selection_model_do_something(selection, row, col, state);
+ }
+}
+
void
e_table_selection_model_clear(ETableSelectionModel *selection)
{
diff --git a/widgets/e-table/e-table-selection-model.h b/widgets/e-table/e-table-selection-model.h
index df2e377d14..6b57ab56f0 100644
--- a/widgets/e-table/e-table-selection-model.h
+++ b/widgets/e-table/e-table-selection-model.h
@@ -58,6 +58,10 @@ void e_table_selection_model_do_something (ETableSelectionModel *
guint row,
guint col,
GdkModifierType state);
+void e_table_selection_model_maybe_do_something (ETableSelectionModel *selection,
+ guint row,
+ guint col,
+ GdkModifierType state);
void e_table_selection_model_clear (ETableSelectionModel *selection);
ETableSelectionModel *e_table_selection_model_new (void);
diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c
index baee6586f7..19a146de25 100644
--- a/widgets/table/e-table-item.c
+++ b/widgets/table/e-table-item.c
@@ -1417,6 +1417,8 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e)
gnome_canvas_item_w2i (item, &e->button.x, &e->button.y);
if (!find_cell (eti, e->button.x, e->button.y, &col, &row, &x1, &y1))
return TRUE;
+
+ e_table_selection_model_maybe_do_something(eti->selection, row, col, 0);
gtk_signal_emit (GTK_OBJECT (eti), eti_signals [RIGHT_CLICK],
row, col, e, &return_val);
diff --git a/widgets/table/e-table-selection-model.c b/widgets/table/e-table-selection-model.c
index a40298c992..09b1d6bf93 100644
--- a/widgets/table/e-table-selection-model.c
+++ b/widgets/table/e-table-selection-model.c
@@ -446,6 +446,19 @@ void e_table_selection_model_do_something (ETableSelectionModel
}
}
+void e_table_selection_model_maybe_do_something (ETableSelectionModel *selection,
+ guint row,
+ guint col,
+ GdkModifierType state)
+{
+ if (e_table_selection_model_is_row_selected(selection, row)) {
+ selection->cursor_row = row;
+ selection->cursor_col = col;
+ } else {
+ e_table_selection_model_do_something(selection, row, col, state);
+ }
+}
+
void
e_table_selection_model_clear(ETableSelectionModel *selection)
{
diff --git a/widgets/table/e-table-selection-model.h b/widgets/table/e-table-selection-model.h
index df2e377d14..6b57ab56f0 100644
--- a/widgets/table/e-table-selection-model.h
+++ b/widgets/table/e-table-selection-model.h
@@ -58,6 +58,10 @@ void e_table_selection_model_do_something (ETableSelectionModel *
guint row,
guint col,
GdkModifierType state);
+void e_table_selection_model_maybe_do_something (ETableSelectionModel *selection,
+ guint row,
+ guint col,
+ GdkModifierType state);
void e_table_selection_model_clear (ETableSelectionModel *selection);
ETableSelectionModel *e_table_selection_model_new (void);