Merge lp:~l-admin-3/switchboard-plug-mouse-touchpad/frontend-update into lp:~elementary-pantheon/switchboard-plug-mouse-touchpad/trunk
- frontend-update
- Merge into trunk
Proposed by
Marcus Wichelmann
Status: | Merged | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Approved by: | Felipe Escoto | ||||||||||||
Approved revision: | 17 | ||||||||||||
Merged at revision: | 19 | ||||||||||||
Proposed branch: | lp:~l-admin-3/switchboard-plug-mouse-touchpad/frontend-update | ||||||||||||
Merge into: | lp:~elementary-pantheon/switchboard-plug-mouse-touchpad/trunk | ||||||||||||
Diff against target: |
1355 lines (+484/-663) 16 files modified
AUTHORS (+4/-3) COPYRIGHT (+0/-5) po/pantheon-mouse-touchpad.pot (+64/-58) src/Backend/MouseSettings.vala (+29/-0) src/Backend/TouchpadSettings.vala (+32/-0) src/CMakeLists.txt (+7/-8) src/Pages/Mouse/mouse-page.vala (+0/-95) src/Pages/Mouse/mouse-settings.vala (+0/-31) src/Pages/Touchpad/touchpad-page.vala (+0/-280) src/Pages/Touchpad/touchpad-settings.vala (+0/-41) src/Widgets/GeneralSection.vala (+58/-0) src/Widgets/MouseSection.vala (+62/-0) src/Widgets/Section.vala (+64/-0) src/Widgets/TouchpadSection.vala (+114/-0) src/mouse-touchpad.vala (+50/-115) src/page.vala (+0/-27) |
||||||||||||
To merge this branch: | bzr merge lp:~l-admin-3/switchboard-plug-mouse-touchpad/frontend-update | ||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Felipe Escoto (community) | code | Approve | |
Danielle Foré | ux | Approve | |
Review via email: mp+268857@code.launchpad.net |
Commit message
Frontend update.
Description of the change
This branch updates the gui of the plug like shown in the mockup together with some code improvements.
To post a comment you must log in.
Revision history for this message
Felipe Escoto (philip.scott) : | # |
review:
Approve
Revision history for this message
Felipe Escoto (philip.scott) : | # |
review:
Approve
(code)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file '.bzrignore' (properties changed: -x to +x) | |||
2 | === modified file 'AUTHORS' (properties changed: -x to +x) | |||
3 | --- AUTHORS 2014-07-22 05:50:56 +0000 | |||
4 | +++ AUTHORS 2015-08-23 23:11:04 +0000 | |||
5 | @@ -1,4 +1,5 @@ | |||
7 | 1 | Copyright (c) 2014 by XXX Developers | 1 | Copyright (c) 2015 by elementary Developers |
8 | 2 | 2 | ||
11 | 3 | Written by XXX Developers: | 3 | Written by elementary Developers: |
12 | 4 | * YOUR NAME <email@provider.com> | 4 | * Keith Gonyon |
13 | 5 | * Marcus Wichelmann <marcus.wichelmann@hotmail.de> | ||
14 | 5 | 6 | ||
15 | === modified file 'CMakeLists.txt' (properties changed: -x to +x) | |||
16 | === modified file 'COPYING' (properties changed: -x to +x) | |||
17 | === removed file 'COPYRIGHT' | |||
18 | --- COPYRIGHT 2014-07-22 05:50:56 +0000 | |||
19 | +++ COPYRIGHT 1970-01-01 00:00:00 +0000 | |||
20 | @@ -1,5 +0,0 @@ | |||
21 | 1 | Sample | ||
22 | 2 | Copyright (C) 2014 by the following: | ||
23 | 3 | |||
24 | 4 | If you have contributed to this project then you deserve to be on this list. | ||
25 | 5 | Contact us (see: AUTHORS) and we'll add you. | ||
26 | 6 | 0 | ||
27 | === modified file 'INSTALL' (properties changed: -x to +x) | |||
28 | === modified file 'cmake/FindGirCompiler.cmake' (properties changed: -x to +x) | |||
29 | === modified file 'cmake/FindVala.cmake' (properties changed: -x to +x) | |||
30 | === modified file 'cmake/GObjectIntrospectionMacros.cmake' (properties changed: -x to +x) | |||
31 | === modified file 'cmake/GSettings.cmake' (properties changed: -x to +x) | |||
32 | === modified file 'cmake/ParseArguments.cmake' (properties changed: -x to +x) | |||
33 | === modified file 'cmake/README' (properties changed: -x to +x) | |||
34 | === modified file 'cmake/README.Vala.rst' (properties changed: -x to +x) | |||
35 | === modified file 'cmake/Tests.cmake' (properties changed: -x to +x) | |||
36 | === modified file 'cmake/Translations.cmake' (properties changed: -x to +x) | |||
37 | === modified file 'cmake/ValaPrecompile.cmake' (properties changed: -x to +x) | |||
38 | === modified file 'cmake/ValaVersion.cmake' (properties changed: -x to +x) | |||
39 | === modified file 'config.vala.cmake' (properties changed: -x to +x) | |||
40 | === modified file 'debian/changelog' (properties changed: -x to +x) | |||
41 | === modified file 'debian/compat' (properties changed: -x to +x) | |||
42 | === modified file 'debian/control' (properties changed: -x to +x) | |||
43 | === modified file 'debian/copyright' (properties changed: -x to +x) | |||
44 | === modified file 'debian/source/format' (properties changed: -x to +x) | |||
45 | === modified file 'plug.plugin' (properties changed: -x to +x) | |||
46 | === modified file 'po/CMakeLists.txt' (properties changed: -x to +x) | |||
47 | === modified file 'po/ca.po' (properties changed: -x to +x) | |||
48 | === modified file 'po/eo.po' (properties changed: -x to +x) | |||
49 | === modified file 'po/es.po' (properties changed: -x to +x) | |||
50 | === modified file 'po/fi.po' (properties changed: -x to +x) | |||
51 | === modified file 'po/fr.po' (properties changed: -x to +x) | |||
52 | === modified file 'po/it.po' (properties changed: -x to +x) | |||
53 | === modified file 'po/pantheon-mouse-touchpad.pot' (properties changed: -x to +x) | |||
54 | --- po/pantheon-mouse-touchpad.pot 2014-07-25 05:27:41 +0000 | |||
55 | +++ po/pantheon-mouse-touchpad.pot 2015-08-23 23:11:04 +0000 | |||
56 | @@ -1,3 +1,4 @@ | |||
57 | 1 | # SOME DESCRIPTIVE TITLE. | ||
58 | 1 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER | 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER |
59 | 2 | # This file is distributed under the same license as the PACKAGE package. | 3 | # This file is distributed under the same license as the PACKAGE package. |
60 | 3 | # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. | 4 | # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. |
61 | @@ -7,7 +8,7 @@ | |||
62 | 7 | msgstr "" | 8 | msgstr "" |
63 | 8 | "Project-Id-Version: PACKAGE VERSION\n" | 9 | "Project-Id-Version: PACKAGE VERSION\n" |
64 | 9 | "Report-Msgid-Bugs-To: \n" | 10 | "Report-Msgid-Bugs-To: \n" |
66 | 10 | "POT-Creation-Date: 2014-07-24 22:24-0700\n" | 11 | "POT-Creation-Date: 2015-08-24 01:07+0200\n" |
67 | 11 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
68 | 12 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
69 | 13 | "Language-Team: LANGUAGE <LL@li.org>\n" | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" |
70 | @@ -16,73 +17,78 @@ | |||
71 | 16 | "Content-Type: text/plain; charset=CHARSET\n" | 17 | "Content-Type: text/plain; charset=CHARSET\n" |
72 | 17 | "Content-Transfer-Encoding: 8bit\n" | 18 | "Content-Transfer-Encoding: 8bit\n" |
73 | 18 | 19 | ||
75 | 19 | #: ../src/mouse-touchpad.vala:25 | 20 | #: ../src/mouse-touchpad.vala:34 |
76 | 20 | msgid "Mouse & Touchpad" | 21 | msgid "Mouse & Touchpad" |
77 | 21 | msgstr "" | 22 | msgstr "" |
78 | 22 | 23 | ||
80 | 23 | #: ../src/mouse-touchpad.vala:26 | 24 | #: ../src/mouse-touchpad.vala:35 |
81 | 24 | msgid "Set your mouse and touchpad preferences" | 25 | msgid "Set your mouse and touchpad preferences" |
82 | 25 | msgstr "" | 26 | msgstr "" |
83 | 26 | 27 | ||
101 | 27 | #: ../src/mouse-touchpad.vala:41 ../src/Pages/Touchpad/touchpad-page.vala:46 | 28 | #: ../src/Widgets/GeneralSection.vala:27 |
102 | 28 | msgid "<b>General:</b>" | 29 | msgid "General" |
103 | 29 | msgstr "" | 30 | msgstr "" |
104 | 30 | 31 | ||
105 | 31 | #: ../src/mouse-touchpad.vala:43 | 32 | #: ../src/Widgets/GeneralSection.vala:37 |
106 | 32 | msgid "Left-handed" | 33 | msgid "Left" |
107 | 33 | msgstr "" | 34 | msgstr "" |
108 | 34 | 35 | ||
109 | 35 | #: ../src/mouse-touchpad.vala:45 | 36 | #: ../src/Widgets/GeneralSection.vala:38 |
110 | 36 | msgid "Right-handed" | 37 | msgid "Right" |
111 | 37 | msgstr "" | 38 | msgstr "" |
112 | 38 | 39 | ||
113 | 39 | #: ../src/mouse-touchpad.vala:47 | 40 | #: ../src/Widgets/GeneralSection.vala:43 |
114 | 40 | msgid "Pointer Reveal" | 41 | msgid "Primary Button:" |
115 | 41 | msgstr "" | 42 | msgstr "" |
116 | 42 | 43 | ||
117 | 43 | #: ../src/mouse-touchpad.vala:104 | 44 | #: ../src/Widgets/GeneralSection.vala:44 |
118 | 45 | msgid "Reveal pointer:" | ||
119 | 46 | msgstr "" | ||
120 | 47 | |||
121 | 48 | #: ../src/Widgets/GeneralSection.vala:44 | ||
122 | 49 | msgid "Pressing the control key will highlight the position of the pointer" | ||
123 | 50 | msgstr "" | ||
124 | 51 | |||
125 | 52 | #: ../src/Widgets/MouseSection.vala:26 | ||
126 | 44 | msgid "Mouse" | 53 | msgid "Mouse" |
127 | 45 | msgstr "" | 54 | msgstr "" |
128 | 46 | 55 | ||
130 | 47 | #: ../src/mouse-touchpad.vala:105 | 56 | #: ../src/Widgets/MouseSection.vala:40 ../src/Widgets/TouchpadSection.vala:64 |
131 | 57 | msgid "Pointer speed:" | ||
132 | 58 | msgstr "" | ||
133 | 59 | |||
134 | 60 | #: ../src/Widgets/TouchpadSection.vala:31 | ||
135 | 48 | msgid "Touchpad" | 61 | msgid "Touchpad" |
136 | 49 | msgstr "" | 62 | msgstr "" |
137 | 50 | 63 | ||
175 | 51 | #: ../src/Pages/Mouse/mouse-page.vala:16 | 64 | #: ../src/Widgets/TouchpadSection.vala:52 |
176 | 52 | #: ../src/Pages/Touchpad/touchpad-page.vala:41 | 65 | msgid "Two-finger" |
177 | 53 | msgid "<b>Pointer Speed:</b>" | 66 | msgstr "" |
178 | 54 | msgstr "" | 67 | |
179 | 55 | 68 | #: ../src/Widgets/TouchpadSection.vala:53 | |
180 | 56 | #: ../src/Pages/Mouse/mouse-page.vala:17 | 69 | msgid "Edge" |
181 | 57 | #: ../src/Pages/Touchpad/touchpad-page.vala:42 | 70 | msgstr "" |
182 | 58 | msgid "<i>Slow</i>" | 71 | |
183 | 59 | msgstr "" | 72 | #: ../src/Widgets/TouchpadSection.vala:54 |
184 | 60 | 73 | msgid "Disabled" | |
185 | 61 | #: ../src/Pages/Mouse/mouse-page.vala:18 | 74 | msgstr "" |
186 | 62 | #: ../src/Pages/Touchpad/touchpad-page.vala:43 | 75 | |
187 | 63 | msgid "<i>Fast</i>" | 76 | #: ../src/Widgets/TouchpadSection.vala:62 |
188 | 64 | msgstr "" | 77 | msgid "Disable while typing:" |
189 | 65 | 78 | msgstr "" | |
190 | 66 | #: ../src/Pages/Touchpad/touchpad-page.vala:47 | 79 | |
191 | 67 | msgid "Disable while typing" | 80 | #: ../src/Widgets/TouchpadSection.vala:63 |
192 | 68 | msgstr "" | 81 | msgid "Tap to click:" |
193 | 69 | 82 | msgstr "" | |
194 | 70 | #: ../src/Pages/Touchpad/touchpad-page.vala:48 | 83 | |
195 | 71 | msgid "Tap to click" | 84 | #: ../src/Widgets/TouchpadSection.vala:65 |
196 | 72 | msgstr "" | 85 | msgid "Scrolling:" |
197 | 73 | 86 | msgstr "" | |
198 | 74 | #: ../src/Pages/Touchpad/touchpad-page.vala:50 | 87 | |
199 | 75 | msgid "<b>Scrolling:</b>" | 88 | #: ../src/Widgets/TouchpadSection.vala:66 |
200 | 76 | msgstr "" | 89 | msgid "Horizontal scrolling:" |
201 | 77 | 90 | msgstr "" | |
202 | 78 | #: ../src/Pages/Touchpad/touchpad-page.vala:52 | 91 | |
203 | 79 | msgid "Natural scrolling" | 92 | #: ../src/Widgets/TouchpadSection.vala:67 |
204 | 80 | msgstr "" | 93 | msgid "Natural scrolling:" |
168 | 81 | |||
169 | 82 | #: ../src/Pages/Touchpad/touchpad-page.vala:53 | ||
170 | 83 | msgid "Horizontal scrolling" | ||
171 | 84 | msgstr "" | ||
172 | 85 | |||
173 | 86 | #: ../src/Pages/Touchpad/touchpad-page.vala:54 | ||
174 | 87 | msgid "Two finger scrolling" | ||
205 | 88 | msgstr "" | 94 | msgstr "" |
206 | 89 | 95 | ||
207 | === modified file 'po/pl.po' (properties changed: -x to +x) | |||
208 | === added directory 'src/Backend' | |||
209 | === added file 'src/Backend/MouseSettings.vala' | |||
210 | --- src/Backend/MouseSettings.vala 1970-01-01 00:00:00 +0000 | |||
211 | +++ src/Backend/MouseSettings.vala 2015-08-23 23:11:04 +0000 | |||
212 | @@ -0,0 +1,29 @@ | |||
213 | 1 | /* | ||
214 | 2 | * Copyright (c) 2011-2015 elementary Developers (https://launchpad.net/elementary) | ||
215 | 3 | * | ||
216 | 4 | * This program is free software; you can redistribute it and/or | ||
217 | 5 | * modify it under the terms of the GNU General Public | ||
218 | 6 | * License as published by the Free Software Foundation; either | ||
219 | 7 | * version 2 of the License, or (at your option) any later version. | ||
220 | 8 | * | ||
221 | 9 | * This program is distributed in the hope that it will be useful, | ||
222 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
223 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
224 | 12 | * General Public License for more details. | ||
225 | 13 | * | ||
226 | 14 | * You should have received a copy of the GNU General Public | ||
227 | 15 | * License along with this program; if not, write to the | ||
228 | 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
229 | 17 | * Boston, MA 02111-1307, USA. | ||
230 | 18 | */ | ||
231 | 19 | |||
232 | 20 | public class MouseTouchpad.Backend.MouseSettings : Granite.Services.Settings { | ||
233 | 21 | public bool left_handed { get; set; } | ||
234 | 22 | public bool locate_pointer { get; set; } | ||
235 | 23 | public double motion_acceleration { get; set; } | ||
236 | 24 | public int motion_threshold { get; set; } | ||
237 | 25 | |||
238 | 26 | public MouseSettings () { | ||
239 | 27 | base ("org.gnome.settings-daemon.peripherals.mouse"); | ||
240 | 28 | } | ||
241 | 29 | } | ||
242 | 0 | \ No newline at end of file | 30 | \ No newline at end of file |
243 | 1 | 31 | ||
244 | === added file 'src/Backend/TouchpadSettings.vala' | |||
245 | --- src/Backend/TouchpadSettings.vala 1970-01-01 00:00:00 +0000 | |||
246 | +++ src/Backend/TouchpadSettings.vala 2015-08-23 23:11:04 +0000 | |||
247 | @@ -0,0 +1,32 @@ | |||
248 | 1 | /* | ||
249 | 2 | * Copyright (c) 2011-2015 elementary Developers (https://launchpad.net/elementary) | ||
250 | 3 | * | ||
251 | 4 | * This program is free software; you can redistribute it and/or | ||
252 | 5 | * modify it under the terms of the GNU General Public | ||
253 | 6 | * License as published by the Free Software Foundation; either | ||
254 | 7 | * version 2 of the License, or (at your option) any later version. | ||
255 | 8 | * | ||
256 | 9 | * This program is distributed in the hope that it will be useful, | ||
257 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
258 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
259 | 12 | * General Public License for more details. | ||
260 | 13 | * | ||
261 | 14 | * You should have received a copy of the GNU General Public | ||
262 | 15 | * License along with this program; if not, write to the | ||
263 | 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
264 | 17 | * Boston, MA 02111-1307, USA. | ||
265 | 18 | */ | ||
266 | 19 | |||
267 | 20 | public class MouseTouchpad.Backend.TouchpadSettings : Granite.Services.Settings { | ||
268 | 21 | public bool disable_while_typing { get; set; } | ||
269 | 22 | public bool tap_to_click { get; set; } | ||
270 | 23 | public double motion_acceleration { get; set; } | ||
271 | 24 | public int motion_threshold { get; set; } | ||
272 | 25 | public string scroll_method { get; set; } | ||
273 | 26 | public bool horiz_scroll_enabled { get; set; } | ||
274 | 27 | public bool natural_scroll { get; set; } | ||
275 | 28 | |||
276 | 29 | public TouchpadSettings () { | ||
277 | 30 | base ("org.gnome.settings-daemon.peripherals.touchpad"); | ||
278 | 31 | } | ||
279 | 32 | } | ||
280 | 0 | \ No newline at end of file | 33 | \ No newline at end of file |
281 | 1 | 34 | ||
282 | === modified file 'src/CMakeLists.txt' (properties changed: -x to +x) | |||
283 | --- src/CMakeLists.txt 2014-07-23 01:13:33 +0000 | |||
284 | +++ src/CMakeLists.txt 2015-08-23 23:11:04 +0000 | |||
285 | @@ -4,6 +4,7 @@ | |||
286 | 4 | pkg_check_modules (DEPS REQUIRED gthread-2.0 gtk+-3.0 switchboard-2.0 granite) | 4 | pkg_check_modules (DEPS REQUIRED gthread-2.0 gtk+-3.0 switchboard-2.0 granite) |
287 | 5 | 5 | ||
288 | 6 | add_definitions (${DEPS_CFLAGS}) | 6 | add_definitions (${DEPS_CFLAGS}) |
289 | 7 | add_definitions ("-w") | ||
290 | 7 | link_directories (${DEPS_LIBRARY_DIRS}) | 8 | link_directories (${DEPS_LIBRARY_DIRS}) |
291 | 8 | 9 | ||
292 | 9 | find_package (Vala REQUIRED) | 10 | find_package (Vala REQUIRED) |
293 | @@ -14,14 +15,12 @@ | |||
294 | 14 | # Add all your vala files and requires packages to the List below to include them in the build | 15 | # Add all your vala files and requires packages to the List below to include them in the build |
295 | 15 | vala_precompile (VALA_C ${CMAKE_PROJECT_NAME} | 16 | vala_precompile (VALA_C ${CMAKE_PROJECT_NAME} |
296 | 16 | mouse-touchpad.vala | 17 | mouse-touchpad.vala |
305 | 17 | page.vala | 18 | Backend/MouseSettings.vala |
306 | 18 | 19 | Backend/TouchpadSettings.vala | |
307 | 19 | Pages/Mouse/mouse-page.vala | 20 | Widgets/Section.vala |
308 | 20 | Pages/Mouse/mouse-settings.vala | 21 | Widgets/GeneralSection.vala |
309 | 21 | 22 | Widgets/MouseSection.vala | |
310 | 22 | Pages/Touchpad/touchpad-page.vala | 23 | Widgets/TouchpadSection.vala |
303 | 23 | Pages/Touchpad/touchpad-settings.vala | ||
304 | 24 | |||
311 | 25 | ${CMAKE_CURRENT_BINARY_DIR}/config.vala | 24 | ${CMAKE_CURRENT_BINARY_DIR}/config.vala |
312 | 26 | PACKAGES | 25 | PACKAGES |
313 | 27 | gtk+-3.0 | 26 | gtk+-3.0 |
314 | 28 | 27 | ||
315 | === removed directory 'src/Pages' | |||
316 | === removed directory 'src/Pages/Mouse' | |||
317 | === removed file 'src/Pages/Mouse/mouse-page.vala' | |||
318 | --- src/Pages/Mouse/mouse-page.vala 2014-07-25 19:34:08 +0000 | |||
319 | +++ src/Pages/Mouse/mouse-page.vala 1970-01-01 00:00:00 +0000 | |||
320 | @@ -1,95 +0,0 @@ | |||
321 | 1 | /*** | ||
322 | 2 | Copyright (C) 2014 Keith Gonyon <kgonyon@gmail.com> | ||
323 | 3 | This program is free software: you can redistribute it and/or modify it | ||
324 | 4 | under the terms of the GNU Lesser General Public License version 3, as published | ||
325 | 5 | by the Free Software Foundation. | ||
326 | 6 | This program is distributed in the hope that it will be useful, but | ||
327 | 7 | WITHOUT ANY WARRANTY; without even the implied warranties of | ||
328 | 8 | MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
329 | 9 | PURPOSE. See the GNU General Public License for more details. | ||
330 | 10 | You should have received a copy of the GNU General Public License along | ||
331 | 11 | with this program. If not, see | ||
332 | 12 | ***/ | ||
333 | 13 | namespace MouseTouchpad { | ||
334 | 14 | public class MousePage : AbstractPage { | ||
335 | 15 | /* ---- Layout Variables ---- */ | ||
336 | 16 | |||
337 | 17 | Gtk.Grid pointer_scale_grid; | ||
338 | 18 | |||
339 | 19 | /* ---- Widget Variables ---- */ | ||
340 | 20 | |||
341 | 21 | Gtk.Label pointer_speed_label; | ||
342 | 22 | Gtk.Label acceleration_slow_label; | ||
343 | 23 | Gtk.Label acceleration_fast_label; | ||
344 | 24 | Gtk.Scale acceleration_scale; | ||
345 | 25 | |||
346 | 26 | private MouseSettings mouse_settings; | ||
347 | 27 | |||
348 | 28 | public MousePage () { | ||
349 | 29 | /* ---- Init Settings ---- */ | ||
350 | 30 | |||
351 | 31 | mouse_settings = new MouseSettings (); | ||
352 | 32 | |||
353 | 33 | /* ---- Init Widgets ---- */ | ||
354 | 34 | |||
355 | 35 | // Pointer speed | ||
356 | 36 | pointer_scale_grid = new Gtk.Grid (); | ||
357 | 37 | pointer_speed_label = new Gtk.Label (_("<b>Pointer Speed:</b>")); | ||
358 | 38 | acceleration_slow_label = new Gtk.Label(_("<i>Slow</i>")); | ||
359 | 39 | acceleration_fast_label = new Gtk.Label(_("<i>Fast</i>")); | ||
360 | 40 | acceleration_scale = new Gtk.Scale.with_range (Gtk.Orientation.HORIZONTAL, 1, 10, 1); | ||
361 | 41 | |||
362 | 42 | setup_widgets (); | ||
363 | 43 | setup_signals (); | ||
364 | 44 | |||
365 | 45 | /* ---- Attach widgets ---- */ | ||
366 | 46 | |||
367 | 47 | // Pointer speed | ||
368 | 48 | pointer_scale_grid.attach (acceleration_slow_label, 0, 1, 1, 1); | ||
369 | 49 | pointer_scale_grid.attach (acceleration_scale, 1, 1, 3, 1); | ||
370 | 50 | pointer_scale_grid.attach (acceleration_fast_label, 4, 1, 1, 1); | ||
371 | 51 | this.attach (pointer_speed_label, 0, 0, 1, 1); | ||
372 | 52 | this.attach (pointer_scale_grid, 0, 1, 1, 1); | ||
373 | 53 | } | ||
374 | 54 | |||
375 | 55 | public override void reset () { | ||
376 | 56 | |||
377 | 57 | } | ||
378 | 58 | |||
379 | 59 | private void setup_widgets () { | ||
380 | 60 | /* ---- Grids ---- */ | ||
381 | 61 | |||
382 | 62 | // Pointer Scale | ||
383 | 63 | pointer_scale_grid.column_spacing = 12; | ||
384 | 64 | pointer_scale_grid.margin_top = 12; | ||
385 | 65 | pointer_scale_grid.margin_start = 12; | ||
386 | 66 | pointer_scale_grid.column_homogeneous = false; | ||
387 | 67 | pointer_scale_grid.row_homogeneous = false; | ||
388 | 68 | |||
389 | 69 | /* ---- Widgets ---- */ | ||
390 | 70 | |||
391 | 71 | // Pointer speed | ||
392 | 72 | pointer_speed_label.halign = Gtk.Align.START; | ||
393 | 73 | pointer_speed_label.use_markup = true; | ||
394 | 74 | acceleration_fast_label.use_markup = true; | ||
395 | 75 | acceleration_slow_label.use_markup = true; | ||
396 | 76 | acceleration_scale.draw_value = false; | ||
397 | 77 | acceleration_scale.hexpand = true; | ||
398 | 78 | acceleration_scale.set_value (mouse_settings.motion_acceleration); | ||
399 | 79 | |||
400 | 80 | } | ||
401 | 81 | |||
402 | 82 | private void setup_signals () { | ||
403 | 83 | // Pointer Speed | ||
404 | 84 | acceleration_scale.value_changed.connect (() => { | ||
405 | 85 | mouse_settings.motion_acceleration = acceleration_scale.adjustment.value; | ||
406 | 86 | mouse_settings.motion_threshold = (int) (11.0 - acceleration_scale.adjustment.value); | ||
407 | 87 | }); | ||
408 | 88 | |||
409 | 89 | mouse_settings.changed["motion-acceleration"].connect (() => { | ||
410 | 90 | acceleration_scale.adjustment.value = mouse_settings.motion_acceleration; | ||
411 | 91 | }); | ||
412 | 92 | |||
413 | 93 | } | ||
414 | 94 | } | ||
415 | 95 | } | ||
416 | 96 | \ No newline at end of file | 0 | \ No newline at end of file |
417 | 97 | 1 | ||
418 | === removed file 'src/Pages/Mouse/mouse-settings.vala' | |||
419 | --- src/Pages/Mouse/mouse-settings.vala 2014-07-27 22:49:48 +0000 | |||
420 | +++ src/Pages/Mouse/mouse-settings.vala 1970-01-01 00:00:00 +0000 | |||
421 | @@ -1,31 +0,0 @@ | |||
422 | 1 | /*** | ||
423 | 2 | Copyright (C) 2014 Keith Gonyon <kgonyon@gmail.com> | ||
424 | 3 | This program is free software: you can redistribute it and/or modify it | ||
425 | 4 | under the terms of the GNU Lesser General Public License version 3, as published | ||
426 | 5 | by the Free Software Foundation. | ||
427 | 6 | This program is distributed in the hope that it will be useful, but | ||
428 | 7 | WITHOUT ANY WARRANTY; without even the implied warranties of | ||
429 | 8 | MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
430 | 9 | PURPOSE. See the GNU General Public License for more details. | ||
431 | 10 | You should have received a copy of the GNU General Public License along | ||
432 | 11 | with this program. If not, see | ||
433 | 12 | ***/ | ||
434 | 13 | namespace MouseTouchpad { | ||
435 | 14 | class MouseSettings : Granite.Services.Settings { | ||
436 | 15 | public double motion_acceleration { get; set; } | ||
437 | 16 | public int motion_threshold { get; set; } | ||
438 | 17 | public bool left_handed { get; set; } | ||
439 | 18 | public bool locate_pointer { get; set; } | ||
440 | 19 | |||
441 | 20 | public MouseSettings () { | ||
442 | 21 | base ("org.gnome.settings-daemon.peripherals.mouse"); | ||
443 | 22 | } | ||
444 | 23 | |||
445 | 24 | // public void reset_all () { | ||
446 | 25 | // schema.reset ("motion-acceleration"); | ||
447 | 26 | // schema.reset ("motion-threshold"); | ||
448 | 27 | // schema.reset ("left-handed"); | ||
449 | 28 | // schema.reset ("locate-pointer"); | ||
450 | 29 | // } | ||
451 | 30 | } | ||
452 | 31 | } | ||
453 | 32 | \ No newline at end of file | 0 | \ No newline at end of file |
454 | 33 | 1 | ||
455 | === removed directory 'src/Pages/Touchpad' | |||
456 | === removed file 'src/Pages/Touchpad/touchpad-page.vala' | |||
457 | --- src/Pages/Touchpad/touchpad-page.vala 2014-07-27 22:49:48 +0000 | |||
458 | +++ src/Pages/Touchpad/touchpad-page.vala 1970-01-01 00:00:00 +0000 | |||
459 | @@ -1,280 +0,0 @@ | |||
460 | 1 | /*** | ||
461 | 2 | Copyright (C) 2014 Keith Gonyon <kgonyon@gmail.com> | ||
462 | 3 | This program is free software: you can redistribute it and/or modify it | ||
463 | 4 | under the terms of the GNU Lesser General Public License version 3, as published | ||
464 | 5 | by the Free Software Foundation. | ||
465 | 6 | This program is distributed in the hope that it will be useful, but | ||
466 | 7 | WITHOUT ANY WARRANTY; without even the implied warranties of | ||
467 | 8 | MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
468 | 9 | PURPOSE. See the GNU General Public License for more details. | ||
469 | 10 | You should have received a copy of the GNU General Public License along | ||
470 | 11 | with this program. If not, see | ||
471 | 12 | ***/ | ||
472 | 13 | namespace MouseTouchpad { | ||
473 | 14 | public class TouchpadPage : AbstractPage { | ||
474 | 15 | /* ---- Layout variables ---- */ | ||
475 | 16 | |||
476 | 17 | // Pointer Speed | ||
477 | 18 | Gtk.Grid pointer_speed_grid; | ||
478 | 19 | Gtk.Grid pointer_scale_grid; | ||
479 | 20 | |||
480 | 21 | // General | ||
481 | 22 | Gtk.Grid general_grid; | ||
482 | 23 | |||
483 | 24 | // Scrolling | ||
484 | 25 | Gtk.Grid scrolling_grid; | ||
485 | 26 | Gtk.Grid scrolling_label_grid; | ||
486 | 27 | |||
487 | 28 | /* ---- Widget Variables ---- */ | ||
488 | 29 | |||
489 | 30 | // Pointer speed variables | ||
490 | 31 | Gtk.Label pointer_speed_label; | ||
491 | 32 | Gtk.Label acceleration_slow_label; | ||
492 | 33 | Gtk.Label acceleration_fast_label; | ||
493 | 34 | Gtk.Scale acceleration_scale; | ||
494 | 35 | |||
495 | 36 | // General variables | ||
496 | 37 | Gtk.Label general_label; | ||
497 | 38 | Gtk.CheckButton disable_while_typing_check; | ||
498 | 39 | Gtk.CheckButton tap_to_click_check; | ||
499 | 40 | |||
500 | 41 | // Scrolling variables | ||
501 | 42 | Gtk.Label scrolling_label; | ||
502 | 43 | Gtk.Switch scrolling_switch; | ||
503 | 44 | Gtk.CheckButton natural_scrolling_check; | ||
504 | 45 | Gtk.CheckButton horizontal_scrolling_check; | ||
505 | 46 | Gtk.CheckButton scrolling_two_finger_radio; | ||
506 | 47 | |||
507 | 48 | |||
508 | 49 | private TouchpadSettings touchpad_settings; | ||
509 | 50 | private string previous_scroll_method; | ||
510 | 51 | |||
511 | 52 | public TouchpadPage () { | ||
512 | 53 | touchpad_settings = new TouchpadSettings (); | ||
513 | 54 | /* ---- Init Grids ---- */ | ||
514 | 55 | |||
515 | 56 | scrolling_grid = new Gtk.Grid (); | ||
516 | 57 | scrolling_label_grid = new Gtk.Grid (); | ||
517 | 58 | general_grid = new Gtk.Grid (); | ||
518 | 59 | pointer_speed_grid = new Gtk.Grid (); | ||
519 | 60 | pointer_scale_grid = new Gtk.Grid (); | ||
520 | 61 | |||
521 | 62 | /* ---- Init Widgets ---- */ | ||
522 | 63 | |||
523 | 64 | // Pointer speed | ||
524 | 65 | pointer_speed_label = new Gtk.Label (_("<b>Pointer Speed:</b>")); | ||
525 | 66 | acceleration_slow_label = new Gtk.Label(_("<i>Slow</i>")); | ||
526 | 67 | acceleration_fast_label = new Gtk.Label(_("<i>Fast</i>")); | ||
527 | 68 | acceleration_scale = new Gtk.Scale.with_range (Gtk.Orientation.HORIZONTAL, 1, 10, 1); | ||
528 | 69 | |||
529 | 70 | //General | ||
530 | 71 | general_label = new Gtk.Label (_("<b>General:</b>")); | ||
531 | 72 | disable_while_typing_check = new Gtk.CheckButton.with_label (_("Disable while typing")); | ||
532 | 73 | tap_to_click_check = new Gtk.CheckButton.with_label (_("Tap to click")); | ||
533 | 74 | |||
534 | 75 | // Scrolling | ||
535 | 76 | scrolling_label = new Gtk.Label (_("<b>Scrolling:</b>")); | ||
536 | 77 | scrolling_switch = new Gtk.Switch (); | ||
537 | 78 | natural_scrolling_check = new Gtk.CheckButton.with_label (_("Natural scrolling")); | ||
538 | 79 | horizontal_scrolling_check = new Gtk.CheckButton.with_label (_("Horizontal scrolling")); | ||
539 | 80 | scrolling_two_finger_radio = new Gtk.CheckButton.with_label (_("Two finger scrolling")); | ||
540 | 81 | |||
541 | 82 | setup_widgets (); | ||
542 | 83 | setup_signals (); | ||
543 | 84 | |||
544 | 85 | /* ---- Attach widgets ---- */ | ||
545 | 86 | |||
546 | 87 | // Pointer speed | ||
547 | 88 | pointer_scale_grid.attach (acceleration_slow_label, 0, 1, 1, 1); | ||
548 | 89 | pointer_scale_grid.attach (acceleration_scale, 1, 1, 3, 1); | ||
549 | 90 | pointer_scale_grid.attach (acceleration_fast_label, 4, 1, 1, 1); | ||
550 | 91 | pointer_speed_grid.attach (pointer_speed_label, 0, 0, 1, 1); | ||
551 | 92 | pointer_speed_grid.attach (pointer_scale_grid, 0, 1, 1, 1); | ||
552 | 93 | |||
553 | 94 | // General | ||
554 | 95 | general_grid.attach(disable_while_typing_check, 0, 0, 1, 1); | ||
555 | 96 | general_grid.attach(tap_to_click_check, 0, 1, 1, 1); | ||
556 | 97 | |||
557 | 98 | // Scrolling | ||
558 | 99 | scrolling_label_grid.attach (scrolling_label, 0, 0, 1, 1); | ||
559 | 100 | scrolling_label_grid.attach (scrolling_switch, 1, 0, 1, 1); | ||
560 | 101 | scrolling_grid.attach (natural_scrolling_check, 0, 0, 1, 1); | ||
561 | 102 | scrolling_grid.attach (horizontal_scrolling_check, 0, 1, 1, 1); | ||
562 | 103 | scrolling_grid.attach (scrolling_two_finger_radio, 0, 2, 1, 1); | ||
563 | 104 | |||
564 | 105 | // Main | ||
565 | 106 | this.attach (pointer_speed_grid, 0, 0, 2, 1); | ||
566 | 107 | this.attach (general_label, 0, 1, 1, 1); | ||
567 | 108 | this.attach (general_grid, 0, 2, 1, 1); | ||
568 | 109 | this.attach (scrolling_label_grid, 1, 1, 1, 1); | ||
569 | 110 | this.attach (scrolling_grid, 1, 2, 1, 1); | ||
570 | 111 | } | ||
571 | 112 | |||
572 | 113 | public override void reset () { | ||
573 | 114 | |||
574 | 115 | } | ||
575 | 116 | |||
576 | 117 | private void setup_widgets () { | ||
577 | 118 | /* ---- Grids ---- */ | ||
578 | 119 | |||
579 | 120 | // Pointer Speed | ||
580 | 121 | pointer_scale_grid.row_spacing = 12; | ||
581 | 122 | pointer_scale_grid.column_spacing = 12; | ||
582 | 123 | pointer_scale_grid.margin_top = 12; | ||
583 | 124 | pointer_scale_grid.margin_start = 12; | ||
584 | 125 | pointer_scale_grid.column_homogeneous = false; | ||
585 | 126 | pointer_scale_grid.row_homogeneous = false; | ||
586 | 127 | pointer_speed_grid.row_spacing = 12; | ||
587 | 128 | pointer_speed_grid.column_spacing = 12; | ||
588 | 129 | pointer_speed_grid.column_homogeneous = false; | ||
589 | 130 | pointer_speed_grid.row_homogeneous = false; | ||
590 | 131 | |||
591 | 132 | //General | ||
592 | 133 | general_grid.margin_start = 12; | ||
593 | 134 | general_grid.row_spacing = 12; | ||
594 | 135 | general_grid.column_spacing = 12; | ||
595 | 136 | general_grid.column_homogeneous = false; | ||
596 | 137 | general_grid.row_homogeneous = false; | ||
597 | 138 | |||
598 | 139 | //Scrolling | ||
599 | 140 | scrolling_grid.margin_start = 12; | ||
600 | 141 | scrolling_grid.row_spacing = 12; | ||
601 | 142 | scrolling_grid.column_spacing = 12; | ||
602 | 143 | scrolling_grid.column_homogeneous = false; | ||
603 | 144 | scrolling_grid.row_homogeneous = false; | ||
604 | 145 | scrolling_label_grid.hexpand = false; | ||
605 | 146 | scrolling_label_grid.column_homogeneous = false; | ||
606 | 147 | scrolling_label_grid.column_spacing = 12; | ||
607 | 148 | |||
608 | 149 | /* ---- Widgets ---- */ | ||
609 | 150 | |||
610 | 151 | // Pointer speed | ||
611 | 152 | pointer_speed_label.halign = Gtk.Align.START; | ||
612 | 153 | pointer_speed_label.use_markup = true; | ||
613 | 154 | acceleration_fast_label.use_markup = true; | ||
614 | 155 | acceleration_slow_label.use_markup = true; | ||
615 | 156 | acceleration_scale.draw_value = false; | ||
616 | 157 | acceleration_scale.hexpand = true; | ||
617 | 158 | acceleration_scale.set_value (touchpad_settings.motion_acceleration); | ||
618 | 159 | |||
619 | 160 | // General | ||
620 | 161 | general_label.halign = Gtk.Align.START; | ||
621 | 162 | general_label.use_markup = true; | ||
622 | 163 | tap_to_click_check.active = touchpad_settings.tap_to_click; | ||
623 | 164 | disable_while_typing_check.active = touchpad_settings.disable_while_typing; | ||
624 | 165 | |||
625 | 166 | // Scrolling | ||
626 | 167 | scrolling_label.halign = Gtk.Align.START; | ||
627 | 168 | scrolling_label.use_markup = true; | ||
628 | 169 | natural_scrolling_check.active = touchpad_settings.natural_scroll; | ||
629 | 170 | horizontal_scrolling_check.active = touchpad_settings.horiz_scroll_enabled; | ||
630 | 171 | |||
631 | 172 | var scroll_method = touchpad_settings.scroll_method; | ||
632 | 173 | if (scroll_method == TouchpadSettings.SCROLL_METHOD_DISABLED) { | ||
633 | 174 | scrolling_switch.active = false; | ||
634 | 175 | scrolling_two_finger_radio.sensitive = false; | ||
635 | 176 | natural_scrolling_check.sensitive = false; | ||
636 | 177 | horizontal_scrolling_check.sensitive = false; | ||
637 | 178 | previous_scroll_method = TouchpadSettings.SCROLL_METHOD_EDGE; | ||
638 | 179 | } | ||
639 | 180 | else if (scroll_method == TouchpadSettings.SCROLL_METHOD_EDGE) { | ||
640 | 181 | scrolling_switch.active = true; | ||
641 | 182 | scrolling_two_finger_radio.active = false; | ||
642 | 183 | } | ||
643 | 184 | else if (scroll_method == TouchpadSettings.SCROLL_METHOD_TWO_FINGER) { | ||
644 | 185 | scrolling_switch.active = true; | ||
645 | 186 | scrolling_two_finger_radio.active = true; | ||
646 | 187 | } | ||
647 | 188 | } | ||
648 | 189 | |||
649 | 190 | private void setup_signals () { | ||
650 | 191 | // Pointer Speed | ||
651 | 192 | acceleration_scale.value_changed.connect (() => { | ||
652 | 193 | touchpad_settings.motion_acceleration = acceleration_scale.adjustment.value; | ||
653 | 194 | touchpad_settings.motion_threshold = (int) (11 - acceleration_scale.adjustment.value); | ||
654 | 195 | }); | ||
655 | 196 | |||
656 | 197 | touchpad_settings.changed["motion-acceleration"].connect (() => { | ||
657 | 198 | acceleration_scale.adjustment.value = touchpad_settings.motion_acceleration; | ||
658 | 199 | }); | ||
659 | 200 | |||
660 | 201 | //General | ||
661 | 202 | touchpad_settings.changed["disable-while-typing"].connect (() => { | ||
662 | 203 | disable_while_typing_check.active = touchpad_settings.disable_while_typing; | ||
663 | 204 | }); | ||
664 | 205 | |||
665 | 206 | touchpad_settings.changed["tap-to-click"].connect (() => { | ||
666 | 207 | tap_to_click_check.active = touchpad_settings.tap_to_click; | ||
667 | 208 | }); | ||
668 | 209 | |||
669 | 210 | disable_while_typing_check.notify["active"].connect (() => { | ||
670 | 211 | touchpad_settings.disable_while_typing = disable_while_typing_check.active; | ||
671 | 212 | }); | ||
672 | 213 | |||
673 | 214 | tap_to_click_check.notify["active"].connect (() => { | ||
674 | 215 | touchpad_settings.tap_to_click = tap_to_click_check.active; | ||
675 | 216 | }); | ||
676 | 217 | |||
677 | 218 | // Scrolling | ||
678 | 219 | touchpad_settings.changed["natural-scroll"].connect (() => { | ||
679 | 220 | natural_scrolling_check.active = touchpad_settings.natural_scroll; | ||
680 | 221 | }); | ||
681 | 222 | |||
682 | 223 | touchpad_settings.changed["horiz-scroll-enabled"].connect (() => { | ||
683 | 224 | horizontal_scrolling_check.active = touchpad_settings.horiz_scroll_enabled; | ||
684 | 225 | }); | ||
685 | 226 | |||
686 | 227 | touchpad_settings.changed["scroll-method"].connect (() => { | ||
687 | 228 | var scroll_method = touchpad_settings.scroll_method; | ||
688 | 229 | if (scroll_method == TouchpadSettings.SCROLL_METHOD_DISABLED) | ||
689 | 230 | scrolling_switch.active = false; | ||
690 | 231 | else if (scroll_method == TouchpadSettings.SCROLL_METHOD_EDGE) { | ||
691 | 232 | scrolling_switch.active = true; | ||
692 | 233 | scrolling_two_finger_radio.active = false; | ||
693 | 234 | } | ||
694 | 235 | else { | ||
695 | 236 | scrolling_switch.active = true; | ||
696 | 237 | scrolling_two_finger_radio.active = true; | ||
697 | 238 | } | ||
698 | 239 | }); | ||
699 | 240 | |||
700 | 241 | natural_scrolling_check.notify["active"].connect (() => { | ||
701 | 242 | touchpad_settings.natural_scroll = natural_scrolling_check.active; | ||
702 | 243 | }); | ||
703 | 244 | |||
704 | 245 | horizontal_scrolling_check.notify["active"].connect (() => { | ||
705 | 246 | touchpad_settings.horiz_scroll_enabled = horizontal_scrolling_check.active; | ||
706 | 247 | }); | ||
707 | 248 | |||
708 | 249 | scrolling_switch.notify["active"].connect (() => { | ||
709 | 250 | var active = scrolling_switch.active; | ||
710 | 251 | scrolling_two_finger_radio.sensitive = active; | ||
711 | 252 | natural_scrolling_check.sensitive = active; | ||
712 | 253 | horizontal_scrolling_check.sensitive = active; | ||
713 | 254 | |||
714 | 255 | if (!active) { | ||
715 | 256 | if (scrolling_two_finger_radio.active) | ||
716 | 257 | previous_scroll_method = TouchpadSettings.SCROLL_METHOD_TWO_FINGER; | ||
717 | 258 | else | ||
718 | 259 | previous_scroll_method = TouchpadSettings.SCROLL_METHOD_EDGE; | ||
719 | 260 | touchpad_settings.scroll_method = TouchpadSettings.SCROLL_METHOD_DISABLED; | ||
720 | 261 | } | ||
721 | 262 | else { | ||
722 | 263 | touchpad_settings.scroll_method = previous_scroll_method; | ||
723 | 264 | if (previous_scroll_method == TouchpadSettings.SCROLL_METHOD_EDGE) | ||
724 | 265 | scrolling_two_finger_radio.active = false; | ||
725 | 266 | else | ||
726 | 267 | scrolling_two_finger_radio.active = true; | ||
727 | 268 | } | ||
728 | 269 | }); | ||
729 | 270 | |||
730 | 271 | scrolling_two_finger_radio.notify["active"].connect (() => { | ||
731 | 272 | if (scrolling_two_finger_radio.active) | ||
732 | 273 | touchpad_settings.scroll_method = TouchpadSettings.SCROLL_METHOD_TWO_FINGER; | ||
733 | 274 | else | ||
734 | 275 | touchpad_settings.scroll_method = TouchpadSettings.SCROLL_METHOD_EDGE; | ||
735 | 276 | |||
736 | 277 | }); | ||
737 | 278 | } | ||
738 | 279 | } | ||
739 | 280 | } | ||
740 | 281 | \ No newline at end of file | 0 | \ No newline at end of file |
741 | 282 | 1 | ||
742 | === removed file 'src/Pages/Touchpad/touchpad-settings.vala' | |||
743 | --- src/Pages/Touchpad/touchpad-settings.vala 2014-07-27 22:49:48 +0000 | |||
744 | +++ src/Pages/Touchpad/touchpad-settings.vala 1970-01-01 00:00:00 +0000 | |||
745 | @@ -1,41 +0,0 @@ | |||
746 | 1 | /*** | ||
747 | 2 | Copyright (C) 2014 Keith Gonyon <kgonyon@gmail.com> | ||
748 | 3 | This program is free software: you can redistribute it and/or modify it | ||
749 | 4 | under the terms of the GNU Lesser General Public License version 3, as published | ||
750 | 5 | by the Free Software Foundation. | ||
751 | 6 | This program is distributed in the hope that it will be useful, but | ||
752 | 7 | WITHOUT ANY WARRANTY; without even the implied warranties of | ||
753 | 8 | MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
754 | 9 | PURPOSE. See the GNU General Public License for more details. | ||
755 | 10 | You should have received a copy of the GNU General Public License along | ||
756 | 11 | with this program. If not, see | ||
757 | 12 | ***/ | ||
758 | 13 | namespace MouseTouchpad { | ||
759 | 14 | class TouchpadSettings : Granite.Services.Settings { | ||
760 | 15 | public static string SCROLL_METHOD_DISABLED = "disabled"; | ||
761 | 16 | public static string SCROLL_METHOD_EDGE = "edge-scrolling"; | ||
762 | 17 | public static string SCROLL_METHOD_TWO_FINGER = "two-finger-scrolling"; | ||
763 | 18 | |||
764 | 19 | public bool natural_scroll { get; set; } | ||
765 | 20 | public bool horiz_scroll_enabled { get; set; } | ||
766 | 21 | public bool tap_to_click { get; set; } | ||
767 | 22 | public bool disable_while_typing { get; set; } | ||
768 | 23 | public double motion_acceleration { get; set; } | ||
769 | 24 | public int motion_threshold { get; set; } | ||
770 | 25 | public string scroll_method { get; set; } | ||
771 | 26 | |||
772 | 27 | public TouchpadSettings () { | ||
773 | 28 | base ("org.gnome.settings-daemon.peripherals.touchpad"); | ||
774 | 29 | } | ||
775 | 30 | |||
776 | 31 | // public void reset_all () { | ||
777 | 32 | // schema.reset ("natural-scroll"); | ||
778 | 33 | // schema.reset ("horiz_scroll-enabled"); | ||
779 | 34 | // schema.reset ("tab-to-click"); | ||
780 | 35 | // schema.reset ("disable_while_typeing"); | ||
781 | 36 | // schema.reset ("motion_acceleration"); | ||
782 | 37 | // schema.reset ("motion_threshold"); | ||
783 | 38 | // schema.reset ("scroll_method"); | ||
784 | 39 | // } | ||
785 | 40 | } | ||
786 | 41 | } | ||
787 | 42 | \ No newline at end of file | 0 | \ No newline at end of file |
788 | 43 | 1 | ||
789 | === added directory 'src/Widgets' | |||
790 | === added file 'src/Widgets/GeneralSection.vala' | |||
791 | --- src/Widgets/GeneralSection.vala 1970-01-01 00:00:00 +0000 | |||
792 | +++ src/Widgets/GeneralSection.vala 2015-08-23 23:11:04 +0000 | |||
793 | @@ -0,0 +1,58 @@ | |||
794 | 1 | /* | ||
795 | 2 | * Copyright (c) 2011-2015 elementary Developers (https://launchpad.net/elementary) | ||
796 | 3 | * | ||
797 | 4 | * This program is free software; you can redistribute it and/or | ||
798 | 5 | * modify it under the terms of the GNU General Public | ||
799 | 6 | * License as published by the Free Software Foundation; either | ||
800 | 7 | * version 2 of the License, or (at your option) any later version. | ||
801 | 8 | * | ||
802 | 9 | * This program is distributed in the hope that it will be useful, | ||
803 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
804 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
805 | 12 | * General Public License for more details. | ||
806 | 13 | * | ||
807 | 14 | * You should have received a copy of the GNU General Public | ||
808 | 15 | * License along with this program; if not, write to the | ||
809 | 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
810 | 17 | * Boston, MA 02111-1307, USA. | ||
811 | 18 | */ | ||
812 | 19 | |||
813 | 20 | public class MouseTouchpad.Widgets.GeneralSection : Section { | ||
814 | 21 | private Backend.MouseSettings mouse_settings; | ||
815 | 22 | |||
816 | 23 | private Granite.Widgets.ModeButton primary_button_switcher; | ||
817 | 24 | private Gtk.Switch reveal_pointer_switch; | ||
818 | 25 | |||
819 | 26 | public GeneralSection (Backend.MouseSettings mouse_settings) { | ||
820 | 27 | base (_("General")); | ||
821 | 28 | |||
822 | 29 | this.mouse_settings = mouse_settings; | ||
823 | 30 | |||
824 | 31 | build_ui (); | ||
825 | 32 | create_bindings (); | ||
826 | 33 | } | ||
827 | 34 | |||
828 | 35 | private void build_ui () { | ||
829 | 36 | primary_button_switcher = new Granite.Widgets.ModeButton (); | ||
830 | 37 | primary_button_switcher.append_text (_("Left")); | ||
831 | 38 | primary_button_switcher.append_text (_("Right")); | ||
832 | 39 | |||
833 | 40 | reveal_pointer_switch = new Gtk.Switch (); | ||
834 | 41 | reveal_pointer_switch.halign = Gtk.Align.START; | ||
835 | 42 | |||
836 | 43 | this.add_entry (_("Primary Button:"), primary_button_switcher); | ||
837 | 44 | this.add_entry (_("Reveal pointer:"), reveal_pointer_switch, _("Pressing the control key will highlight the position of the pointer")); | ||
838 | 45 | } | ||
839 | 46 | |||
840 | 47 | private void create_bindings () { | ||
841 | 48 | mouse_settings.bind_property ("left-handed", | ||
842 | 49 | primary_button_switcher, | ||
843 | 50 | "selected", | ||
844 | 51 | BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE); | ||
845 | 52 | |||
846 | 53 | mouse_settings.bind_property ("locate-pointer", | ||
847 | 54 | reveal_pointer_switch, | ||
848 | 55 | "state", | ||
849 | 56 | BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE); | ||
850 | 57 | } | ||
851 | 58 | } | ||
852 | 0 | \ No newline at end of file | 59 | \ No newline at end of file |
853 | 1 | 60 | ||
854 | === added file 'src/Widgets/MouseSection.vala' | |||
855 | --- src/Widgets/MouseSection.vala 1970-01-01 00:00:00 +0000 | |||
856 | +++ src/Widgets/MouseSection.vala 2015-08-23 23:11:04 +0000 | |||
857 | @@ -0,0 +1,62 @@ | |||
858 | 1 | /* | ||
859 | 2 | * Copyright (c) 2011-2015 elementary Developers (https://launchpad.net/elementary) | ||
860 | 3 | * | ||
861 | 4 | * This program is free software; you can redistribute it and/or | ||
862 | 5 | * modify it under the terms of the GNU General Public | ||
863 | 6 | * License as published by the Free Software Foundation; either | ||
864 | 7 | * version 2 of the License, or (at your option) any later version. | ||
865 | 8 | * | ||
866 | 9 | * This program is distributed in the hope that it will be useful, | ||
867 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
868 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
869 | 12 | * General Public License for more details. | ||
870 | 13 | * | ||
871 | 14 | * You should have received a copy of the GNU General Public | ||
872 | 15 | * License along with this program; if not, write to the | ||
873 | 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
874 | 17 | * Boston, MA 02111-1307, USA. | ||
875 | 18 | */ | ||
876 | 19 | |||
877 | 20 | public class MouseTouchpad.Widgets.MouseSection : Section { | ||
878 | 21 | private Backend.MouseSettings mouse_settings; | ||
879 | 22 | |||
880 | 23 | private Gtk.Scale pointer_speed_scale; | ||
881 | 24 | |||
882 | 25 | public MouseSection (Backend.MouseSettings mouse_settings) { | ||
883 | 26 | base (_("Mouse")); | ||
884 | 27 | |||
885 | 28 | this.mouse_settings = mouse_settings; | ||
886 | 29 | |||
887 | 30 | build_ui (); | ||
888 | 31 | create_bindings (); | ||
889 | 32 | } | ||
890 | 33 | |||
891 | 34 | private void build_ui () { | ||
892 | 35 | pointer_speed_scale = new Gtk.Scale.with_range (Gtk.Orientation.HORIZONTAL, 1, 10, 1); | ||
893 | 36 | pointer_speed_scale.digits = 2; | ||
894 | 37 | pointer_speed_scale.draw_value = false; | ||
895 | 38 | pointer_speed_scale.set_size_request (160, -1); | ||
896 | 39 | |||
897 | 40 | this.add_entry (_ ("Pointer speed:"), pointer_speed_scale); | ||
898 | 41 | } | ||
899 | 42 | |||
900 | 43 | private void create_bindings () { | ||
901 | 44 | mouse_settings.bind_property ("motion-acceleration", | ||
902 | 45 | pointer_speed_scale.adjustment, | ||
903 | 46 | "value", | ||
904 | 47 | BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE); | ||
905 | 48 | |||
906 | 49 | pointer_speed_scale.adjustment.bind_property ("value", | ||
907 | 50 | mouse_settings, | ||
908 | 51 | "motion-threshold", | ||
909 | 52 | BindingFlags.SYNC_CREATE, | ||
910 | 53 | pointer_speed_scale_transform_func); | ||
911 | 54 | } | ||
912 | 55 | |||
913 | 56 | private bool pointer_speed_scale_transform_func (Binding binding, Value source_value, ref Value target_value) { | ||
914 | 57 | int val = 11 - (int)source_value.get_double (); | ||
915 | 58 | target_value.set_int (val); | ||
916 | 59 | |||
917 | 60 | return true; | ||
918 | 61 | } | ||
919 | 62 | } | ||
920 | 0 | \ No newline at end of file | 63 | \ No newline at end of file |
921 | 1 | 64 | ||
922 | === added file 'src/Widgets/Section.vala' | |||
923 | --- src/Widgets/Section.vala 1970-01-01 00:00:00 +0000 | |||
924 | +++ src/Widgets/Section.vala 2015-08-23 23:11:04 +0000 | |||
925 | @@ -0,0 +1,64 @@ | |||
926 | 1 | /* | ||
927 | 2 | * Copyright (c) 2011-2015 elementary Developers (https://launchpad.net/elementary) | ||
928 | 3 | * | ||
929 | 4 | * This program is free software; you can redistribute it and/or | ||
930 | 5 | * modify it under the terms of the GNU General Public | ||
931 | 6 | * License as published by the Free Software Foundation; either | ||
932 | 7 | * version 2 of the License, or (at your option) any later version. | ||
933 | 8 | * | ||
934 | 9 | * This program is distributed in the hope that it will be useful, | ||
935 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
936 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
937 | 12 | * General Public License for more details. | ||
938 | 13 | * | ||
939 | 14 | * You should have received a copy of the GNU General Public | ||
940 | 15 | * License along with this program; if not, write to the | ||
941 | 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
942 | 17 | * Boston, MA 02111-1307, USA. | ||
943 | 18 | */ | ||
944 | 19 | |||
945 | 20 | public class MouseTouchpad.Widgets.Section : Gtk.Grid { | ||
946 | 21 | private Gtk.Label title_label; | ||
947 | 22 | |||
948 | 23 | private int row_count = 0; | ||
949 | 24 | |||
950 | 25 | public Section (string title) { | ||
951 | 26 | build_ui (title); | ||
952 | 27 | } | ||
953 | 28 | |||
954 | 29 | public void add_entry (string option, Gtk.Widget widget, string description = "") { | ||
955 | 30 | int row = row_count++; | ||
956 | 31 | |||
957 | 32 | Gtk.Label option_label = new Gtk.Label (option); | ||
958 | 33 | option_label.halign = Gtk.Align.END; | ||
959 | 34 | |||
960 | 35 | this.attach (option_label, 0, row, 1, 1); | ||
961 | 36 | |||
962 | 37 | if (description == "") { | ||
963 | 38 | this.attach (widget, 1, row, 1, 1); | ||
964 | 39 | } else { | ||
965 | 40 | Gtk.Box widget_container = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0); | ||
966 | 41 | widget_container.hexpand = false; | ||
967 | 42 | |||
968 | 43 | Gtk.Image help_icon = new Gtk.Image.from_icon_name ("help-info-symbolic", Gtk.IconSize.BUTTON); | ||
969 | 44 | help_icon.tooltip_text = description; | ||
970 | 45 | |||
971 | 46 | widget_container.add (widget); | ||
972 | 47 | widget_container.add (help_icon); | ||
973 | 48 | |||
974 | 49 | this.attach (widget_container, 1, row, 1, 1); | ||
975 | 50 | } | ||
976 | 51 | } | ||
977 | 52 | |||
978 | 53 | private void build_ui (string title) { | ||
979 | 54 | this.row_spacing = 12; | ||
980 | 55 | this.column_spacing = 12; | ||
981 | 56 | this.column_homogeneous = true; | ||
982 | 57 | |||
983 | 58 | title_label = new Gtk.Label (title); | ||
984 | 59 | title_label.halign = Gtk.Align.START; | ||
985 | 60 | title_label.get_style_context ().add_class ("h4"); | ||
986 | 61 | |||
987 | 62 | this.attach (title_label, 0, row_count++, 2, 1); | ||
988 | 63 | } | ||
989 | 64 | } | ||
990 | 0 | \ No newline at end of file | 65 | \ No newline at end of file |
991 | 1 | 66 | ||
992 | === added file 'src/Widgets/TouchpadSection.vala' | |||
993 | --- src/Widgets/TouchpadSection.vala 1970-01-01 00:00:00 +0000 | |||
994 | +++ src/Widgets/TouchpadSection.vala 2015-08-23 23:11:04 +0000 | |||
995 | @@ -0,0 +1,114 @@ | |||
996 | 1 | /* | ||
997 | 2 | * Copyright (c) 2011-2015 elementary Developers (https://launchpad.net/elementary) | ||
998 | 3 | * | ||
999 | 4 | * This program is free software; you can redistribute it and/or | ||
1000 | 5 | * modify it under the terms of the GNU General Public | ||
1001 | 6 | * License as published by the Free Software Foundation; either | ||
1002 | 7 | * version 2 of the License, or (at your option) any later version. | ||
1003 | 8 | * | ||
1004 | 9 | * This program is distributed in the hope that it will be useful, | ||
1005 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1006 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
1007 | 12 | * General Public License for more details. | ||
1008 | 13 | * | ||
1009 | 14 | * You should have received a copy of the GNU General Public | ||
1010 | 15 | * License along with this program; if not, write to the | ||
1011 | 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
1012 | 17 | * Boston, MA 02111-1307, USA. | ||
1013 | 18 | */ | ||
1014 | 19 | |||
1015 | 20 | public class MouseTouchpad.Widgets.TouchpadSection : Section { | ||
1016 | 21 | private Backend.TouchpadSettings touchpad_settings; | ||
1017 | 22 | |||
1018 | 23 | private Gtk.Switch disable_while_typing_switch; | ||
1019 | 24 | private Gtk.Switch tap_to_click_switch; | ||
1020 | 25 | private Gtk.Scale pointer_speed_scale; | ||
1021 | 26 | private Gtk.ComboBoxText scrolling_combobox; | ||
1022 | 27 | private Gtk.Switch horizontal_scrolling_switch; | ||
1023 | 28 | private Gtk.Switch natural_scrolling_switch; | ||
1024 | 29 | |||
1025 | 30 | public TouchpadSection (Backend.TouchpadSettings touchpad_settings) { | ||
1026 | 31 | base (_("Touchpad")); | ||
1027 | 32 | |||
1028 | 33 | this.touchpad_settings = touchpad_settings; | ||
1029 | 34 | |||
1030 | 35 | build_ui (); | ||
1031 | 36 | create_bindings (); | ||
1032 | 37 | } | ||
1033 | 38 | |||
1034 | 39 | private void build_ui () { | ||
1035 | 40 | disable_while_typing_switch = new Gtk.Switch (); | ||
1036 | 41 | disable_while_typing_switch.halign = Gtk.Align.START; | ||
1037 | 42 | |||
1038 | 43 | tap_to_click_switch = new Gtk.Switch (); | ||
1039 | 44 | tap_to_click_switch.halign = Gtk.Align.START; | ||
1040 | 45 | |||
1041 | 46 | pointer_speed_scale = new Gtk.Scale.with_range (Gtk.Orientation.HORIZONTAL, 1, 10, 1); | ||
1042 | 47 | pointer_speed_scale.digits = 2; | ||
1043 | 48 | pointer_speed_scale.draw_value = false; | ||
1044 | 49 | pointer_speed_scale.set_size_request (160, -1); | ||
1045 | 50 | |||
1046 | 51 | scrolling_combobox = new Gtk.ComboBoxText (); | ||
1047 | 52 | scrolling_combobox.append ("two-finger-scrolling", _("Two-finger")); | ||
1048 | 53 | scrolling_combobox.append ("edge-scrolling", _("Edge")); | ||
1049 | 54 | scrolling_combobox.append ("disabled", _("Disabled")); | ||
1050 | 55 | |||
1051 | 56 | horizontal_scrolling_switch = new Gtk.Switch (); | ||
1052 | 57 | horizontal_scrolling_switch.halign = Gtk.Align.START; | ||
1053 | 58 | |||
1054 | 59 | natural_scrolling_switch = new Gtk.Switch (); | ||
1055 | 60 | natural_scrolling_switch.halign = Gtk.Align.START; | ||
1056 | 61 | |||
1057 | 62 | this.add_entry (_("Disable while typing:"), disable_while_typing_switch); | ||
1058 | 63 | this.add_entry (_("Tap to click:"), tap_to_click_switch); | ||
1059 | 64 | this.add_entry (_("Pointer speed:"), pointer_speed_scale); | ||
1060 | 65 | this.add_entry (_("Scrolling:"), scrolling_combobox); | ||
1061 | 66 | this.add_entry (_("Horizontal scrolling:"), horizontal_scrolling_switch); | ||
1062 | 67 | this.add_entry (_("Natural scrolling:"), natural_scrolling_switch); | ||
1063 | 68 | } | ||
1064 | 69 | |||
1065 | 70 | private void create_bindings () { | ||
1066 | 71 | touchpad_settings.bind_property ("disable-while-typing", | ||
1067 | 72 | disable_while_typing_switch, | ||
1068 | 73 | "state", | ||
1069 | 74 | BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE); | ||
1070 | 75 | |||
1071 | 76 | touchpad_settings.bind_property ("tap-to-click", | ||
1072 | 77 | tap_to_click_switch, | ||
1073 | 78 | "state", | ||
1074 | 79 | BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE); | ||
1075 | 80 | |||
1076 | 81 | touchpad_settings.bind_property ("motion-acceleration", | ||
1077 | 82 | pointer_speed_scale.adjustment, | ||
1078 | 83 | "value", | ||
1079 | 84 | BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE); | ||
1080 | 85 | |||
1081 | 86 | pointer_speed_scale.adjustment.bind_property ("value", | ||
1082 | 87 | touchpad_settings, | ||
1083 | 88 | "motion-threshold", | ||
1084 | 89 | BindingFlags.SYNC_CREATE, | ||
1085 | 90 | pointer_speed_scale_transform_func); | ||
1086 | 91 | |||
1087 | 92 | touchpad_settings.bind_property ("scroll-method", | ||
1088 | 93 | scrolling_combobox, | ||
1089 | 94 | "active-id", | ||
1090 | 95 | BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE); | ||
1091 | 96 | |||
1092 | 97 | touchpad_settings.bind_property ("horiz-scroll-enabled", | ||
1093 | 98 | horizontal_scrolling_switch, | ||
1094 | 99 | "state", | ||
1095 | 100 | BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE); | ||
1096 | 101 | |||
1097 | 102 | touchpad_settings.bind_property ("natural-scroll", | ||
1098 | 103 | natural_scrolling_switch, | ||
1099 | 104 | "state", | ||
1100 | 105 | BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE); | ||
1101 | 106 | } | ||
1102 | 107 | |||
1103 | 108 | private bool pointer_speed_scale_transform_func (Binding binding, Value source_value, ref Value target_value) { | ||
1104 | 109 | int val = 11 - (int)source_value.get_double (); | ||
1105 | 110 | target_value.set_int (val); | ||
1106 | 111 | |||
1107 | 112 | return true; | ||
1108 | 113 | } | ||
1109 | 114 | } | ||
1110 | 0 | \ No newline at end of file | 115 | \ No newline at end of file |
1111 | 1 | 116 | ||
1112 | === modified file 'src/mouse-touchpad.vala' (properties changed: -x to +x) | |||
1113 | --- src/mouse-touchpad.vala 2014-07-27 22:49:48 +0000 | |||
1114 | +++ src/mouse-touchpad.vala 2015-08-23 23:11:04 +0000 | |||
1115 | @@ -1,35 +1,32 @@ | |||
1128 | 1 | /*** | 1 | /* |
1129 | 2 | Copyright (C) 2014 Keith Gonyon <kgonyon@gmail.com> | 2 | * Copyright (c) 2011-2015 elementary Developers (https://launchpad.net/elementary) |
1130 | 3 | This program is free software: you can redistribute it and/or modify it | 3 | * |
1131 | 4 | under the terms of the GNU Lesser General Public License version 3, as published | 4 | * This program is free software; you can redistribute it and/or |
1132 | 5 | by the Free Software Foundation. | 5 | * modify it under the terms of the GNU General Public |
1133 | 6 | This program is distributed in the hope that it will be useful, but | 6 | * License as published by the Free Software Foundation; either |
1134 | 7 | WITHOUT ANY WARRANTY; without even the implied warranties of | 7 | * version 2 of the License, or (at your option) any later version. |
1135 | 8 | MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | 8 | * |
1136 | 9 | PURPOSE. See the GNU General Public License for more details. | 9 | * This program is distributed in the hope that it will be useful, |
1137 | 10 | You should have received a copy of the GNU General Public License along | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1138 | 11 | with this program. If not, see | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
1139 | 12 | ***/ | 12 | * General Public License for more details. |
1140 | 13 | * | ||
1141 | 14 | * You should have received a copy of the GNU General Public | ||
1142 | 15 | * License along with this program; if not, write to the | ||
1143 | 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
1144 | 17 | * Boston, MA 02111-1307, USA. | ||
1145 | 18 | */ | ||
1146 | 19 | |||
1147 | 13 | namespace MouseTouchpad { | 20 | namespace MouseTouchpad { |
1148 | 14 | public class Plug : Switchboard.Plug { | 21 | public class Plug : Switchboard.Plug { |
1167 | 15 | /* ---- Layout Variables ---- */ | 22 | private Backend.MouseSettings mouse_settings; |
1168 | 16 | Gtk.Grid main_grid; | 23 | private Backend.TouchpadSettings touchpad_settings; |
1169 | 17 | Gtk.Grid separator_grid; | 24 | |
1170 | 18 | Gtk.Separator left_separator; | 25 | private Gtk.Grid main_grid; |
1171 | 19 | Gtk.Separator right_separator; | 26 | |
1172 | 20 | Gtk.Stack pages; | 27 | private Widgets.GeneralSection general_section; |
1173 | 21 | Gtk.StackSwitcher page_switcher; | 28 | private Widgets.MouseSection mouse_section; |
1174 | 22 | 29 | private Widgets.TouchpadSection touchpad_section; | |
1157 | 23 | /* ----- General settings variables ---- */ | ||
1158 | 24 | Gtk.Label general_settings_label; | ||
1159 | 25 | Gtk.ButtonBox handed_buttons; | ||
1160 | 26 | Gtk.RadioButton left_handed_button; | ||
1161 | 27 | Gtk.RadioButton right_handed_button; | ||
1162 | 28 | Gtk.Grid pointer_reveal_grid; | ||
1163 | 29 | Gtk.CheckButton pointer_reveal_check; | ||
1164 | 30 | |||
1165 | 31 | // Settings | ||
1166 | 32 | MouseSettings mouse_settings; | ||
1175 | 33 | 30 | ||
1176 | 34 | public Plug () { | 31 | public Plug () { |
1177 | 35 | Object (category: Category.HARDWARE, | 32 | Object (category: Category.HARDWARE, |
1178 | @@ -37,120 +34,58 @@ | |||
1179 | 37 | display_name: _("Mouse & Touchpad"), | 34 | display_name: _("Mouse & Touchpad"), |
1180 | 38 | description: _("Set your mouse and touchpad preferences"), | 35 | description: _("Set your mouse and touchpad preferences"), |
1181 | 39 | icon: "preferences-desktop-peripherals"); | 36 | icon: "preferences-desktop-peripherals"); |
1182 | 40 | |||
1183 | 41 | mouse_settings = new MouseSettings (); | ||
1184 | 42 | } | 37 | } |
1185 | 43 | 38 | ||
1186 | 44 | public override Gtk.Widget get_widget () { | 39 | public override Gtk.Widget get_widget () { |
1187 | 45 | if (main_grid == null) { | 40 | if (main_grid == null) { |
1223 | 46 | // Initialize variables | 41 | load_settings (); |
1224 | 47 | // Main | 42 | build_ui (); |
1190 | 48 | main_grid = new Gtk.Grid (); | ||
1191 | 49 | separator_grid = new Gtk.Grid (); | ||
1192 | 50 | pages = new Gtk.Stack (); | ||
1193 | 51 | page_switcher = new Gtk.StackSwitcher (); | ||
1194 | 52 | // General | ||
1195 | 53 | general_settings_label = new Gtk.Label (_("<b>General:</b>")); | ||
1196 | 54 | handed_buttons = new Gtk.ButtonBox (Gtk.Orientation.HORIZONTAL); | ||
1197 | 55 | left_handed_button = new Gtk.RadioButton.with_label (null, _("Left-handed")); | ||
1198 | 56 | right_handed_button = new Gtk.RadioButton.with_label (left_handed_button.get_group(), | ||
1199 | 57 | _("Right-handed")); | ||
1200 | 58 | pointer_reveal_grid = new Gtk.Grid (); | ||
1201 | 59 | pointer_reveal_check = new Gtk.CheckButton.with_label (_("Pointer Reveal")); | ||
1202 | 60 | left_separator = new Gtk.Separator (Gtk.Orientation.HORIZONTAL); | ||
1203 | 61 | right_separator = new Gtk.Separator (Gtk.Orientation.HORIZONTAL); | ||
1204 | 62 | |||
1205 | 63 | setup_widgets (); | ||
1206 | 64 | setup_signals (); | ||
1207 | 65 | |||
1208 | 66 | // Attach | ||
1209 | 67 | // General | ||
1210 | 68 | handed_buttons.add (left_handed_button); | ||
1211 | 69 | handed_buttons.add (right_handed_button); | ||
1212 | 70 | pointer_reveal_grid.attach (pointer_reveal_check, 0, 0, 1, 1); | ||
1213 | 71 | // Separator | ||
1214 | 72 | separator_grid.add (left_separator); | ||
1215 | 73 | separator_grid.add (page_switcher); | ||
1216 | 74 | separator_grid.add (right_separator); | ||
1217 | 75 | // Main | ||
1218 | 76 | main_grid.attach (general_settings_label, 0, 0, 1, 1); | ||
1219 | 77 | main_grid.attach (pointer_reveal_grid, 0, 1, 1, 1); | ||
1220 | 78 | main_grid.attach (handed_buttons, 0, 2, 1, 1); | ||
1221 | 79 | main_grid.attach (separator_grid, 0, 4, 1, 1); | ||
1222 | 80 | main_grid.attach (pages, 0, 5, 1, 1); | ||
1225 | 81 | } | 43 | } |
1226 | 82 | 44 | ||
1227 | 83 | main_grid.show_all (); | ||
1228 | 84 | return main_grid; | 45 | return main_grid; |
1229 | 85 | } | 46 | } |
1230 | 86 | 47 | ||
1231 | 87 | public override void shown () { | 48 | public override void shown () { |
1232 | 88 | |||
1233 | 89 | } | 49 | } |
1234 | 90 | 50 | ||
1235 | 91 | public override void hidden () { | 51 | public override void hidden () { |
1236 | 92 | |||
1237 | 93 | } | 52 | } |
1238 | 94 | 53 | ||
1239 | 95 | public override void search_callback (string location) { | 54 | public override void search_callback (string location) { |
1240 | 96 | |||
1241 | 97 | } | 55 | } |
1242 | 98 | 56 | ||
1244 | 99 | // 'search' returns results like ("Keyboard → Behavior → Duration", "keyboard<sep>behavior") | 57 | /* 'search' returns results like ("Keyboard → Behavior → Duration", "keyboard<sep>behavior") */ |
1245 | 100 | public override async Gee.TreeMap<string, string> search (string search) { | 58 | public override async Gee.TreeMap<string, string> search (string search) { |
1246 | 101 | return new Gee.TreeMap<string, string> (null, null); | 59 | return new Gee.TreeMap<string, string> (null, null); |
1247 | 102 | } | 60 | } |
1248 | 103 | 61 | ||
1252 | 104 | private void setup_widgets () { | 62 | private void load_settings () { |
1253 | 105 | // Grid | 63 | mouse_settings = new Backend.MouseSettings (); |
1254 | 106 | main_grid.margin = 12; | 64 | touchpad_settings = new Backend.TouchpadSettings (); |
1255 | 65 | } | ||
1256 | 66 | |||
1257 | 67 | private void build_ui () { | ||
1258 | 68 | main_grid = new Gtk.Grid (); | ||
1259 | 69 | main_grid.margin = 12; | ||
1260 | 107 | main_grid.row_spacing = 12; | 70 | main_grid.row_spacing = 12; |
1301 | 108 | 71 | main_grid.halign = Gtk.Align.CENTER; | |
1302 | 109 | separator_grid.hexpand = true; | 72 | |
1303 | 110 | left_separator.hexpand = true; | 73 | general_section = new Widgets.GeneralSection (mouse_settings); |
1304 | 111 | right_separator.hexpand = true; | 74 | mouse_section = new Widgets.MouseSection (mouse_settings); |
1305 | 112 | 75 | touchpad_section = new Widgets.TouchpadSection (touchpad_settings); | |
1306 | 113 | // Pages | 76 | |
1307 | 114 | page_switcher.set_stack(pages); | 77 | main_grid.attach (general_section, 0, 0, 1, 1); |
1308 | 115 | page_switcher.halign = Gtk.Align.CENTER; | 78 | main_grid.attach (mouse_section, 0, 1, 1, 1); |
1309 | 116 | pages.add_titled (new MousePage (), "mouse", _("Mouse")); | 79 | main_grid.attach (touchpad_section, 0, 2, 1, 1); |
1310 | 117 | pages.add_titled (new TouchpadPage (), "touchpad", _("Touchpad")); | 80 | main_grid.show_all (); |
1271 | 118 | |||
1272 | 119 | // General | ||
1273 | 120 | general_settings_label.use_markup = true; | ||
1274 | 121 | general_settings_label.halign = Gtk.Align.START; | ||
1275 | 122 | handed_buttons.layout_style = Gtk.ButtonBoxStyle.START; | ||
1276 | 123 | handed_buttons.margin_start = 12; | ||
1277 | 124 | pointer_reveal_grid.margin_start = 12; | ||
1278 | 125 | pointer_reveal_grid.column_spacing = 12; | ||
1279 | 126 | |||
1280 | 127 | left_handed_button.active = mouse_settings.left_handed; | ||
1281 | 128 | right_handed_button.active = !mouse_settings.left_handed; | ||
1282 | 129 | } | ||
1283 | 130 | |||
1284 | 131 | private void setup_signals () { | ||
1285 | 132 | mouse_settings.changed["left-handed"].connect (() => { | ||
1286 | 133 | left_handed_button.active = mouse_settings.left_handed; | ||
1287 | 134 | right_handed_button.active = !mouse_settings.left_handed; | ||
1288 | 135 | }); | ||
1289 | 136 | |||
1290 | 137 | mouse_settings.changed["locate-pointer"].connect (() => { | ||
1291 | 138 | pointer_reveal_check.active = mouse_settings.locate_pointer; | ||
1292 | 139 | }); | ||
1293 | 140 | |||
1294 | 141 | left_handed_button.notify["active"].connect (() => { | ||
1295 | 142 | mouse_settings.left_handed = left_handed_button.active; | ||
1296 | 143 | }); | ||
1297 | 144 | |||
1298 | 145 | pointer_reveal_check.notify["active"].connect (() => { | ||
1299 | 146 | mouse_settings.locate_pointer = pointer_reveal_check.active; | ||
1300 | 147 | }); | ||
1311 | 148 | } | 81 | } |
1312 | 149 | } | 82 | } |
1313 | 150 | } | 83 | } |
1314 | 151 | 84 | ||
1315 | 152 | public Switchboard.Plug get_plug (Module module) { | 85 | public Switchboard.Plug get_plug (Module module) { |
1316 | 153 | debug ("Activating Mouse-Touchpad plug"); | 86 | debug ("Activating Mouse-Touchpad plug"); |
1317 | 87 | |||
1318 | 154 | var plug = new MouseTouchpad.Plug (); | 88 | var plug = new MouseTouchpad.Plug (); |
1319 | 89 | |||
1320 | 155 | return plug; | 90 | return plug; |
1321 | 156 | } | 91 | } |
1322 | 157 | \ No newline at end of file | 92 | \ No newline at end of file |
1323 | 158 | 93 | ||
1324 | === removed file 'src/page.vala' | |||
1325 | --- src/page.vala 2014-07-25 19:34:08 +0000 | |||
1326 | +++ src/page.vala 1970-01-01 00:00:00 +0000 | |||
1327 | @@ -1,27 +0,0 @@ | |||
1328 | 1 | /*** | ||
1329 | 2 | Copyright (C) 2014 Keith Gonyon <kgonyon@gmail.com> | ||
1330 | 3 | This program is free software: you can redistribute it and/or modify it | ||
1331 | 4 | under the terms of the GNU Lesser General Public License version 3, as published | ||
1332 | 5 | by the Free Software Foundation. | ||
1333 | 6 | This program is distributed in the hope that it will be useful, but | ||
1334 | 7 | WITHOUT ANY WARRANTY; without even the implied warranties of | ||
1335 | 8 | MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
1336 | 9 | PURPOSE. See the GNU General Public License for more details. | ||
1337 | 10 | You should have received a copy of the GNU General Public License along | ||
1338 | 11 | with this program. If not, see | ||
1339 | 12 | ***/ | ||
1340 | 13 | namespace MouseTouchpad { | ||
1341 | 14 | public abstract class AbstractPage : Gtk.Grid { | ||
1342 | 15 | public AbstractPage () { | ||
1343 | 16 | |||
1344 | 17 | this.row_spacing = 24; | ||
1345 | 18 | this.column_spacing = 12; | ||
1346 | 19 | this.margin_top = 12; | ||
1347 | 20 | this.margin_bottom = 12; | ||
1348 | 21 | this.column_homogeneous = true; | ||
1349 | 22 | this.row_homogeneous = false; | ||
1350 | 23 | } | ||
1351 | 24 | |||
1352 | 25 | public abstract void reset (); | ||
1353 | 26 | } | ||
1354 | 27 | } | ||
1355 | 28 | \ No newline at end of file | 0 | \ No newline at end of file |
I can confirm that the settings work as expected here :)