From bf3673c19f657ba7b8edf651a43d0ca84215933d Mon Sep 17 00:00:00 2001 From: yellows8 Date: Thu, 7 Mar 2019 21:36:48 -0500 Subject: [PATCH] Added WebFooterFixedKind enum. Actually check sysver in webConfigSetFooterFixedKind. Updated web docs. --- nx/include/switch/applets/web.h | 15 +++++++++++---- nx/source/applets/web.c | 1 + 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/nx/include/switch/applets/web.h b/nx/include/switch/applets/web.h index 0cae12b2..44373295 100644 --- a/nx/include/switch/applets/web.h +++ b/nx/include/switch/applets/web.h @@ -137,7 +137,7 @@ typedef enum { WebArgType_WebAudio = 0x2E, ///< [4.0.0+] u8 bool WebArgType_2F = 0x2F, ///< [5.0.0+] u8 WebArgType_YouTubeVideoFlag = 0x31, ///< [5.0.0+] u8 bool Indicates that the built-in whitelist for YouTubeVideo should be used. - WebArgType_FooterFixedKind = 0x32, ///< [5.0.0+] u32 enum *FooterFixedKind + WebArgType_FooterFixedKind = 0x32, ///< [5.0.0+] u32 enum \ref WebFooterFixedKind WebArgType_PageFade = 0x33, ///< [5.0.0+] u8 bool WebArgType_MediaCreatorApplicationRatingAge = 0x34, ///< [5.0.0+] Share-applet 0x20-byte s8 array, MediaCreatorApplicationRatingAge. WebArgType_BootLoadingIcon = 0x35, ///< [5.0.0+] u8 bool @@ -191,6 +191,13 @@ typedef enum { WebLeftStickMode_Cursor = 1, ///< The user can only select elements on the page via the left-stick. } WebLeftStickMode; +/// Kind values for \ref webConfigSetFooterFixedKind. Controls UI footer display behaviour. +typedef enum { + WebFooterFixedKind_Default = 0, ///< Default. Footer is hidden while scrolling. + WebFooterFixedKind_Always = 1, ///< Footer is always displayed regardless of scrolling. + WebFooterFixedKind_Hidden = 2, ///< Footer is hidden regardless of scrolling. +} WebFooterFixedKind; + /** * @brief Creates the config for WifiWebAuthApplet. This is the captive portal applet. * @param config WebWifiConfig object. @@ -370,7 +377,7 @@ Result webConfigSetBackgroundKind(WebCommonConfig* config, WebBackgroundKind kin Result webConfigSetFooter(WebCommonConfig* config, bool flag); /** - * @brief Sets the whether the Pointer is enabled. + * @brief Sets the whether the Pointer is enabled. See also \ref WebLeftStickMode. * @note Only available with config created by \ref webOfflineCreate, \ref webPageCreate, or \ref webLobbyCreate. * @note Used automatically by \ref webOfflineCreate. * @note Used automatically by \ref webLobbyCreate with flag=false on [3.0.0+]. @@ -517,9 +524,9 @@ Result webConfigSetWebAudio(WebCommonConfig* config, bool flag); * @brief Sets the FooterFixedKind. * @note Only available with config created by \ref webOfflineCreate or \ref webPageCreate, on [5.0.0+]. * @param config WebCommonConfig object. - * @param kind Kind, different enums for Web and Offline. + * @param kind \ref WebFooterFixedKind */ -Result webConfigSetFooterFixedKind(WebCommonConfig* config, u32 kind); +Result webConfigSetFooterFixedKind(WebCommonConfig* config, WebFooterFixedKind kind); /** * @brief Sets the PageFade flag. diff --git a/nx/source/applets/web.c b/nx/source/applets/web.c index 3b4160b4..5fa3c7d5 100644 --- a/nx/source/applets/web.c +++ b/nx/source/applets/web.c @@ -563,6 +563,7 @@ Result webConfigSetWebAudio(WebCommonConfig* config, bool flag) { Result webConfigSetFooterFixedKind(WebCommonConfig* config, u32 kind) { WebShimKind shim = _webGetShimKind(config); if (shim != WebShimKind_Offline && shim != WebShimKind_Web) return MAKERESULT(Module_Libnx, LibnxError_NotInitialized); + if (hosversionBefore(5,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); return _webConfigSetU32(config, WebArgType_FooterFixedKind, kind); }