Merge lp:~3v1n0/unity/switcher-alt+q into lp:unity

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Andrea Azzarone
Approved revision: no longer in the source branch.
Merged at revision: 4039
Proposed branch: lp:~3v1n0/unity/switcher-alt+q
Merge into: lp:unity
Prerequisite: lp:~3v1n0/unity/switcher-dynamic-model
Diff against target: 102 lines (+26/-4)
6 files modified
launcher/SwitcherController.cpp (+19/-0)
launcher/SwitcherControllerImpl.h (+2/-0)
launcher/SwitcherModel.cpp (+1/-1)
launcher/SwitcherModel.h (+1/-1)
launcher/SwitcherView.cpp (+2/-2)
launcher/SwitcherView.h (+1/-0)
To merge this branch: bzr merge lp:~3v1n0/unity/switcher-alt+q
Reviewer Review Type Date Requested Status
Andrea Azzarone (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+276396@code.launchpad.net

Commit message

Switcher{View,Controller}: close active selection on Alt+q

'Q' should be instead the first key in the row, near to tab.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Andrea Azzarone (azzar1) wrote :

LGTM.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/SwitcherController.cpp'
2--- launcher/SwitcherController.cpp 2015-11-04 09:56:24 +0000
3+++ launcher/SwitcherController.cpp 2015-11-04 09:56:24 +0000
4@@ -154,6 +154,24 @@
5 }
6 }
7
8+void Controller::Impl::CloseSelection()
9+{
10+ if (obj_->detail())
11+ {
12+ if (model_->detail_selection)
13+ {
14+ WindowManager::Default().Close(model_->DetailSelectionWindow());
15+ }
16+ }
17+ else
18+ {
19+ // Using model_->Selection()->Close() would be nicer, but it wouldn't take
20+ // in consideration the workspace related settings
21+ for (auto window : model_->DetailXids())
22+ WindowManager::Default().Close(window);
23+ }
24+}
25+
26 void Controller::Next()
27 {
28 impl_->Next();
29@@ -443,6 +461,7 @@
30 view_->switcher_prev.connect(sigc::mem_fun(this, &Impl::Prev));
31 view_->switcher_start_detail.connect(sigc::mem_fun(this, &Impl::StartDetailMode));
32 view_->switcher_stop_detail.connect(sigc::mem_fun(this, &Impl::StopDetailMode));
33+ view_->switcher_close_current.connect(sigc::mem_fun(this, &Impl::CloseSelection));
34
35 ConstructWindow();
36 main_layout_->AddView(view_.GetPointer(), 1);
37
38=== modified file 'launcher/SwitcherControllerImpl.h'
39--- launcher/SwitcherControllerImpl.h 2015-11-04 09:56:24 +0000
40+++ launcher/SwitcherControllerImpl.h 2015-11-04 09:56:24 +0000
41@@ -62,6 +62,8 @@
42 void NextDetail();
43 void PrevDetail();
44
45+ void CloseSelection();
46+
47 void NextDetailRow();
48 void PrevDetailRow();
49 bool HasNextDetailRow() const;
50
51=== modified file 'launcher/SwitcherModel.cpp'
52--- launcher/SwitcherModel.cpp 2015-11-04 09:56:24 +0000
53+++ launcher/SwitcherModel.cpp 2015-11-04 09:56:24 +0000
54@@ -51,7 +51,7 @@
55 }
56
57
58-SwitcherModel::SwitcherModel(std::vector<AbstractLauncherIcon::Ptr> const& icons, bool sort_by_priority)
59+SwitcherModel::SwitcherModel(Applications const& icons, bool sort_by_priority)
60 : detail_selection(false)
61 , detail_selection_index(0)
62 , only_apps_on_viewport(true)
63
64=== modified file 'launcher/SwitcherModel.h'
65--- launcher/SwitcherModel.h 2015-11-04 09:56:24 +0000
66+++ launcher/SwitcherModel.h 2015-11-04 09:56:24 +0000
67@@ -61,7 +61,7 @@
68 nux::Property<unsigned int> detail_selection_index;
69 nux::Property<bool> only_apps_on_viewport;
70
71- SwitcherModel(std::vector<launcher::AbstractLauncherIcon::Ptr> const& icons, bool sort_by_priority);
72+ SwitcherModel(Applications const&, bool sort_by_priority);
73 virtual ~SwitcherModel() = default;
74
75 iterator begin();
76
77=== modified file 'launcher/SwitcherView.cpp'
78--- launcher/SwitcherView.cpp 2015-11-04 09:56:24 +0000
79+++ launcher/SwitcherView.cpp 2015-11-04 09:56:24 +0000
80@@ -500,8 +500,8 @@
81 case NUX_VK_DOWN:
82 switcher_start_detail.emit();
83 break;
84- default:
85- return false;
86+ case NUX_VK_q:
87+ switcher_close_current.emit();
88 break;
89 }
90 }
91
92=== modified file 'launcher/SwitcherView.h'
93--- launcher/SwitcherView.h 2014-07-15 16:28:45 +0000
94+++ launcher/SwitcherView.h 2015-11-04 09:56:24 +0000
95@@ -85,6 +85,7 @@
96 sigc::signal<void> switcher_prev;
97 sigc::signal<void> switcher_start_detail;
98 sigc::signal<void> switcher_stop_detail;
99+ sigc::signal<void> switcher_close_current;
100
101 /* void; bool visible */
102 sigc::signal<void, bool> hide_request;