Commit 573c0464c5254de46fce7d7b6771d5006d556b25

  • avatar
  • Paul Wellner Bou <paul @ubun…vb.(none)>
  • Thu Nov 05 13:06:59 CET 2009
fix click events for IconView #600032
  
11<Addin namespace="FSpot"
22 id="VersionSidebar"
3 version="0.6.3"
3 version="0.6.4"
44 name="VersionSidebar"
55 description="Shows versions in the sidebar"
66 author="Paul Wellner Bou"
  
1212using System.Text;
1313using System.Collections.Generic;
1414using Gtk;
15using Gdk;
1516
1617using Mono.Unix;
1718
7272 }
7373
7474 internal void HandleSelectionChanged (IBrowsableCollection collection) {
75
76 FSpot.Utils.Log.Debug ("HandleSelectionChanged...");
77
7578 if (collection != null && collection.Count == 1)
7679 SelectedItem = collection [0];
7780 else
8383
8484 void ShowPhotoVersions ()
8585 {
86 FSpot.Utils.Log.Debug ("Show photo versions...");
87
8688 try {
8789 ClearPhotoVersionViews ();
8890 if (SelectedItem == null)
8991 return;
9092
93 FSpot.Utils.Log.Debug ("Getting versions of selected item...");
94
9195 FSpot.Photo photo = (FSpot.Photo) SelectedItem;
9296 uint [] version_ids = photo.VersionIds;
9397 IBrowsableItem [] items = new IBrowsableItem [version_ids.Length];
110110 versions.Add (items);
111111
112112 view = new IconView (versions);
113
114 // see bug #600032
115 view.AddEvents ( (int) EventMask.KeyPressMask
116 | (int) EventMask.KeyReleaseMask
117 | (int) EventMask.PointerMotionMask
118 | (int) EventMask.ButtonPressMask
119 | (int) EventMask.ButtonReleaseMask);
120
113121 if (selected_version_id >= 0)
114122 view.Selection.Add (selected_version_id);
115123 view.Selection.Changed += OnVersionClicked;
134134
135135 void OnVersionClicked (IBrowsableCollection collection)
136136 {
137 if (collection.Count != 1 || SelectedItem == null)
137 FSpot.Utils.Log.Debug ("OnVersionClicked...");
138
139 if (collection.Count != 1 || SelectedItem == null) {
138140 return;
141 }
139142
140143 PhotoVersion selected_item = (PhotoVersion) collection.Items[0];
141144