summaryrefslogtreecommitdiff
path: root/apps/menus
diff options
context:
space:
mode:
Diffstat (limited to 'apps/menus')
-rw-r--r--apps/menus/display_menu.c29
-rw-r--r--apps/menus/settings_menu.c18
2 files changed, 29 insertions, 18 deletions
diff --git a/apps/menus/display_menu.c b/apps/menus/display_menu.c
index a015be3a23..aee9c1828d 100644
--- a/apps/menus/display_menu.c
+++ b/apps/menus/display_menu.c
@@ -36,6 +36,9 @@
36#include "talk.h" 36#include "talk.h"
37#include "lcd.h" 37#include "lcd.h"
38#include "lcd-remote.h" 38#include "lcd-remote.h"
39#ifdef HAVE_TOUCHSCREEN
40#include "screens.h"
41#endif
39 42
40#ifdef HAVE_BACKLIGHT 43#ifdef HAVE_BACKLIGHT
41static int filterfirstkeypress_callback(int action,const struct menu_item_ex *this_item) 44static int filterfirstkeypress_callback(int action,const struct menu_item_ex *this_item)
@@ -496,6 +499,29 @@ MAKE_MENU(peak_meter_menu, ID2P(LANG_PM_MENU), NULL, Icon_NOICON,
496/***********************************/ 499/***********************************/
497 500
498 501
502#ifdef HAVE_TOUCHSCREEN
503static int touch_mode_callback(int action,const struct menu_item_ex *this_item)
504{
505 (void)this_item;
506 switch (action)
507 {
508 case ACTION_EXIT_MENUITEM: /* on exit */
509 touchscreen_set_mode(global_settings.touch_mode);
510 break;
511 }
512 return action;
513}
514MENUITEM_SETTING(touch_mode, &global_settings.touch_mode, touch_mode_callback);
515
516MENUITEM_FUNCTION(touchscreen_menu_calibrate, 0, ID2P(LANG_TOUCHSCREEN_CALIBRATE), calibrate,
517 NULL, NULL, Icon_NOICON);
518MENUITEM_FUNCTION(touchscreen_menu_reset_calibration, 0, ID2P(LANG_TOUCHSCREEN_RESET_CALIBRATION), reset_mapping,
519 NULL, NULL, Icon_NOICON);
520
521MAKE_MENU(touchscreen_menu, ID2P(LANG_TOUCHSCREEN_SETTINGS), NULL, Icon_NOICON, &touch_mode,
522 &touchscreen_menu_calibrate, &touchscreen_menu_reset_calibration);
523#endif
524
499 525
500MENUITEM_SETTING(codepage_setting, &global_settings.default_codepage, NULL); 526MENUITEM_SETTING(codepage_setting, &global_settings.default_codepage, NULL);
501 527
@@ -511,4 +537,7 @@ MAKE_MENU(display_menu, ID2P(LANG_DISPLAY),
511 &bars_menu, &peak_meter_menu, 537 &bars_menu, &peak_meter_menu,
512#endif 538#endif
513 &codepage_setting, 539 &codepage_setting,
540#ifdef HAVE_TOUCHSCREEN
541 &touchscreen_menu,
542#endif
514 ); 543 );
diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c
index 56a0178000..fdc775877a 100644
--- a/apps/menus/settings_menu.c
+++ b/apps/menus/settings_menu.c
@@ -265,21 +265,6 @@ MENUITEM_SETTING(buttonlight_brightness, &global_settings.buttonlight_brightness
265MENUITEM_SETTING(touchpad_sensitivity, &global_settings.touchpad_sensitivity, NULL); 265MENUITEM_SETTING(touchpad_sensitivity, &global_settings.touchpad_sensitivity, NULL);
266#endif 266#endif
267 267
268#ifdef HAVE_TOUCHSCREEN
269static int touch_mode_callback(int action,const struct menu_item_ex *this_item)
270{
271 (void)this_item;
272 switch (action)
273 {
274 case ACTION_EXIT_MENUITEM: /* on exit */
275 touchscreen_set_mode(global_settings.touch_mode);
276 break;
277 }
278 return action;
279}
280MENUITEM_SETTING(touch_mode, &global_settings.touch_mode, touch_mode_callback);
281#endif
282
283MAKE_MENU(system_menu, ID2P(LANG_SYSTEM), 268MAKE_MENU(system_menu, ID2P(LANG_SYSTEM),
284 0, Icon_System_menu, 269 0, Icon_System_menu,
285 &start_screen, 270 &start_screen,
@@ -315,9 +300,6 @@ MAKE_MENU(system_menu, ID2P(LANG_SYSTEM),
315#ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING 300#ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING
316 &touchpad_sensitivity, 301 &touchpad_sensitivity,
317#endif 302#endif
318#ifdef HAVE_TOUCHSCREEN
319 &touch_mode,
320#endif
321 ); 303 );
322 304
323/* SYSTEM MENU */ 305/* SYSTEM MENU */