From 910a39af27c7e600daab0650530de60b531f12cd Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Thu, 28 Jul 2022 22:18:24 +0100 Subject: [PATCH] touchscreen: Evaluate %Tp tag only if pointing mode is enabled Simply knowing that a touchscreen is present isn't that useful for themes. Having %Tp evaluate as true when in pointing mode and false in 3x3 mode is better. For example, themes can change their layout or hide touch UI elements when in 3x3 mode, or show a status icon. Although a similar effect can be achieved with the %St tag it's simpler to use %Tp for this purpose -- it can report the current mode, not just the user preference. Change-Id: Ie343c105970dca11864fa44c6a091ed8e9e35b3d --- apps/gui/skin_engine/skin_tokens.c | 6 +++--- lib/skin_parser/tag_table.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c index e44544a280..12214fb66e 100644 --- a/apps/gui/skin_engine/skin_tokens.c +++ b/apps/gui/skin_engine/skin_tokens.c @@ -1457,10 +1457,10 @@ const char *get_token_value(struct gui_wps *gwps, return NULL; case SKIN_TOKEN_HAVE_TOUCH: #ifdef HAVE_TOUCHSCREEN - return "t"; -#else - return NULL; + if (touchscreen_get_mode() == TOUCHSCREEN_POINT) + return "t"; #endif + return NULL; #ifdef HAVE_QUICKSCREEN case SKIN_TOKEN_TOP_QUICKSETTING_NAME: diff --git a/lib/skin_parser/tag_table.c b/lib/skin_parser/tag_table.c index 233276c7fa..3715ffb670 100644 --- a/lib/skin_parser/tag_table.c +++ b/lib/skin_parser/tag_table.c @@ -238,7 +238,7 @@ static const struct tag_info legal_tags[] = * keep in sync with parse_touchregion() and parse_lasttouch() */ TAG(SKIN_TOKEN_LASTTOUCH, "Tl" , "|[SD]D", SKIN_REFRESH_DYNAMIC), TAG(SKIN_TOKEN_TOUCHREGION, "T" , "[Sip][ip][ip][ip][Sip]|S*", 0|NOBREAK), - TAG(SKIN_TOKEN_HAVE_TOUCH, "Tp", "", FEATURE_TAG), + TAG(SKIN_TOKEN_HAVE_TOUCH, "Tp", "", SKIN_REFRESH_STATIC), TAG(SKIN_TOKEN_CURRENT_SCREEN,"cs", "", SKIN_REFRESH_DYNAMIC),