Merge lp:~pqp/noise/fix-1004478 into lp:~elementary-apps/noise/trunk

Proposed by Patrick Pace
Status: Merged
Merged at revision: 941
Proposed branch: lp:~pqp/noise/fix-1004478
Merge into: lp:~elementary-apps/noise/trunk
Diff against target: 47 lines (+18/-2)
1 file modified
src/Views/ListView/Lists/GenericList.vala (+18/-2)
To merge this branch: bzr merge lp:~pqp/noise/fix-1004478
Reviewer Review Type Date Requested Status
Victor Martinez (community) Approve
Review via email: mp+119258@code.launchpad.net

Description of the change

Changed the sort_column_id of the blank column to allow for interactivity (particularly right-clicking for the column chooser menu). Left-clicking the blank column is ignored in order to prevent the user from sorting based on a potentially faulty sort_column_id.

In the event that someone does hide all of the other columns, the user will be able to simply right-click the blank column and re-enable any column once again.

To post a comment you must log in.
Revision history for this message
Victor Martinez (victored) wrote :

Thanks for the fix Patrick.

I think that we shouldn't let the users disable the "Title" column either, since it doesn't make sense to do so in most -if not all- cases.

review: Approve
Revision history for this message
Patrick Pace (pqp) wrote :

That's certainly a good idea as well-- I figured that this would at least be a good first step, since I didn't want to disable anything without input from you or the other various Noise developers.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Views/ListView/Lists/GenericList.vala'
2--- src/Views/ListView/Lists/GenericList.vala 2012-07-26 17:29:26 +0000
3+++ src/Views/ListView/Lists/GenericList.vala 2012-08-12 02:37:19 +0000
4@@ -245,18 +245,22 @@
5 // Icon column
6
7 insert_column(tvc, index);
8+ var blank_column = get_column(index);
9
10 tvc.fixed_width = 24;
11- tvc.clickable = false;
12- tvc.sort_column_id = -1;
13+ tvc.clickable = true;
14+ tvc.sort_column_id = index;
15 tvc.resizable = false;
16 tvc.reorderable = false;
17+ tvc.set_sort_indicator (false);
18
19 tvc.clear_attributes (tvc.get_cells().nth_data(0));
20 tvc.clear_attributes (tvc.get_cells().nth_data(1));
21
22 tvc.set_cell_data_func(tvc.get_cells().nth_data(0), cellHelper.iconDataFunc);
23 tvc.set_cell_data_func(tvc.get_cells().nth_data(1), cellHelper.iconDataFunc);
24+
25+ blank_column.get_button().button_press_event.connect(view_header_click_blank);
26 }
27 else if(tvc.title == TreeViewSetup.COLUMN_ID) {
28 insert_column(tvc, index);
29@@ -310,6 +314,18 @@
30
31 return false;
32 }
33+
34+ protected bool view_header_click_blank(Gtk.Widget w, Gdk.EventButton e) {
35+ if(e.button == 3) {
36+ column_chooser_menu.popup (null, null, null, 3, get_current_event_time());
37+ return true;
38+ }
39+ else if(e.button == 1) {
40+ return true; // Ignore left click on blank column
41+ }
42+
43+ return false;
44+ }
45
46 void row_activated_signal(TreePath path, TreeViewColumn column) {
47 if(tvs.get_hint() == ViewWrapper.Hint.DEVICE_AUDIO || tvs.get_hint() == ViewWrapper.Hint.DEVICE_PODCAST) {

Subscribers

People subscribed via source and target branches