[banshee/a11y: 16/27] [a11y] reverted commit below, and added ListView.ActiveColumn[Changed]
- From: Gabriel Burt <gburt src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [banshee/a11y: 16/27] [a11y] reverted commit below, and added ListView.ActiveColumn[Changed]
- Date: Tue, 6 Oct 2009 00:22:20 +0000 (UTC)
commit 8eef000c93811e56d667bd9f9535a20b8c5ac5e2
Author: Eitan Isaacson <eitan ascender com>
Date: Sun Oct 4 14:40:11 2009 -0700
[a11y] reverted commit below, and added ListView.ActiveColumn[Changed]
Revert "[a11y] Renamed FocusedIndex to FocusedRowIndex."
This reverts commit 1e1ebe1110820902b2314f108289606be9d18ac0.
Conflicts:
src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Interaction.cs
src/Libraries/Hyena/Hyena.Collections/Selection.cs
.../Banshee.Collection.Gui/BaseTrackListView.cs | 2 +-
.../Banshee.Gui/PlaybackActions.cs | 2 +-
.../Banshee.Podcasting.Gui/PodcastActions.cs | 2 +-
.../Accessibility/ListViewAccessible.cs | 11 ++--
.../ListView/ListView_Interaction.cs | 60 ++++++++++++--------
.../Hyena.Data.Gui/ListView/ListView_Rendering.cs | 6 +-
src/Libraries/Hyena/Hyena.Collections/Selection.cs | 24 ++------
.../Hyena/Hyena.Data.Sqlite/SqliteModelCache.cs | 8 +-
src/Libraries/Hyena/Hyena.Data/BaseListModel.cs | 2 +-
9 files changed, 59 insertions(+), 58 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/BaseTrackListView.cs b/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/BaseTrackListView.cs
index 8804009..fb52f7e 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/BaseTrackListView.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/BaseTrackListView.cs
@@ -141,7 +141,7 @@ namespace Banshee.Collection.Gui
Selection.Clear (false);
Selection.QuietSelect (current_index);
- Selection.FocusedRowIndex = current_index;
+ Selection.FocusedIndex = current_index;
if (old_index == -1 || IsRowVisible (old_index)) {
CenterOn (current_index);
diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui/PlaybackActions.cs b/src/Core/Banshee.ThickClient/Banshee.Gui/PlaybackActions.cs
index 9014cc3..ae35070 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Gui/PlaybackActions.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui/PlaybackActions.cs
@@ -259,7 +259,7 @@ namespace Banshee.Gui
ServiceManager.SourceManager.SetActiveSource (src);
track_src.TrackModel.Selection.Clear (false);
track_src.TrackModel.Selection.Select (i);
- track_src.TrackModel.Selection.FocusedRowIndex = i;
+ track_src.TrackModel.Selection.FocusedIndex = i;
track_list.CenterOn (i);
track_list.GrabFocus ();
}
diff --git a/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/PodcastActions.cs b/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/PodcastActions.cs
index c307e63..1a137e1 100644
--- a/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/PodcastActions.cs
+++ b/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/PodcastActions.cs
@@ -535,7 +535,7 @@ namespace Banshee.Podcasting.Gui
int new_i = ActiveDbSource.TrackModel.IndexOf (new_selection_track);
if (new_i != -1) {
ActiveDbSource.TrackModel.Selection.Clear (false);
- ActiveDbSource.TrackModel.Selection.FocusedRowIndex = new_i;
+ ActiveDbSource.TrackModel.Selection.FocusedIndex = new_i;
ActiveDbSource.TrackModel.Selection.Select (new_i);
}
}
diff --git a/src/Libraries/Hyena.Gui/Hyena.Data.Gui/Accessibility/ListViewAccessible.cs b/src/Libraries/Hyena.Gui/Hyena.Data.Gui/Accessibility/ListViewAccessible.cs
index cf250ac..ce780fb 100644
--- a/src/Libraries/Hyena.Gui/Hyena.Data.Gui/Accessibility/ListViewAccessible.cs
+++ b/src/Libraries/Hyena.Gui/Hyena.Data.Gui/Accessibility/ListViewAccessible.cs
@@ -28,8 +28,8 @@ namespace Hyena.Data.Gui.Accessibility
list_view.Model.Reloaded += (o, a) => OnModelChanged ();
OnModelChanged ();
- list_view.Selection.FocusRowChanged += OnSelectionFocusChanged;
- list_view.Selection.FocusColumnChanged += OnSelectionFocusChanged;
+ list_view.Selection.FocusChanged += OnSelectionFocusChanged;
+ list_view.ActiveColumnChanged += OnSelectionFocusChanged;
ListViewAccessible_Selection ();
ListViewAccessible_Table ();
@@ -106,10 +106,9 @@ namespace Hyena.Data.Gui.Accessibility
Atk.Object cell;
if (list_view.HeaderFocused)
- cell = OnRefChild (list_view.Selection.FocusedColumnIndex);
+ cell = OnRefChild (list_view.ActiveColumn);
else
- cell = RefAt (list_view.Selection.FocusedRowIndex,
- list_view.Selection.FocusedColumnIndex);
+ cell = RefAt (list_view.Selection.FocusedIndex, list_view.ActiveColumn);
GLib.Signal.Emit (this, "active-descendant-changed", cell.Handle);
}
@@ -173,7 +172,7 @@ namespace Hyena.Data.Gui.Accessibility
int row = cell_index/NColumns;
- return row == list_view.Selection.FocusedRowIndex;
+ return row == list_view.Selection.FocusedIndex;
}
public bool IsCellSelected (ColumnCellAccessible cell)
diff --git a/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Interaction.cs b/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Interaction.cs
index 9c2ec10..579ec4d 100644
--- a/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Interaction.cs
+++ b/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Interaction.cs
@@ -37,8 +37,7 @@ namespace Hyena.Data.Gui
{
public partial class ListView<T> : ListViewBase
{
- bool header_focused = false;
-
+ private bool header_focused = false;
public bool HeaderFocused {
get { return header_focused; }
set {
@@ -48,6 +47,21 @@ namespace Hyena.Data.Gui
}
}
+ #pragma warning disable 0067
+ public event EventHandler ActiveColumnChanged;
+ #pragma warning restore 0067
+
+ private int active_column = 0;
+ public int ActiveColumn {
+ get { return active_column; }
+ set {
+ active_column = value;
+ EventHandler handler = ActiveColumnChanged;
+ if (handler != null)
+ handler (this, EventArgs.Empty);
+ }
+ }
+
private Adjustment vadjustment;
public Adjustment Vadjustment {
get { return vadjustment; }
@@ -87,7 +101,7 @@ namespace Hyena.Data.Gui
int row_limit;
if (relative_row < 0) {
- if (Selection.FocusedRowIndex == -1) {
+ if (Selection.FocusedIndex == -1) {
return false;
}
@@ -96,11 +110,11 @@ namespace Hyena.Data.Gui
row_limit = Model.Count - 1;
}
- if (Selection.FocusedRowIndex == row_limit) {
+ if (Selection.FocusedIndex == row_limit) {
return true;
}
- int row_index = Math.Min (Model.Count - 1, Math.Max (0, Selection.FocusedRowIndex + relative_row));
+ int row_index = Math.Min (Model.Count - 1, Math.Max (0, Selection.FocusedIndex + relative_row));
if (Selection != null) {
if ((modifier & Gdk.ModifierType.ControlMask) != 0) {
@@ -111,10 +125,10 @@ namespace Hyena.Data.Gui
// Otherwise, select the new row and scroll etc as necessary.
if (relative_row * relative_row != 1) {
Selection.SelectFromFirst (row_index, true);
- } else if (Selection.Contains (Selection.FocusedRowIndex)) {
+ } else if (Selection.Contains (Selection.FocusedIndex)) {
Selection.SelectFromFirst (row_index, true);
} else {
- Selection.Select (Selection.FocusedRowIndex);
+ Selection.Select (Selection.FocusedIndex);
return true;
}
} else {
@@ -132,10 +146,10 @@ namespace Hyena.Data.Gui
ScrollTo (y_at_row + RowHeight - (vadjustment.PageSize));
}
} else if (vadjustment != null) {
- ScrollTo (vadjustment.Value + ((row_index - Selection.FocusedRowIndex) * RowHeight));
+ ScrollTo (vadjustment.Value + ((row_index - Selection.FocusedIndex) * RowHeight));
}
- Selection.FocusedRowIndex = row_index;
+ Selection.FocusedIndex = row_index;
InvalidateList ();
return true;
}
@@ -181,18 +195,18 @@ namespace Hyena.Data.Gui
break;
case Gdk.Key.Right:
case Gdk.Key.KP_Right:
- if (Selection.FocusedColumnIndex + 1 < column_cache.Length)
+ if (ActiveColumn + 1 < column_cache.Length)
{
- Selection.FocusedColumnIndex++;
+ ActiveColumn++;
InvalidateHeader();
}
handled = true;
break;
case Gdk.Key.Left:
case Gdk.Key.KP_Left:
- if (Selection.FocusedColumnIndex - 1 >= 0)
+ if (ActiveColumn - 1 >= 0)
{
- Selection.FocusedColumnIndex--;
+ ActiveColumn--;
InvalidateHeader();
}
handled = true;
@@ -227,10 +241,10 @@ namespace Hyena.Data.Gui
case Gdk.Key.KP_Enter:
if (!HeaderFocused)
handled = ActivateSelection ();
- else if (HeaderFocused && Selection.FocusedColumnIndex >= 0)
+ else if (HeaderFocused && ActiveColumn >= 0)
{
OnColumnLeftClicked (
- column_cache[Selection.FocusedColumnIndex].Column);
+ column_cache[ActiveColumn].Column);
handled = true;
}
break;
@@ -240,9 +254,9 @@ namespace Hyena.Data.Gui
break;
case Gdk.Key.space:
- if (Selection != null && Selection.FocusedRowIndex != 1 &&
+ if (Selection != null && Selection.FocusedIndex != 1 &&
!HeaderFocused) {
- Selection.ToggleSelect (Selection.FocusedRowIndex);
+ Selection.ToggleSelect (Selection.FocusedIndex);
handled = true;
}
break;
@@ -257,9 +271,9 @@ namespace Hyena.Data.Gui
protected bool ActivateSelection ()
{
- if (Selection != null && Selection.FocusedRowIndex != -1) {
+ if (Selection != null && Selection.FocusedIndex != -1) {
Selection.Clear (false);
- Selection.Select (Selection.FocusedRowIndex);
+ Selection.Select (Selection.FocusedIndex);
OnRowActivated ();
return true;
}
@@ -542,7 +556,7 @@ namespace Hyena.Data.Gui
{
if (pressed_column_index >= 0 && pressed_column_index < column_cache.Length) {
Column column = column_cache[pressed_column_index].Column;
- Selection.FocusedColumnIndex = pressed_column_index;
+ ActiveColumn = pressed_column_index;
if (column != null)
OnColumnLeftClicked (column);
@@ -705,10 +719,10 @@ namespace Hyena.Data.Gui
protected virtual void OnRowActivated ()
{
- if (Selection.FocusedRowIndex != -1) {
+ if (Selection.FocusedIndex != -1) {
RowActivatedHandler<T> handler = RowActivated;
if (handler != null) {
- handler (this, new RowActivatedArgs<T> (Selection.FocusedRowIndex, model[Selection.FocusedRowIndex]));
+ handler (this, new RowActivatedArgs<T> (Selection.FocusedIndex, model[Selection.FocusedIndex]));
}
}
}
@@ -746,7 +760,7 @@ namespace Hyena.Data.Gui
private void FocusRow (int index)
{
- Selection.FocusedRowIndex = index;
+ Selection.FocusedIndex = index;
}
#endregion
diff --git a/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs b/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs
index f97817a..3e3544f 100644
--- a/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs
+++ b/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs
@@ -164,7 +164,7 @@ namespace Hyena.Data.Gui
if (ci < 0 || column_cache.Length <= ci)
return;
- if (ci == Selection.FocusedColumnIndex && HasFocus && HeaderFocused) {
+ if (ci == ActiveColumn && HasFocus && HeaderFocused) {
Theme.DrawColumnHeaderFocus (cairo_context, area);
}
@@ -246,7 +246,7 @@ namespace Hyena.Data.Gui
selection_height += single_list_alloc.Height;
selected_rows.Add (ri);
- if (Selection.FocusedRowIndex == ri) {
+ if (Selection.FocusedIndex == ri) {
selected_focus_alloc = single_list_alloc;
}
} else {
@@ -257,7 +257,7 @@ namespace Hyena.Data.Gui
PaintReorderLine (ri, single_list_alloc);
- if (Selection != null && Selection.FocusedRowIndex == ri && !Selection.Contains (ri) && HasFocus) {
+ if (Selection != null && Selection.FocusedIndex == ri && !Selection.Contains (ri) && HasFocus) {
CairoCorners corners = CairoCorners.All;
if (Selection.Contains (ri - 1)) {
diff --git a/src/Libraries/Hyena/Hyena.Collections/Selection.cs b/src/Libraries/Hyena/Hyena.Collections/Selection.cs
index 5640666..df21eb4 100644
--- a/src/Libraries/Hyena/Hyena.Collections/Selection.cs
+++ b/src/Libraries/Hyena/Hyena.Collections/Selection.cs
@@ -52,32 +52,20 @@ namespace Hyena.Collections
RangeCollection ranges = new RangeCollection ();
private int max_index;
private int first_selected_index;
- private int focused_row_index = -1;
- private int focused_column_index = 0;
public event EventHandler Changed;
- public event EventHandler FocusRowChanged;
- public event EventHandler FocusColumnChanged;
+ public event EventHandler FocusChanged;
+ private int focused_index = -1;
public Selection ()
{
}
- public int FocusedColumnIndex {
- get { return focused_column_index; }
+ public int FocusedIndex {
+ get { return focused_index; }
set {
- focused_column_index = value;
- EventHandler handler = FocusColumnChanged;
- if (handler != null)
- handler (this, EventArgs.Empty);
- }
- }
-
- public int FocusedRowIndex {
- get { return focused_row_index; }
- set {
- focused_row_index = value;
- EventHandler handler = FocusRowChanged;
+ focused_index = value;
+ EventHandler handler = FocusChanged;
if (handler != null)
handler (this, EventArgs.Empty);
}
diff --git a/src/Libraries/Hyena/Hyena.Data.Sqlite/SqliteModelCache.cs b/src/Libraries/Hyena/Hyena.Data.Sqlite/SqliteModelCache.cs
index e334609..9698461 100644
--- a/src/Libraries/Hyena/Hyena.Data.Sqlite/SqliteModelCache.cs
+++ b/src/Libraries/Hyena/Hyena.Data.Sqlite/SqliteModelCache.cs
@@ -310,10 +310,10 @@ namespace Hyena.Data.Sqlite
connection.Execute (delete_selection_command);
saved_selection = true;
- if (!has_select_all_item && model.Selection.FocusedRowIndex != -1) {
- T item = GetValue (model.Selection.FocusedRowIndex);
+ if (!has_select_all_item && model.Selection.FocusedIndex != -1) {
+ T item = GetValue (model.Selection.FocusedIndex);
if (item != null) {
- saved_focus_item = GetValue (model.Selection.FocusedRowIndex);
+ saved_focus_item = GetValue (model.Selection.FocusedIndex);
}
}
@@ -359,7 +359,7 @@ namespace Hyena.Data.Sqlite
long i = IndexOf (saved_focus_item);
if (i != -1) {
// TODO get rid of int cast
- model.Selection.FocusedRowIndex = (int)i;
+ model.Selection.FocusedIndex = (int)i;
}
}
saved_selection = false;
diff --git a/src/Libraries/Hyena/Hyena.Data/BaseListModel.cs b/src/Libraries/Hyena/Hyena.Data/BaseListModel.cs
index 3e9bd16..4066059 100644
--- a/src/Libraries/Hyena/Hyena.Data/BaseListModel.cs
+++ b/src/Libraries/Hyena/Hyena.Data/BaseListModel.cs
@@ -85,7 +85,7 @@ namespace Hyena.Data
}
public T FocusedItem {
- get { return Selection.FocusedRowIndex == -1 ? default(T) : this[Selection.FocusedRowIndex]; }
+ get { return Selection.FocusedIndex == -1 ? default(T) : this[Selection.FocusedIndex]; }
}
private bool can_reorder = false;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]