diff --git a/CHANGELOG.md b/CHANGELOG.md index a9da417..7cca853 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ ## [Unreleased] +## 6.1.0 + +### Added + +- feat: add search toggle option (fix #509) + +### Fixed + +- fix #510: [Bug] Styling of the icon labels and overflow icon is not correct +- fix #462: [Bug] Burger menu in settings is hidden with "Always displayed" on mobile device + ## 6.0.1 ### Added diff --git a/appinfo/info.xml b/appinfo/info.xml index 2f8750e..4990740 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -30,7 +30,7 @@ Notice Because I believe in a free and decentralized Internet, [Gitnet](https://gitnet.fr) is **self-hosted at home**. In case of downtime, you can download **Custom Menu** from [here](https://kim.deblan.fr/~side_menu/). ]]> - 6.0.1 + 6.1.0 agpl Simon Vieille SideMenu diff --git a/lib/Controller/AdminSettingController.php b/lib/Controller/AdminSettingController.php index e9ba8f9..42f6cd2 100644 --- a/lib/Controller/AdminSettingController.php +++ b/lib/Controller/AdminSettingController.php @@ -97,6 +97,7 @@ class AdminSettingController extends Controller 'use-avatar', 'add-logo-link', 'show-settings', + 'show-search-form', 'loader-enabled', 'always-displayed', 'enabled', @@ -137,6 +138,7 @@ class AdminSettingController extends Controller 'use-avatar' => '0', 'add-logo-link' => '1', 'show-settings' => '0', + 'show-search-form' => '1', 'loader-enabled' => '1', 'always-displayed' => '0', 'enabled' => '1', @@ -206,7 +208,17 @@ class AdminSettingController extends Controller } foreach ($defaults as $key => $default) { - if (!array_key_exists($key, $config)) { + if (array_key_exists($key, $config)) { + continue; + } + + if (in_array($key, $booleans)) { + $config[$key] = $default === '1'; + } elseif (in_array($key, $arrays)) { + $config[$key] = json_decode($default); + } elseif (in_array($key, $integers)) { + $config[$key] = (int) $default; + } else { $config[$key] = $default; } } diff --git a/lib/Controller/JsController.php b/lib/Controller/JsController.php index 302de3d..e946748 100644 --- a/lib/Controller/JsController.php +++ b/lib/Controller/JsController.php @@ -135,6 +135,7 @@ class JsController extends Controller 'force-light-icon' => $this->config->getAppValueBool('force-light-icon', '0'), 'display-logo' => $this->config->getAppValueBool('display-logo', '1'), 'use-avatar' => $this->config->getAppValueBool('use-avatar', '0'), + 'show-search-form' => $this->config->getAppValueBool('show-search-form', '1'), 'hide-when-no-apps' => $this->config->getAppValueBool('hide-when-no-apps', '0'), 'loader-enabled' => $this->config->getAppValueBool('loader-enabled', '1'), 'always-displayed' => $this->config->getAppValueBool('always-displayed', '0'), diff --git a/src/l10n/fixtures/cs.yaml b/src/l10n/fixtures/cs.yaml index ded151a..3e8cdb6 100644 --- a/src/l10n/fixtures/cs.yaml +++ b/src/l10n/fixtures/cs.yaml @@ -109,3 +109,4 @@ 'Customize': 'Přizpůsobit' 'Custom': 'Custom' 'Close': 'Zavřít' +'Show the search form': 'Show the search form' diff --git a/src/l10n/fixtures/de.yaml b/src/l10n/fixtures/de.yaml index 6323421..cbd3f63 100644 --- a/src/l10n/fixtures/de.yaml +++ b/src/l10n/fixtures/de.yaml @@ -109,3 +109,4 @@ 'Customize': 'Customize' 'Custom': 'Custom' 'Close': 'Close' +'Show the search form': 'Show the search form' diff --git a/src/l10n/fixtures/es.yaml b/src/l10n/fixtures/es.yaml index e1af7a6..3a29a52 100644 --- a/src/l10n/fixtures/es.yaml +++ b/src/l10n/fixtures/es.yaml @@ -109,3 +109,4 @@ 'Customize': 'Personalizar' 'Custom': 'Custom' 'Close': 'Cerrar' +'Show the search form': 'Show the search form' diff --git a/src/l10n/fixtures/fr.yaml b/src/l10n/fixtures/fr.yaml index 295680a..f2076a1 100644 --- a/src/l10n/fixtures/fr.yaml +++ b/src/l10n/fixtures/fr.yaml @@ -128,3 +128,4 @@ 'Customize': 'Personnaliser' 'Custom': 'Personnalisé' 'Close': 'Fermer' +'Show the search form': 'Afficher le formulaire de recherche' diff --git a/src/l10n/fixtures/gl.yaml b/src/l10n/fixtures/gl.yaml index 59176d5..e494d20 100644 --- a/src/l10n/fixtures/gl.yaml +++ b/src/l10n/fixtures/gl.yaml @@ -109,3 +109,4 @@ 'Customize': 'Personalizar' 'Custom': 'Personalizado' 'Close': 'Pechar' +'Show the search form': 'Show the search form' diff --git a/src/l10n/fixtures/nl.yaml b/src/l10n/fixtures/nl.yaml index f1b3e55..8d60915 100644 --- a/src/l10n/fixtures/nl.yaml +++ b/src/l10n/fixtures/nl.yaml @@ -109,3 +109,4 @@ 'Customize': 'Customize' 'Custom': 'Custom' 'Close': 'Close' +'Show the search form': 'Show the search form' diff --git a/src/l10n/fixtures/pt_BR.yaml b/src/l10n/fixtures/pt_BR.yaml index 9e314a5..a1fba4e 100644 --- a/src/l10n/fixtures/pt_BR.yaml +++ b/src/l10n/fixtures/pt_BR.yaml @@ -107,3 +107,4 @@ 'Customize': 'Customize' 'Custom': 'Custom' 'Close': 'Close' +'Show the search form': 'Show the search form' diff --git a/src/l10n/fixtures/ru.yaml b/src/l10n/fixtures/ru.yaml index 15943ad..ec40790 100644 --- a/src/l10n/fixtures/ru.yaml +++ b/src/l10n/fixtures/ru.yaml @@ -109,3 +109,4 @@ 'Customize': 'Приспособить' 'Custom': 'Custom' 'Close': 'Закрыть' +'Show the search form': 'Show the search form' diff --git a/src/l10n/fixtures/sk.yaml b/src/l10n/fixtures/sk.yaml index 2849008..a1703ca 100644 --- a/src/l10n/fixtures/sk.yaml +++ b/src/l10n/fixtures/sk.yaml @@ -107,3 +107,4 @@ 'Customize': 'Customize' 'Custom': 'Custom' 'Close': 'Close' +'Show the search form': 'Show the search form' diff --git a/src/l10n/fixtures/sv.yaml b/src/l10n/fixtures/sv.yaml index d14314c..06d4b91 100644 --- a/src/l10n/fixtures/sv.yaml +++ b/src/l10n/fixtures/sv.yaml @@ -109,3 +109,4 @@ 'Customize': 'Anpassa' 'Custom': 'Anpassad' 'Close': 'Stäng' +'Show the search form': 'Show the search form' diff --git a/src/l10n/fixtures/tpl/base.yaml b/src/l10n/fixtures/tpl/base.yaml index eebd8c2..c7bea0e 100644 --- a/src/l10n/fixtures/tpl/base.yaml +++ b/src/l10n/fixtures/tpl/base.yaml @@ -109,3 +109,4 @@ 'Customize': 'Customize' 'Custom': 'Custom' 'Close': 'Close' +'Show the search form': 'Show the search form' diff --git a/src/l10n/fixtures/zh_CN.yaml b/src/l10n/fixtures/zh_CN.yaml index bc77571..86b825f 100644 --- a/src/l10n/fixtures/zh_CN.yaml +++ b/src/l10n/fixtures/zh_CN.yaml @@ -109,3 +109,4 @@ 'Customize': '自定义' 'Custom': '自定义' 'Close': '关闭' +'Show the search form': 'Show the search form' diff --git a/src/menus/SideMenuWithCategories.vue b/src/menus/SideMenuWithCategories.vue index eb8ae1f..90e42dc 100644 --- a/src/menus/SideMenuWithCategories.vue +++ b/src/menus/SideMenuWithCategories.vue @@ -27,7 +27,7 @@ along with this program. If not, see . :label="settings.name" :avatar="settings.avatar" /> - + { targetBlankApps.value = config['target-blank-apps'] settings.value = config['settings'] + showSearchForm.value = config['show-search-form'] openerHover.value = config['opener-hover'] && !isTouchDevice items.value = await navStore.getCategories() diff --git a/src/menus/SimpleSideMenu.vue b/src/menus/SimpleSideMenu.vue index 65d0fa4..185cf04 100644 --- a/src/menus/SimpleSideMenu.vue +++ b/src/menus/SimpleSideMenu.vue @@ -30,7 +30,7 @@ along with this program. If not, see . :avatar="settings.avatar" /> { alwaysDisplayed.value = config['always-displayed'] targetBlankApps.value = config['target-blank-apps'] forceLightIcon.value = config['force-light-icon'] + showSearchForm.value = config['show-search-form'] avatar.value = config['avatar'] logo.value = config['logo'] diff --git a/src/menus/TopWideMenu.vue b/src/menus/TopWideMenu.vue index 596b1ea..b3a9fe3 100644 --- a/src/menus/TopWideMenu.vue +++ b/src/menus/TopWideMenu.vue @@ -31,7 +31,7 @@ along with this program. If not, see . :label="settings.name" :avatar="settings.avatar" /> - + { targetBlankApps.value = config['target-blank-apps'] settings.value = config['settings'] + showSearchForm.value = config['show-search-form'] openerHover.value = config['opener-hover'] && !isTouchDevice items.value = await navStore.getCategories() diff --git a/src/pages/AdminSettings.vue b/src/pages/AdminSettings.vue index d3c7c84..f190f76 100644 --- a/src/pages/AdminSettings.vue +++ b/src/pages/AdminSettings.vue @@ -29,6 +29,8 @@ along with this program. If not, see . /> + + @@ -80,6 +82,15 @@ along with this program. If not, see . + + + + + + { return result } +const toggleNav = () => { + document.querySelector('.cm-settings-nav .app-navigation-toggle-wrapper > button').click() +} + onMounted(async () => { config.value = await configStore.getAppConfig() diff --git a/src/scss/admin.scss b/src/scss/admin.scss index 0cd332c..f2e2f8d 100644 --- a/src/scss/admin.scss +++ b/src/scss/admin.scss @@ -15,14 +15,25 @@ * along with this program. If not, see . */ -.cm-settings { - &--nav { - padding-top: 30px; - } +.cm-settings-nav { + padding-top: 30px !important; +} +.cm-settings-nav-toggle { + margin-top: 40px !important; + margin-left: 15px !important; +} + +.cm-settings-nav .app-navigation-toggle-wrapper > button { + display: none; +} + +.cm-settings { &-nav { + max-width: 50vw !important; + .app-navigation__content { - padding: 20px; + padding: 20px 10px 20px 10px; } .app-navigation-entry-icon { diff --git a/src/scss/menu.scss b/src/scss/menu.scss index 5680536..5244d39 100644 --- a/src/scss/menu.scss +++ b/src/scss/menu.scss @@ -490,7 +490,7 @@ $header-icon-size: 20px; color: var(--color-primary-text); text-align: center; left: 50%; - top: 45%; + top: 55%; display: block; min-width: 100%; transform: translateX(-50%); @@ -562,23 +562,27 @@ $header-icon-size: 20px; } } - .app-menu-more .button-vue--vue-tertiary { - opacity: 0.7; - margin: 8px 3px 3px 3px; - filter: var(--background-image-invert-if-bright, var(--primary-invert-if-bright)); + &-app-menu-more { + padding-top: 9px !important; - &:not([aria-expanded='true']) { - color: var(--color-main-text); + .button-vue--vue-tertiary { + opacity: 0.7; + margin: 8px 3px 3px 3px; + filter: var(--background-image-invert-if-bright, var(--primary-invert-if-bright)); - &:hover { - opacity: 1; - background-color: transparent !important; + &:not([aria-expanded='true']) { + color: var(--color-main-text); + + &:hover { + opacity: 1; + background-color: transparent !important; + } } - } - &:focus-visible { - opacity: 1; - outline: none !important; + &:focus-visible { + opacity: 1; + outline: none !important; + } } }