Merge lp:~wingpanel-devs/slingshot/wingpanel-indicator into lp:~elementary-pantheon/slingshot/trunk
- wingpanel-indicator
- Merge into trunk
Proposed by
Cody Garver
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Approved by: | Cody Garver | ||||||||
Approved revision: | 540 | ||||||||
Merged at revision: | 603 | ||||||||
Proposed branch: | lp:~wingpanel-devs/slingshot/wingpanel-indicator | ||||||||
Merge into: | lp:~elementary-pantheon/slingshot/trunk | ||||||||
Diff against target: |
881 lines (+215/-291) 9 files modified
CMakeLists.txt (+36/-64) lib/synapse-core/CMakeLists.txt (+18/-14) lib/synapse-plugins/CMakeLists.txt (+22/-17) src/Backend/DBusService.vala (+1/-1) src/CMakeLists.txt (+54/-0) src/Slingshot.vala (+52/-79) src/SlingshotView.vala (+31/-113) src/Widgets/AppEntry.vala (+0/-2) src/Widgets/CategoryView.vala (+1/-1) |
||||||||
To merge this branch: | bzr merge lp:~wingpanel-devs/slingshot/wingpanel-indicator | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
elementary Pantheon team | Pending | ||
Review via email: mp+278758@code.launchpad.net |
Commit message
Convert to wingpanel indicator
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2015-11-25 05:48:28 +0000 | |||
3 | +++ CMakeLists.txt 2015-11-27 00:35:16 +0000 | |||
4 | @@ -1,14 +1,17 @@ | |||
7 | 1 | # Check http://webdev.elementaryos.org/docs/developer-guide/cmake for documentation | 1 | # Main configuration |
6 | 2 | |||
8 | 3 | cmake_minimum_required (VERSION 2.6) | 2 | cmake_minimum_required (VERSION 2.6) |
9 | 4 | cmake_policy (VERSION 2.6) | 3 | cmake_policy (VERSION 2.6) |
10 | 5 | list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) | 4 | list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) |
11 | 6 | 5 | ||
12 | 6 | # Project information | ||
13 | 7 | project (slingshot) | 7 | project (slingshot) |
14 | 8 | set (INDICATORTITLE "Slingshot") | ||
15 | 9 | set (INDICATORDESCRIPTION "Application menu") | ||
16 | 8 | 10 | ||
20 | 9 | set (APPNAME "${CMAKE_PROJECT_NAME}-launcher") | 11 | # Set some variables |
21 | 10 | set (DATADIR "${CMAKE_INSTALL_PREFIX}/share") | 12 | include (GNUInstallDirs) |
22 | 11 | set (PKGDATADIR "${DATADIR}/${CMAKE_PROJECT_NAME}") | 13 | set (DATADIR "${CMAKE_INSTALL_FULL_LIBDIR}/wingpanel") |
23 | 14 | set (PKGDATADIR "${DATADIR}") | ||
24 | 12 | set (GETTEXT_PACKAGE "${CMAKE_PROJECT_NAME}") | 15 | set (GETTEXT_PACKAGE "${CMAKE_PROJECT_NAME}") |
25 | 13 | set (RELEASE_NAME "Donatello") | 16 | set (RELEASE_NAME "Donatello") |
26 | 14 | set (VERSION "0.8.2") | 17 | set (VERSION "0.8.2") |
27 | @@ -18,8 +21,8 @@ | |||
28 | 18 | # Files | 21 | # Files |
29 | 19 | file (GLOB applications_menu "${CMAKE_CURRENT_SOURCE_DIR}/data/pantheon-applications.menu") | 22 | file (GLOB applications_menu "${CMAKE_CURRENT_SOURCE_DIR}/data/pantheon-applications.menu") |
30 | 20 | 23 | ||
33 | 21 | # Configure file | 24 | # Configuration file |
34 | 22 | configure_file (${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/config.h) | 25 | configure_file (${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/lib/synapse-core/config.h) |
35 | 23 | 26 | ||
36 | 24 | # Add 'make dist' command for creating release tarball | 27 | # Add 'make dist' command for creating release tarball |
37 | 25 | set (CPACK_PACKAGE_VERSION ${VERSION}) | 28 | set (CPACK_PACKAGE_VERSION ${VERSION}) |
38 | @@ -27,13 +30,12 @@ | |||
39 | 27 | set (CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION}") | 30 | set (CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION}") |
40 | 28 | set (CPACK_SOURCE_IGNORE_FILES "/build/;/.bzr/;/.bzrignore;~$;${CPACK_SOURCE_IGNORE_FILES}") | 31 | set (CPACK_SOURCE_IGNORE_FILES "/build/;/.bzr/;/.bzrignore;~$;${CPACK_SOURCE_IGNORE_FILES}") |
41 | 29 | 32 | ||
42 | 33 | # Include CPack | ||
43 | 30 | include (CPack) | 34 | include (CPack) |
44 | 31 | add_custom_target (dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source) | 35 | add_custom_target (dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source) |
45 | 32 | 36 | ||
48 | 33 | # Slingshot | 37 | # Option to configure the use of the unity integration |
47 | 34 | |||
49 | 35 | option (USE_UNITY "Use Unity integration" ON) | 38 | option (USE_UNITY "Use Unity integration" ON) |
50 | 36 | |||
51 | 37 | if (USE_UNITY) | 39 | if (USE_UNITY) |
52 | 38 | message ("-- Unity integration enabled") | 40 | message ("-- Unity integration enabled") |
53 | 39 | set (UNITY_DEPS unity) | 41 | set (UNITY_DEPS unity) |
54 | @@ -42,8 +44,8 @@ | |||
55 | 42 | message ("-- Unity integration disabled") | 44 | message ("-- Unity integration disabled") |
56 | 43 | endif () | 45 | endif () |
57 | 44 | 46 | ||
58 | 47 | # Option to configure the use of the zeitgeist integration | ||
59 | 45 | option (USE_ZEITGEIST "Use Zeitgeist integration" ON) | 48 | option (USE_ZEITGEIST "Use Zeitgeist integration" ON) |
60 | 46 | |||
61 | 47 | if (USE_ZEITGEIST) | 49 | if (USE_ZEITGEIST) |
62 | 48 | message ("-- Zeitgeist integration enabled") | 50 | message ("-- Zeitgeist integration enabled") |
63 | 49 | set (ZEITGEIST_DEPS zeitgeist-2.0) | 51 | set (ZEITGEIST_DEPS zeitgeist-2.0) |
64 | @@ -52,7 +54,16 @@ | |||
65 | 52 | message ("-- Zeitgeist integration disabled") | 54 | message ("-- Zeitgeist integration disabled") |
66 | 53 | endif () | 55 | endif () |
67 | 54 | 56 | ||
68 | 57 | # Gettext package | ||
69 | 58 | add_definitions (-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\") | ||
70 | 59 | |||
71 | 60 | # Comment this out to enable C compiler warnings | ||
72 | 61 | add_definitions (-w) | ||
73 | 62 | |||
74 | 63 | # Load PkgConfig | ||
75 | 55 | find_package (PkgConfig) | 64 | find_package (PkgConfig) |
76 | 65 | |||
77 | 66 | # Check for Vala | ||
78 | 56 | 67 | ||
79 | 57 | pkg_check_modules(PLANK011 QUIET plank>=0.10.9) | 68 | pkg_check_modules(PLANK011 QUIET plank>=0.10.9) |
80 | 58 | if (PLANK011_FOUND) | 69 | if (PLANK011_FOUND) |
81 | @@ -67,7 +78,7 @@ | |||
82 | 67 | endif () | 78 | endif () |
83 | 68 | 79 | ||
84 | 69 | set (CORE_DEPS "gobject-2.0;glib-2.0;gio-2.0;gio-unix-2.0;libsoup-2.4;gee-0.8;libgnome-menu-3.0;json-glib-1.0;${UNITY_DEPS};${PLANK_DEPS};") | 80 | set (CORE_DEPS "gobject-2.0;glib-2.0;gio-2.0;gio-unix-2.0;libsoup-2.4;gee-0.8;libgnome-menu-3.0;json-glib-1.0;${UNITY_DEPS};${PLANK_DEPS};") |
86 | 70 | set (UI_DEPS "gtk+-3.0>=3.12.0;granite;${ZEITGEIST_DEPS};") | 81 | set (UI_DEPS "wingpanel-2.0;gtk+-3.0>=3.12.0;granite;${ZEITGEIST_DEPS};") |
87 | 71 | 82 | ||
88 | 72 | pkg_check_modules (DEPS REQUIRED "${CORE_DEPS}${UI_DEPS}" gthread-2.0) | 83 | pkg_check_modules (DEPS REQUIRED "${CORE_DEPS}${UI_DEPS}" gthread-2.0) |
89 | 73 | 84 | ||
90 | @@ -75,68 +86,29 @@ | |||
91 | 75 | include (ValaVersion) | 86 | include (ValaVersion) |
92 | 76 | ensure_vala_version ("0.26.2" MINIMUM) | 87 | ensure_vala_version ("0.26.2" MINIMUM) |
93 | 77 | 88 | ||
94 | 89 | # Include vala precompile | ||
95 | 78 | include (ValaPrecompile) | 90 | include (ValaPrecompile) |
141 | 79 | vala_precompile (VALA_C ${APPNAME} | 91 | |
142 | 80 | src/Slingshot.vala | 92 | # Synapse libraries |
143 | 81 | src/SlingshotView.vala | 93 | include_directories (${CMAKE_BINARY_DIR}/lib/synapse-core) |
144 | 82 | src/Settings.vala | 94 | include_directories (${CMAKE_BINARY_DIR}/lib/synapse-plugins) |
145 | 83 | src/Utils.vala | 95 | |
146 | 84 | src/Pixels.vala | 96 | # Link some libraries |
102 | 85 | src/Backend/AppSystem.vala | ||
103 | 86 | src/Backend/DBusService.vala | ||
104 | 87 | src/Backend/App.vala | ||
105 | 88 | src/Backend/RelevancyService.vala | ||
106 | 89 | src/Backend/SynapseSearch.vala | ||
107 | 90 | src/Widgets/AppEntry.vala | ||
108 | 91 | src/Widgets/Grid.vala | ||
109 | 92 | src/Widgets/Switcher.vala | ||
110 | 93 | src/Widgets/SearchView.vala | ||
111 | 94 | src/Widgets/SearchItem.vala | ||
112 | 95 | src/Widgets/Sidebar.vala | ||
113 | 96 | src/Widgets/CategoryView.vala | ||
114 | 97 | PACKAGES | ||
115 | 98 | ${CORE_DEPS} | ||
116 | 99 | ${UI_DEPS} | ||
117 | 100 | synapse-core | ||
118 | 101 | synapse-plugins | ||
119 | 102 | CUSTOM_VAPIS | ||
120 | 103 | vapi/config.vapi | ||
121 | 104 | OPTIONS | ||
122 | 105 | --thread | ||
123 | 106 | --target-glib=2.32 | ||
124 | 107 | --vapidir=${CMAKE_BINARY_DIR}/lib/synapse-core | ||
125 | 108 | --vapidir=${CMAKE_BINARY_DIR}/lib/synapse-plugins | ||
126 | 109 | -g | ||
127 | 110 | ${UNITY_OPTIONS} | ||
128 | 111 | ${ZEITGEIST_OPTIONS} | ||
129 | 112 | ${PLANK_OPTIONS} | ||
130 | 113 | ) | ||
131 | 114 | |||
132 | 115 | include_directories(${CMAKE_BINARY_DIR}/lib/synapse-core) | ||
133 | 116 | include_directories(${CMAKE_BINARY_DIR}/lib/synapse-plugins) | ||
134 | 117 | |||
135 | 118 | add_subdirectory(lib/synapse-core) | ||
136 | 119 | add_subdirectory(lib/synapse-plugins) | ||
137 | 120 | |||
138 | 121 | # Comment this out to enable C compiler warnings | ||
139 | 122 | add_definitions (-w) | ||
140 | 123 | |||
147 | 124 | add_definitions (${DEPS_CFLAGS} -DGMENU_I_KNOW_THIS_IS_UNSTABLE -include config.h) | 97 | add_definitions (${DEPS_CFLAGS} -DGMENU_I_KNOW_THIS_IS_UNSTABLE -include config.h) |
148 | 125 | link_libraries (${DEPS_LIBRARIES}) | 98 | link_libraries (${DEPS_LIBRARIES}) |
149 | 126 | link_directories (${DEPS_LIBRARY_DIRS}) | 99 | link_directories (${DEPS_LIBRARY_DIRS}) |
150 | 127 | 100 | ||
151 | 128 | add_executable (${APPNAME} ${VALA_C}) | ||
152 | 129 | target_link_libraries(${APPNAME} m synapse-core synapse-plugins) | ||
153 | 130 | |||
154 | 131 | # Installation | 101 | # Installation |
155 | 132 | install (TARGETS ${APPNAME} RUNTIME DESTINATION bin) | 102 | install (TARGETS ${APPNAME} RUNTIME DESTINATION bin) |
156 | 133 | install (FILES ${applications_menu} DESTINATION /etc/xdg/menus) | 103 | install (FILES ${applications_menu} DESTINATION /etc/xdg/menus) |
157 | 104 | file (GLOB resources "${CMAKE_CURRENT_SOURCE_DIR}/data/*") | ||
158 | 134 | 105 | ||
162 | 135 | # | 106 | # Settings schema |
160 | 136 | # GSettings Schema | ||
161 | 137 | # | ||
163 | 138 | include (GSettings) | 107 | include (GSettings) |
164 | 139 | add_schema ("org.pantheon.desktop.slingshot.gschema.xml") | 108 | add_schema ("org.pantheon.desktop.slingshot.gschema.xml") |
165 | 140 | 109 | ||
167 | 141 | # Translations | 110 | # Directories |
168 | 111 | add_subdirectory (lib/synapse-core) | ||
169 | 112 | add_subdirectory (lib/synapse-plugins) | ||
170 | 113 | add_subdirectory (src) | ||
171 | 142 | add_subdirectory (po) | 114 | add_subdirectory (po) |
172 | 143 | 115 | ||
173 | === modified file 'lib/synapse-core/CMakeLists.txt' | |||
174 | --- lib/synapse-core/CMakeLists.txt 2014-07-03 06:38:42 +0000 | |||
175 | +++ lib/synapse-core/CMakeLists.txt 2015-11-27 00:35:16 +0000 | |||
176 | @@ -1,7 +1,8 @@ | |||
181 | 1 | set(CORE_LIB_VERSION 0.1) | 1 | # Library information |
182 | 2 | set(CORE_LIB_SOVERSION 0) | 2 | set (CORE_LIB_VERSION 0.1) |
183 | 3 | set(CORE_LIBRARY_NAME synapse-core) | 3 | set (CORE_LIB_SOVERSION 0) |
184 | 4 | set(CORE_PKG | 4 | set (CORE_LIBRARY_NAME synapse-core) |
185 | 5 | set (CORE_PKG | ||
186 | 5 | glib-2.0 | 6 | glib-2.0 |
187 | 6 | zeitgeist-2.0 | 7 | zeitgeist-2.0 |
188 | 7 | gio-unix-2.0 | 8 | gio-unix-2.0 |
189 | @@ -10,9 +11,11 @@ | |||
190 | 10 | gtk+-3.0 | 11 | gtk+-3.0 |
191 | 11 | ) | 12 | ) |
192 | 12 | 13 | ||
194 | 13 | pkg_check_modules(CORE_DEPS REQUIRED ${CORE_PKG}) | 14 | # Check for dependencies |
195 | 15 | pkg_check_modules (CORE_DEPS REQUIRED ${CORE_PKG}) | ||
196 | 14 | 16 | ||
198 | 15 | set(CORE_SOURCE | 17 | # Source files |
199 | 18 | set (CORE_SOURCE | ||
200 | 16 | common-actions.vala | 19 | common-actions.vala |
201 | 17 | config-service.vala | 20 | config-service.vala |
202 | 18 | data-sink.vala | 21 | data-sink.vala |
203 | @@ -28,9 +31,8 @@ | |||
204 | 28 | volume-service.vala | 31 | volume-service.vala |
205 | 29 | ) | 32 | ) |
206 | 30 | 33 | ||
210 | 31 | set(LINK_MODE STATIC) | 34 | # Compile |
211 | 32 | 35 | vala_precompile (CORE_VALA_C ${CORE_LIBRARY_NAME} | |
209 | 33 | vala_precompile(CORE_VALA_C ${CORE_LIBRARY_NAME} | ||
212 | 34 | ${CORE_SOURCE} | 36 | ${CORE_SOURCE} |
213 | 35 | PACKAGES | 37 | PACKAGES |
214 | 36 | ${CORE_PKG} | 38 | ${CORE_PKG} |
215 | @@ -40,15 +42,17 @@ | |||
216 | 40 | ${CORE_LIBRARY_NAME} | 42 | ${CORE_LIBRARY_NAME} |
217 | 41 | ) | 43 | ) |
218 | 42 | 44 | ||
221 | 43 | add_definitions(${CORE_DEPS_CFLAGS} -include config.h -w) | 45 | # Some compiler flags |
222 | 44 | link_directories(${CORE_DEPS_LIBRARY_DIRS}) | 46 | add_definitions (${CORE_DEPS_CFLAGS} -fPIC -include config.h -w) |
223 | 47 | link_directories (${CORE_DEPS_LIBRARY_DIRS}) | ||
224 | 45 | 48 | ||
226 | 46 | add_library(${CORE_LIBRARY_NAME} STATIC ${CORE_VALA_C}) | 49 | # Library |
227 | 50 | add_library (${CORE_LIBRARY_NAME} STATIC ${CORE_VALA_C}) | ||
228 | 47 | target_link_libraries (${CORE_LIBRARY_NAME} ${CORE_DEPS_LIBRARIES}) | 51 | target_link_libraries (${CORE_LIBRARY_NAME} ${CORE_DEPS_LIBRARIES}) |
229 | 48 | 52 | ||
231 | 49 | set_target_properties(${CORE_LIBRARY_NAME} PROPERTIES | 53 | # Set some properties |
232 | 54 | set_target_properties (${CORE_LIBRARY_NAME} PROPERTIES | ||
233 | 50 | OUTPUT_NAME ${CORE_LIBRARY_NAME} | 55 | OUTPUT_NAME ${CORE_LIBRARY_NAME} |
234 | 51 | VERSION ${CORE_LIB_VERSION} | 56 | VERSION ${CORE_LIB_VERSION} |
235 | 52 | SOVERSION ${CORE_LIB_SOVERSION} | 57 | SOVERSION ${CORE_LIB_SOVERSION} |
236 | 53 | ) | 58 | ) |
237 | 54 | |||
238 | 55 | 59 | ||
239 | === modified file 'lib/synapse-plugins/CMakeLists.txt' | |||
240 | --- lib/synapse-plugins/CMakeLists.txt 2015-06-03 19:10:24 +0000 | |||
241 | +++ lib/synapse-plugins/CMakeLists.txt 2015-11-27 00:35:16 +0000 | |||
242 | @@ -1,7 +1,8 @@ | |||
247 | 1 | set(PLUGINS_LIB_VERSION 0.1) | 1 | # Library information |
248 | 2 | set(PLUGINS_LIB_SOVERSION 0) | 2 | set (PLUGINS_LIB_VERSION 0.1) |
249 | 3 | set(PLUGINS_LIBRARY_NAME synapse-plugins) | 3 | set (PLUGINS_LIB_SOVERSION 0) |
250 | 4 | set(PLUGINS_PKG | 4 | set (PLUGINS_LIBRARY_NAME synapse-plugins) |
251 | 5 | set (PLUGINS_PKG | ||
252 | 5 | glib-2.0 | 6 | glib-2.0 |
253 | 6 | gio-unix-2.0 | 7 | gio-unix-2.0 |
254 | 7 | gee-0.8 | 8 | gee-0.8 |
255 | @@ -9,9 +10,11 @@ | |||
256 | 9 | switchboard-2.0 | 10 | switchboard-2.0 |
257 | 10 | ) | 11 | ) |
258 | 11 | 12 | ||
260 | 12 | pkg_check_modules(PLUGINS_DEPS REQUIRED ${PLUGINS_PKG}) | 13 | # Check for dependencies |
261 | 14 | pkg_check_modules (PLUGINS_DEPS REQUIRED ${PLUGINS_PKG}) | ||
262 | 13 | 15 | ||
264 | 14 | set(PLUGINS_SOURCE | 16 | # Source files |
265 | 17 | set (PLUGINS_SOURCE | ||
266 | 15 | calculator-plugin.vala | 18 | calculator-plugin.vala |
267 | 16 | command-plugin.vala | 19 | command-plugin.vala |
268 | 17 | desktop-file-plugin.vala | 20 | desktop-file-plugin.vala |
269 | @@ -19,9 +22,8 @@ | |||
270 | 19 | system-managment.vala | 22 | system-managment.vala |
271 | 20 | ) | 23 | ) |
272 | 21 | 24 | ||
276 | 22 | set(LINK_MODE STATIC) | 25 | # Compile |
277 | 23 | 26 | vala_precompile (PLUGINS_VALA_C ${PLUGINS_LIBRARY_NAME} | |
275 | 24 | vala_precompile(PLUGINS_VALA_C ${PLUGINS_LIBRARY_NAME} | ||
278 | 25 | ${PLUGINS_SOURCE} | 27 | ${PLUGINS_SOURCE} |
279 | 26 | PACKAGES | 28 | PACKAGES |
280 | 27 | ${PLUGINS_PKG} | 29 | ${PLUGINS_PKG} |
281 | @@ -34,17 +36,20 @@ | |||
282 | 34 | ${PLUGINS_LIBRARY_NAME} | 36 | ${PLUGINS_LIBRARY_NAME} |
283 | 35 | ) | 37 | ) |
284 | 36 | 38 | ||
292 | 37 | add_definitions(${PLUGINS_DEPS_CFLAGS} -include config.h -w) | 39 | # Compiler flags |
293 | 38 | link_directories(${PLUGINS_DEPS_LIBRARY_DIRS}) | 40 | add_definitions (${PLUGINS_DEPS_CFLAGS} -fPIC -include config.h -w) |
294 | 39 | include_directories(${CMAKE_BINARY_DIR}/lib/synapse-core) | 41 | link_directories (${PLUGINS_DEPS_LIBRARY_DIRS}) |
295 | 40 | 42 | include_directories (${CMAKE_BINARY_DIR}/lib/synapse-core) | |
296 | 41 | add_library(${PLUGINS_LIBRARY_NAME} STATIC ${PLUGINS_VALA_C}) | 43 | |
297 | 42 | 44 | # Add library | |
298 | 43 | set_target_properties(${PLUGINS_LIBRARY_NAME} PROPERTIES | 45 | add_library (${PLUGINS_LIBRARY_NAME} STATIC ${PLUGINS_VALA_C}) |
299 | 46 | |||
300 | 47 | # Set some properties | ||
301 | 48 | set_target_properties (${PLUGINS_LIBRARY_NAME} PROPERTIES | ||
302 | 44 | OUTPUT_NAME ${PLUGINS_LIBRARY_NAME} | 49 | OUTPUT_NAME ${PLUGINS_LIBRARY_NAME} |
303 | 45 | VERSION ${PLUGINS_LIB_VERSION} | 50 | VERSION ${PLUGINS_LIB_VERSION} |
304 | 46 | SOVERSION ${PLUGINS_LIB_SOVERSION} | 51 | SOVERSION ${PLUGINS_LIB_SOVERSION} |
305 | 47 | ) | 52 | ) |
306 | 48 | 53 | ||
307 | 54 | # Link libraries | ||
308 | 49 | target_link_libraries (${PLUGINS_LIBRARY_NAME} ${PLUGINS_DEPS_LIBRARIES} synapse-core) | 55 | target_link_libraries (${PLUGINS_LIBRARY_NAME} ${PLUGINS_DEPS_LIBRARIES} synapse-core) |
309 | 50 | |||
310 | 51 | 56 | ||
311 | === modified file 'src/Backend/DBusService.vala' | |||
312 | --- src/Backend/DBusService.vala 2013-12-26 00:08:04 +0000 | |||
313 | +++ src/Backend/DBusService.vala 2015-11-27 00:35:16 +0000 | |||
314 | @@ -66,4 +66,4 @@ | |||
315 | 66 | // Emit initial state | 66 | // Emit initial state |
316 | 67 | service.on_view_visibility_change (); | 67 | service.on_view_visibility_change (); |
317 | 68 | } | 68 | } |
318 | 69 | } | ||
319 | 70 | \ No newline at end of file | 69 | \ No newline at end of file |
320 | 70 | } | ||
321 | 71 | 71 | ||
322 | === added file 'src/CMakeLists.txt' | |||
323 | --- src/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
324 | +++ src/CMakeLists.txt 2015-11-27 00:35:16 +0000 | |||
325 | @@ -0,0 +1,54 @@ | |||
326 | 1 | # Some dependencies | ||
327 | 2 | set (CORE_DEPS "gobject-2.0;gio-2.0;gio-unix-2.0;libsoup-2.4;gee-0.8;libgnome-menu-3.0;${UNITY_DEPS};${PLANK_DEPS};") | ||
328 | 3 | set (UI_DEPS "gtk+-3.0>=3.12.0;granite;wingpanel-2.0;${ZEITGEIST_DEPS};") | ||
329 | 4 | |||
330 | 5 | # Check for these dependencies | ||
331 | 6 | pkg_check_modules (DEPS REQUIRED "${CORE_DEPS}${UI_DEPS}" gthread-2.0) | ||
332 | 7 | |||
333 | 8 | # Compiling options | ||
334 | 9 | vala_precompile (VALA_C ${CMAKE_PROJECT_NAME} | ||
335 | 10 | Slingshot.vala | ||
336 | 11 | SlingshotView.vala | ||
337 | 12 | Settings.vala | ||
338 | 13 | Utils.vala | ||
339 | 14 | Pixels.vala | ||
340 | 15 | Backend/AppSystem.vala | ||
341 | 16 | Backend/DBusService.vala | ||
342 | 17 | Backend/App.vala | ||
343 | 18 | Backend/RelevancyService.vala | ||
344 | 19 | Backend/SynapseSearch.vala | ||
345 | 20 | Widgets/AppEntry.vala | ||
346 | 21 | Widgets/Grid.vala | ||
347 | 22 | Widgets/Switcher.vala | ||
348 | 23 | Widgets/SearchView.vala | ||
349 | 24 | Widgets/SearchItem.vala | ||
350 | 25 | Widgets/Sidebar.vala | ||
351 | 26 | Widgets/CategoryView.vala | ||
352 | 27 | PACKAGES | ||
353 | 28 | ${CORE_DEPS} | ||
354 | 29 | ${UI_DEPS} | ||
355 | 30 | synapse-core | ||
356 | 31 | synapse-plugins | ||
357 | 32 | CUSTOM_VAPIS | ||
358 | 33 | ../vapi/config.vapi | ||
359 | 34 | OPTIONS | ||
360 | 35 | --thread | ||
361 | 36 | --target-glib=2.32 | ||
362 | 37 | --vapidir=${CMAKE_BINARY_DIR}/lib/synapse-core | ||
363 | 38 | --vapidir=${CMAKE_BINARY_DIR}/lib/synapse-plugins | ||
364 | 39 | -g | ||
365 | 40 | ${UNITY_OPTIONS} | ||
366 | 41 | ${ZEITGEIST_OPTIONS} | ||
367 | 42 | ${PLANK_OPTIONS} | ||
368 | 43 | ) | ||
369 | 44 | |||
370 | 45 | add_definitions(${DEPS_CFLAGS}) | ||
371 | 46 | |||
372 | 47 | # Library | ||
373 | 48 | add_library (${CMAKE_PROJECT_NAME} MODULE ${VALA_C}) | ||
374 | 49 | target_link_libraries(${CMAKE_PROJECT_NAME} ${DEPS_LIBRARIES}) | ||
375 | 50 | |||
376 | 51 | target_link_libraries(${CMAKE_PROJECT_NAME} synapse-plugins) | ||
377 | 52 | |||
378 | 53 | # Installation | ||
379 | 54 | install (TARGETS ${CMAKE_PROJECT_NAME} DESTINATION ${PKGDATADIR}) | ||
380 | 0 | 55 | ||
381 | === modified file 'src/Slingshot.vala' | |||
382 | --- src/Slingshot.vala 2015-01-17 23:56:32 +0000 | |||
383 | +++ src/Slingshot.vala 2015-11-27 00:35:16 +0000 | |||
384 | @@ -16,92 +16,65 @@ | |||
385 | 16 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | // along with this program. If not, see <http://www.gnu.org/licenses/>. |
386 | 17 | // | 17 | // |
387 | 18 | 18 | ||
393 | 19 | public class Slingshot.Slingshot : Granite.Application { | 19 | public class Slingshot.Slingshot : Wingpanel.Indicator { |
394 | 20 | 20 | ||
395 | 21 | private SlingshotView view = null; | 21 | private SlingshotView? view = null; |
396 | 22 | public static bool silent = false; | 22 | |
397 | 23 | public static bool command_mode = false; | 23 | private Gtk.Label? indicator_label = null; |
398 | 24 | 24 | ||
399 | 25 | public static Settings settings { get; private set; default = null; } | 25 | public static Settings settings { get; private set; default = null; } |
400 | 26 | //public static CssProvider style_provider { get; private set; default = null; } | ||
401 | 27 | public static Gtk.IconTheme icon_theme { get; set; default = null; } | 26 | public static Gtk.IconTheme icon_theme { get; set; default = null; } |
402 | 27 | |||
403 | 28 | private DBusService? dbus_service = null; | 28 | private DBusService? dbus_service = null; |
404 | 29 | 29 | ||
405 | 30 | construct { | ||
406 | 31 | |||
407 | 32 | build_data_dir = Build.DATADIR; | ||
408 | 33 | build_pkg_data_dir = Build.PKGDATADIR; | ||
409 | 34 | build_release_name = Build.RELEASE_NAME; | ||
410 | 35 | build_version = Build.VERSION; | ||
411 | 36 | build_version_info = Build.VERSION_INFO; | ||
412 | 37 | |||
413 | 38 | program_name = "Slingshot"; | ||
414 | 39 | exec_name = "slingshot-launcher"; | ||
415 | 40 | app_copyright = "GPLv3"; | ||
416 | 41 | app_icon = ""; | ||
417 | 42 | app_launcher = ""; | ||
418 | 43 | app_years = "2011-2012"; | ||
419 | 44 | application_id = "net.launchpad.slingshot"; | ||
420 | 45 | main_url = "https://launchpad.net/slingshot"; | ||
421 | 46 | bug_url = "https://bugs.launchpad.net/slingshot"; | ||
422 | 47 | help_url = "https://answers.launchpad.net/slingshot"; | ||
423 | 48 | translate_url = "https://translations.launchpad.net/slingshot"; | ||
424 | 49 | |||
425 | 50 | about_authors = {"Giulio Collura <random.cpp@gmail.com>", | ||
426 | 51 | "Andrea Basso <andrea@elementaryos.org"}; | ||
427 | 52 | about_artists = {"Harvey Cabaguio 'BassUltra' <harveycabaguio@gmail.com>", | ||
428 | 53 | "Daniel Foré <bunny@go-docky.com>"}; | ||
429 | 54 | about_translators = "Launchpad Translators"; | ||
430 | 55 | about_license_type = Gtk.License.GPL_3_0; | ||
431 | 56 | |||
432 | 57 | } | ||
433 | 58 | |||
434 | 59 | public Slingshot () { | 30 | public Slingshot () { |
440 | 60 | settings = new Settings (); | 31 | Object (code_name: Wingpanel.Indicator.APP_LAUNCHER, |
441 | 61 | } | 32 | display_name: _("Slingshot"), |
442 | 62 | 33 | description:_("The app-menu indicator")); | |
443 | 63 | protected override void activate () { | 34 | } |
444 | 64 | if (get_windows () == null) { | 35 | |
445 | 36 | void on_close_indicator () { | ||
446 | 37 | close (); | ||
447 | 38 | } | ||
448 | 39 | |||
449 | 40 | public override Gtk.Widget? get_widget () { | ||
450 | 41 | if (view == null) { | ||
451 | 42 | settings = new Settings (); | ||
452 | 43 | |||
453 | 65 | view = new SlingshotView (); | 44 | view = new SlingshotView (); |
455 | 66 | view.set_application (this); | 45 | |
456 | 46 | view.close_indicator.connect (on_close_indicator); | ||
457 | 67 | 47 | ||
458 | 68 | if (dbus_service == null) | 48 | if (dbus_service == null) |
459 | 69 | dbus_service = new DBusService (view); | 49 | dbus_service = new DBusService (view); |
498 | 70 | 50 | } | |
499 | 71 | if (!silent) { | 51 | |
500 | 72 | view.show_slingshot (); | 52 | return view; |
501 | 73 | } | 53 | } |
502 | 74 | } else { | 54 | |
503 | 75 | if (view.visible && !silent) | 55 | public override Gtk.Widget get_display_widget () { |
504 | 76 | view.hide (); | 56 | if (indicator_label == null) |
505 | 77 | else | 57 | indicator_label = new Gtk.Label ("Applications"); |
506 | 78 | view.show_slingshot (); | 58 | |
507 | 79 | } | 59 | visible = true; |
508 | 80 | silent = false; | 60 | |
509 | 81 | } | 61 | return indicator_label; |
510 | 82 | 62 | } | |
511 | 83 | static const OptionEntry[] entries = { | 63 | |
512 | 84 | { "silent", 's', 0, OptionArg.NONE, ref silent, "Launch Slingshot as a background process without it appearing visually.", null }, | 64 | public override void opened () { |
513 | 85 | { "command-mode", 'c', 0, OptionArg.NONE, ref command_mode, "This feature is not implemented yet. When it is, description will be changed.", null }, | 65 | if (view != null) |
514 | 86 | { null } | 66 | view.show_slingshot (); |
515 | 87 | }; | 67 | } |
516 | 88 | 68 | ||
517 | 89 | public static int main (string[] args) { | 69 | public override void closed () { |
518 | 90 | if (args.length > 1) { | 70 | // TODO: Do we need to do anyhting here? |
519 | 91 | var context = new OptionContext (""); | 71 | } |
520 | 92 | context.add_main_entries (entries, "slingshot"); | 72 | |
521 | 93 | context.add_group (Gtk.get_option_group (true)); | 73 | } |
522 | 94 | 74 | ||
523 | 95 | try { | 75 | public Wingpanel.Indicator get_indicator (Module module) { |
524 | 96 | context.parse (ref args); | 76 | debug ("Activating Slingshot"); |
525 | 97 | } catch (Error e) { | 77 | var indicator = new Slingshot.Slingshot (); |
526 | 98 | print (e.message + "\n"); | 78 | return indicator; |
527 | 99 | } | 79 | } |
528 | 100 | } | 80 | |
491 | 101 | |||
492 | 102 | var app = new Slingshot (); | ||
493 | 103 | |||
494 | 104 | return app.run (args); | ||
495 | 105 | } | ||
496 | 106 | |||
497 | 107 | } | ||
529 | 108 | 81 | ||
530 | === modified file 'src/SlingshotView.vala' | |||
531 | --- src/SlingshotView.vala 2015-02-01 15:13:15 +0000 | |||
532 | +++ src/SlingshotView.vala 2015-11-27 00:35:16 +0000 | |||
533 | @@ -24,8 +24,7 @@ | |||
534 | 24 | SEARCH_VIEW | 24 | SEARCH_VIEW |
535 | 25 | } | 25 | } |
536 | 26 | 26 | ||
539 | 27 | public class SlingshotView : Granite.Widgets.CompositedWindow { | 27 | public class SlingshotView : Gtk.Grid { |
538 | 28 | |||
540 | 29 | // Widgets | 28 | // Widgets |
541 | 30 | public Gtk.SearchEntry search_entry; | 29 | public Gtk.SearchEntry search_entry; |
542 | 31 | public Gtk.Stack stack; | 30 | public Gtk.Stack stack; |
543 | @@ -42,8 +41,6 @@ | |||
544 | 42 | public Gtk.Stack main_stack; | 41 | public Gtk.Stack main_stack; |
545 | 43 | public Gtk.Box content_area; | 42 | public Gtk.Box content_area; |
546 | 44 | private Gtk.EventBox event_box; | 43 | private Gtk.EventBox event_box; |
547 | 45 | private Gtk.Popover popover; | ||
548 | 46 | private Gtk.Grid ref_grid; | ||
549 | 47 | 44 | ||
550 | 48 | public Backend.AppSystem app_system; | 45 | public Backend.AppSystem app_system; |
551 | 49 | private Gee.ArrayList<GMenu.TreeDirectory> categories; | 46 | private Gee.ArrayList<GMenu.TreeDirectory> categories; |
552 | @@ -77,16 +74,11 @@ | |||
553 | 77 | 74 | ||
554 | 78 | private int primary_monitor = 0; | 75 | private int primary_monitor = 0; |
555 | 79 | 76 | ||
556 | 77 | Gdk.Screen screen; | ||
557 | 78 | |||
558 | 79 | public signal void close_indicator (); | ||
559 | 80 | |||
560 | 80 | public SlingshotView () { | 81 | public SlingshotView () { |
561 | 81 | |||
562 | 82 | // Window properties | ||
563 | 83 | this.title = "Slingshot"; | ||
564 | 84 | this.skip_pager_hint = true; | ||
565 | 85 | this.skip_taskbar_hint = true; | ||
566 | 86 | this.set_keep_above (true); | ||
567 | 87 | this.set_type_hint (Gdk.WindowTypeHint.MENU); | ||
568 | 88 | this.focus_on_map = true; | ||
569 | 89 | |||
570 | 90 | // Have the window in the right place | 82 | // Have the window in the right place |
571 | 91 | read_settings (true); | 83 | read_settings (true); |
572 | 92 | 84 | ||
573 | @@ -98,6 +90,8 @@ | |||
574 | 98 | categories = app_system.get_categories (); | 90 | categories = app_system.get_categories (); |
575 | 99 | apps = app_system.get_apps (); | 91 | apps = app_system.get_apps (); |
576 | 100 | 92 | ||
577 | 93 | screen = get_screen (); | ||
578 | 94 | |||
579 | 101 | primary_monitor = screen.get_primary_monitor (); | 95 | primary_monitor = screen.get_primary_monitor (); |
580 | 102 | Gdk.Rectangle geometry; | 96 | Gdk.Rectangle geometry; |
581 | 103 | screen.get_monitor_geometry (primary_monitor, out geometry); | 97 | screen.get_monitor_geometry (primary_monitor, out geometry); |
582 | @@ -132,7 +126,7 @@ | |||
583 | 132 | default_columns--; | 126 | default_columns--; |
584 | 133 | } | 127 | } |
585 | 134 | 128 | ||
587 | 135 | while ((calculate_grid_height () >= 2 * geometry.width / 3)) { | 129 | while ((calculate_grid_height () >= 2 * geometry.height / 3)) { |
588 | 136 | default_rows--; | 130 | default_rows--; |
589 | 137 | } | 131 | } |
590 | 138 | 132 | ||
591 | @@ -216,14 +210,7 @@ | |||
592 | 216 | event_box.add (container); | 210 | event_box.add (container); |
593 | 217 | // Add the container to the dialog's content area | 211 | // Add the container to the dialog's content area |
594 | 218 | 212 | ||
603 | 219 | ref_grid = new Gtk.Grid (); | 213 | this.add (event_box); |
596 | 220 | this.add (ref_grid); | ||
597 | 221 | |||
598 | 222 | popover = new Gtk.Popover (ref_grid); | ||
599 | 223 | popover.add (event_box); | ||
600 | 224 | popover.set_position (Gtk.PositionType.TOP); | ||
601 | 225 | |||
602 | 226 | this.show.connect (() => popover.show ()); | ||
604 | 227 | 214 | ||
605 | 228 | if (Slingshot.settings.use_category) | 215 | if (Slingshot.settings.use_category) |
606 | 229 | set_modality (Modality.CATEGORY_VIEW); | 216 | set_modality (Modality.CATEGORY_VIEW); |
607 | @@ -232,40 +219,12 @@ | |||
608 | 232 | debug ("Ui setup completed"); | 219 | debug ("Ui setup completed"); |
609 | 233 | } | 220 | } |
610 | 234 | 221 | ||
611 | 235 | public void grab_device () { | ||
612 | 236 | var display = Gdk.Display.get_default (); | ||
613 | 237 | var pointer = display.get_device_manager ().get_client_pointer (); | ||
614 | 238 | var keyboard = pointer.associated_device; | ||
615 | 239 | var keyboard_status = Gdk.GrabStatus.SUCCESS; | ||
616 | 240 | |||
617 | 241 | if (keyboard != null && keyboard.input_source == Gdk.InputSource.KEYBOARD) { | ||
618 | 242 | keyboard_status = keyboard.grab (get_window (), Gdk.GrabOwnership.NONE, true, | ||
619 | 243 | Gdk.EventMask.KEY_PRESS_MASK | Gdk.EventMask.KEY_RELEASE_MASK, | ||
620 | 244 | null, Gdk.CURRENT_TIME); | ||
621 | 245 | } | ||
622 | 246 | |||
623 | 247 | var pointer_status = pointer.grab (get_window (), Gdk.GrabOwnership.NONE, true, | ||
624 | 248 | Gdk.EventMask.SMOOTH_SCROLL_MASK | Gdk.EventMask.BUTTON_PRESS_MASK | | ||
625 | 249 | Gdk.EventMask.BUTTON_RELEASE_MASK | Gdk.EventMask.POINTER_MOTION_MASK, | ||
626 | 250 | null, Gdk.CURRENT_TIME); | ||
627 | 251 | |||
628 | 252 | if (pointer_status != Gdk.GrabStatus.SUCCESS || keyboard_status != Gdk.GrabStatus.SUCCESS) { | ||
629 | 253 | // If grab failed, retry again. Happens when "Applications" button is long held. | ||
630 | 254 | Timeout.add (100, () => { | ||
631 | 255 | if (visible) | ||
632 | 256 | grab_device (); | ||
633 | 257 | |||
634 | 258 | return false; | ||
635 | 259 | }); | ||
636 | 260 | } | ||
637 | 261 | } | ||
638 | 262 | |||
639 | 263 | public override bool button_press_event (Gdk.EventButton event) { | 222 | public override bool button_press_event (Gdk.EventButton event) { |
640 | 264 | var pointer = Gdk.Display.get_default ().get_device_manager ().get_client_pointer (); | 223 | var pointer = Gdk.Display.get_default ().get_device_manager ().get_client_pointer (); |
641 | 265 | 224 | ||
642 | 266 | // get_window_at_position returns null if the window belongs to another application. | 225 | // get_window_at_position returns null if the window belongs to another application. |
643 | 267 | if (pointer.get_window_at_position (null, null) == null) { | 226 | if (pointer.get_window_at_position (null, null) == null) { |
645 | 268 | hide (); | 227 | close_indicator (); |
646 | 269 | 228 | ||
647 | 270 | return true; | 229 | return true; |
648 | 271 | } | 230 | } |
649 | @@ -273,21 +232,6 @@ | |||
650 | 273 | return false; | 232 | return false; |
651 | 274 | } | 233 | } |
652 | 275 | 234 | ||
653 | 276 | public override void get_preferred_width (out int minimum_width, out int natural_width) { | ||
654 | 277 | popover.get_preferred_width (out minimum_width, out natural_width); | ||
655 | 278 | } | ||
656 | 279 | |||
657 | 280 | public override void get_preferred_height (out int minimum_height, out int natural_height) { | ||
658 | 281 | popover.get_preferred_height (out minimum_height, out natural_height); | ||
659 | 282 | } | ||
660 | 283 | |||
661 | 284 | public override bool map_event (Gdk.EventAny event) { | ||
662 | 285 | if (visible) | ||
663 | 286 | grab_device (); | ||
664 | 287 | |||
665 | 288 | return false; | ||
666 | 289 | } | ||
667 | 290 | |||
668 | 291 | private bool hotcorner_trigger (Gdk.EventMotion event) { | 235 | private bool hotcorner_trigger (Gdk.EventMotion event) { |
669 | 292 | if (can_trigger_hotcorner && event.x_root <= 0 && event.y_root <= 0) { | 236 | if (can_trigger_hotcorner && event.x_root <= 0 && event.y_root <= 0) { |
670 | 293 | Gdk.Display.get_default ().get_device_manager ().get_client_pointer ().ungrab (event.time); | 237 | Gdk.Display.get_default ().get_device_manager ().get_client_pointer ().ungrab (event.time); |
671 | @@ -309,11 +253,6 @@ | |||
672 | 309 | event_box.key_press_event.connect (on_key_press); | 253 | event_box.key_press_event.connect (on_key_press); |
673 | 310 | search_entry.key_press_event.connect (search_entry_key_press); | 254 | search_entry.key_press_event.connect (search_entry_key_press); |
674 | 311 | // Showing a menu reverts the effect of the grab_device function. | 255 | // Showing a menu reverts the effect of the grab_device function. |
675 | 312 | search_entry.populate_popup.connect ((menu) => { | ||
676 | 313 | menu.hide.connect (() => { | ||
677 | 314 | grab_device (); | ||
678 | 315 | }); | ||
679 | 316 | }); | ||
680 | 317 | search_entry.search_changed.connect (() => { | 256 | search_entry.search_changed.connect (() => { |
681 | 318 | if (modality != Modality.SEARCH_VIEW) | 257 | if (modality != Modality.SEARCH_VIEW) |
682 | 319 | set_modality (Modality.SEARCH_VIEW); | 258 | set_modality (Modality.SEARCH_VIEW); |
683 | @@ -322,7 +261,8 @@ | |||
684 | 322 | search_entry.grab_focus (); | 261 | search_entry.grab_focus (); |
685 | 323 | search_entry.activate.connect (search_entry_activated); | 262 | search_entry.activate.connect (search_entry_activated); |
686 | 324 | 263 | ||
688 | 325 | search_view.app_launched.connect (() => hide ()); | 264 | // FIXME: signals chain up is not supported |
689 | 265 | search_view.app_launched.connect (() => { close_indicator (); }); | ||
690 | 326 | 266 | ||
691 | 327 | // This function must be after creating the page switcher | 267 | // This function must be after creating the page switcher |
692 | 328 | populate_grid_view (); | 268 | populate_grid_view (); |
693 | @@ -353,18 +293,6 @@ | |||
694 | 353 | if (Slingshot.settings.screen_resolution != @"$(geometry.width)x$(geometry.height)") { | 293 | if (Slingshot.settings.screen_resolution != @"$(geometry.width)x$(geometry.height)") { |
695 | 354 | setup_size (); | 294 | setup_size (); |
696 | 355 | } | 295 | } |
697 | 356 | reposition (); | ||
698 | 357 | }); | ||
699 | 358 | screen.monitors_changed.connect (() => { | ||
700 | 359 | reposition (); | ||
701 | 360 | }); | ||
702 | 361 | |||
703 | 362 | get_style_context ().notify["direction"].connect (() => { | ||
704 | 363 | reposition (); | ||
705 | 364 | }); | ||
706 | 365 | |||
707 | 366 | popover.hide.connect (() => { | ||
708 | 367 | hide (); | ||
709 | 368 | }); | 296 | }); |
710 | 369 | 297 | ||
711 | 370 | // check for change in gala settings | 298 | // check for change in gala settings |
712 | @@ -383,22 +311,6 @@ | |||
713 | 383 | } | 311 | } |
714 | 384 | } | 312 | } |
715 | 385 | 313 | ||
716 | 386 | private void reposition () { | ||
717 | 387 | debug("Repositioning"); | ||
718 | 388 | |||
719 | 389 | Gdk.Rectangle monitor_dimensions; | ||
720 | 390 | screen.get_monitor_geometry (this.screen.get_primary_monitor(), out monitor_dimensions); | ||
721 | 391 | if (get_style_context ().direction == Gtk.TextDirection.LTR) { | ||
722 | 392 | popover.set_pointing_to ({36, 0, 0, 0}); | ||
723 | 393 | // Added 36px to y to be aligned with other popovers. | ||
724 | 394 | move (monitor_dimensions.x, monitor_dimensions.y + 36); | ||
725 | 395 | } else { | ||
726 | 396 | popover.set_pointing_to ({ref_grid.get_window ().get_width () - 36, 0, 0, 0}); | ||
727 | 397 | // Added 36px to y to be aligned with other popovers. | ||
728 | 398 | move (monitor_dimensions.x + monitor_dimensions.width - this.get_window ().get_width (), monitor_dimensions.y + 36); | ||
729 | 399 | } | ||
730 | 400 | } | ||
731 | 401 | |||
732 | 402 | private void change_view_mode (string key) { | 314 | private void change_view_mode (string key) { |
733 | 403 | switch (key) { | 315 | switch (key) { |
734 | 404 | case "1": // Normal view | 316 | case "1": // Normal view |
735 | @@ -413,7 +325,7 @@ | |||
736 | 413 | // Handle super+space when the user is typing in the search entry | 325 | // Handle super+space when the user is typing in the search entry |
737 | 414 | private bool search_entry_key_press (Gdk.EventKey event) { | 326 | private bool search_entry_key_press (Gdk.EventKey event) { |
738 | 415 | if ((event.keyval == Gdk.Key.space) && ((event.state & Gdk.ModifierType.SUPER_MASK) != 0)) { | 327 | if ((event.keyval == Gdk.Key.space) && ((event.state & Gdk.ModifierType.SUPER_MASK) != 0)) { |
740 | 416 | hide (); | 328 | close_indicator (); |
741 | 417 | return true; | 329 | return true; |
742 | 418 | } | 330 | } |
743 | 419 | 331 | ||
744 | @@ -425,16 +337,18 @@ | |||
745 | 425 | return true; | 337 | return true; |
746 | 426 | } | 338 | } |
747 | 427 | 339 | ||
749 | 428 | return false; | 340 | return on_key_press (event); |
750 | 429 | } | 341 | } |
751 | 430 | 342 | ||
752 | 431 | private void search_entry_activated () { | 343 | private void search_entry_activated () { |
753 | 432 | if (modality == Modality.SEARCH_VIEW) { | 344 | if (modality == Modality.SEARCH_VIEW) { |
754 | 433 | if (search_view.launch_selected ()) | 345 | if (search_view.launch_selected ()) |
756 | 434 | hide (); | 346 | close_indicator (); |
757 | 435 | } else { | 347 | } else { |
758 | 348 | /* TODO | ||
759 | 436 | if (get_focus () as Widgets.AppEntry != null) // checking the selected widget is an AppEntry | 349 | if (get_focus () as Widgets.AppEntry != null) // checking the selected widget is an AppEntry |
760 | 437 | ((Widgets.AppEntry) get_focus ()).launch_app (); | 350 | ((Widgets.AppEntry) get_focus ()).launch_app (); |
761 | 351 | */ | ||
762 | 438 | } | 352 | } |
763 | 439 | } | 353 | } |
764 | 440 | 354 | ||
765 | @@ -462,7 +376,7 @@ | |||
766 | 462 | switch (key) { | 376 | switch (key) { |
767 | 463 | case "F4": | 377 | case "F4": |
768 | 464 | if ((event.state & Gdk.ModifierType.MOD1_MASK) != 0) { | 378 | if ((event.state & Gdk.ModifierType.MOD1_MASK) != 0) { |
770 | 465 | hide (); | 379 | close_indicator (); |
771 | 466 | } | 380 | } |
772 | 467 | 381 | ||
773 | 468 | break; | 382 | break; |
774 | @@ -471,7 +385,7 @@ | |||
775 | 471 | if (search_entry.text.length > 0) { | 385 | if (search_entry.text.length > 0) { |
776 | 472 | search_entry.text = ""; | 386 | search_entry.text = ""; |
777 | 473 | } else { | 387 | } else { |
779 | 474 | hide (); | 388 | close_indicator (); |
780 | 475 | } | 389 | } |
781 | 476 | 390 | ||
782 | 477 | return true; | 391 | return true; |
783 | @@ -481,10 +395,12 @@ | |||
784 | 481 | case "KP_Enter": | 395 | case "KP_Enter": |
785 | 482 | if (modality == Modality.SEARCH_VIEW) { | 396 | if (modality == Modality.SEARCH_VIEW) { |
786 | 483 | if (search_view.launch_selected ()) | 397 | if (search_view.launch_selected ()) |
788 | 484 | hide (); | 398 | close_indicator (); |
789 | 485 | } else { | 399 | } else { |
790 | 400 | /* TODO | ||
791 | 486 | if (get_focus () as Widgets.AppEntry != null) // checking the selected widget is an AppEntry | 401 | if (get_focus () as Widgets.AppEntry != null) // checking the selected widget is an AppEntry |
792 | 487 | ((Widgets.AppEntry)get_focus ()).launch_app (); | 402 | ((Widgets.AppEntry)get_focus ()).launch_app (); |
793 | 403 | */ | ||
794 | 488 | } | 404 | } |
795 | 489 | return true; | 405 | return true; |
796 | 490 | 406 | ||
797 | @@ -698,14 +614,12 @@ | |||
798 | 698 | public void show_slingshot () { | 614 | public void show_slingshot () { |
799 | 699 | search_entry.text = ""; | 615 | search_entry.text = ""; |
800 | 700 | 616 | ||
806 | 701 | reposition (); | 617 | /* TODO |
802 | 702 | show_all (); | ||
803 | 703 | popover.show_all (); | ||
804 | 704 | present (); | ||
805 | 705 | |||
807 | 706 | set_focus (null); | 618 | set_focus (null); |
808 | 619 | */ | ||
809 | 620 | |||
810 | 707 | search_entry.grab_focus (); | 621 | search_entry.grab_focus (); |
812 | 708 | //This is needed in order to not animate if the previous view was the search view. | 622 | // This is needed in order to not animate if the previous view was the search view. |
813 | 709 | view_selector_revealer.transition_type = Gtk.RevealerTransitionType.NONE; | 623 | view_selector_revealer.transition_type = Gtk.RevealerTransitionType.NONE; |
814 | 710 | stack.transition_type = Gtk.StackTransitionType.NONE; | 624 | stack.transition_type = Gtk.StackTransitionType.NONE; |
815 | 711 | set_modality ((Modality) view_selector.selected); | 625 | set_modality ((Modality) view_selector.selected); |
816 | @@ -826,7 +740,7 @@ | |||
817 | 826 | grid_view.clear (); | 740 | grid_view.clear (); |
818 | 827 | foreach (Backend.App app in app_system.get_apps_by_name ()) { | 741 | foreach (Backend.App app in app_system.get_apps_by_name ()) { |
819 | 828 | var app_entry = new Widgets.AppEntry (app); | 742 | var app_entry = new Widgets.AppEntry (app); |
821 | 829 | app_entry.app_launched.connect (() => hide ()); | 743 | app_entry.app_launched.connect (() => close_indicator ()); |
822 | 830 | grid_view.append (app_entry); | 744 | grid_view.append (app_entry); |
823 | 831 | app_entry.show_all (); | 745 | app_entry.show_all (); |
824 | 832 | } | 746 | } |
825 | @@ -860,6 +774,7 @@ | |||
826 | 860 | } | 774 | } |
827 | 861 | 775 | ||
828 | 862 | private void normal_move_focus (int delta_column, int delta_row) { | 776 | private void normal_move_focus (int delta_column, int delta_row) { |
829 | 777 | /* TODO | ||
830 | 863 | if (get_focus () as Widgets.AppEntry != null) { // we check if any AppEntry has focus. If it does, we move | 778 | if (get_focus () as Widgets.AppEntry != null) { // we check if any AppEntry has focus. If it does, we move |
831 | 864 | if (column_focus + delta_column < 0 || row_focus + delta_row < 0) | 779 | if (column_focus + delta_column < 0 || row_focus + delta_row < 0) |
832 | 865 | return; | 780 | return; |
833 | @@ -891,6 +806,7 @@ | |||
834 | 891 | grid_view.get_child_at (column_focus, 0).grab_focus (); | 806 | grid_view.get_child_at (column_focus, 0).grab_focus (); |
835 | 892 | row_focus = 0; | 807 | row_focus = 0; |
836 | 893 | } | 808 | } |
837 | 809 | */ | ||
838 | 894 | } | 810 | } |
839 | 895 | 811 | ||
840 | 896 | private void category_move_focus (int delta_column, int delta_row) { | 812 | private void category_move_focus (int delta_column, int delta_row) { |
841 | @@ -944,6 +860,8 @@ | |||
842 | 944 | category_column_focus = 0; | 860 | category_column_focus = 0; |
843 | 945 | category_row_focus = 0; | 861 | category_row_focus = 0; |
844 | 946 | } | 862 | } |
845 | 863 | |||
846 | 864 | |||
847 | 947 | } | 865 | } |
848 | 948 | 866 | ||
849 | 949 | } | 867 | } |
850 | 950 | 868 | ||
851 | === modified file 'src/Widgets/AppEntry.vala' | |||
852 | --- src/Widgets/AppEntry.vala 2015-11-03 15:36:28 +0000 | |||
853 | +++ src/Widgets/AppEntry.vala 2015-11-27 00:35:16 +0000 | |||
854 | @@ -118,7 +118,6 @@ | |||
855 | 118 | this.drag_end.connect ( () => { | 118 | this.drag_end.connect ( () => { |
856 | 119 | this.dragging = false; | 119 | this.dragging = false; |
857 | 120 | var slingshot_app = (Gtk.Application) GLib.Application.get_default (); | 120 | var slingshot_app = (Gtk.Application) GLib.Application.get_default (); |
858 | 121 | ((SlingshotView)slingshot_app.active_window).grab_device (); | ||
859 | 122 | }); | 121 | }); |
860 | 123 | 122 | ||
861 | 124 | this.drag_data_get.connect ( (ctx, sel, info, time) => { | 123 | this.drag_data_get.connect ( (ctx, sel, info, time) => { |
862 | @@ -162,7 +161,6 @@ | |||
863 | 162 | // Showing a menu reverts the effect of the grab_device function. | 161 | // Showing a menu reverts the effect of the grab_device function. |
864 | 163 | menu.hide.connect (() => { | 162 | menu.hide.connect (() => { |
865 | 164 | var slingshot_app = (Gtk.Application) GLib.Application.get_default (); | 163 | var slingshot_app = (Gtk.Application) GLib.Application.get_default (); |
866 | 165 | ((SlingshotView)slingshot_app.active_window).grab_device (); | ||
867 | 166 | }); | 164 | }); |
868 | 167 | 165 | ||
869 | 168 | foreach (var action in application.actions) { | 166 | foreach (var action in application.actions) { |
870 | 169 | 167 | ||
871 | === modified file 'src/Widgets/CategoryView.vala' | |||
872 | --- src/Widgets/CategoryView.vala 2015-01-17 23:56:32 +0000 | |||
873 | +++ src/Widgets/CategoryView.vala 2015-11-27 00:35:16 +0000 | |||
874 | @@ -96,7 +96,7 @@ | |||
875 | 96 | 96 | ||
876 | 97 | private void add_app (Backend.App app) { | 97 | private void add_app (Backend.App app) { |
877 | 98 | var app_entry = new AppEntry (app); | 98 | var app_entry = new AppEntry (app); |
879 | 99 | app_entry.app_launched.connect (() => view.hide ()); | 99 | app_entry.app_launched.connect (() => view.close_indicator ()); |
880 | 100 | app_view.append (app_entry); | 100 | app_view.append (app_entry); |
881 | 101 | app_view.show_all (); | 101 | app_view.show_all (); |
882 | 102 | 102 |