From 26b2cfe51877575631b4aa73b353cf7f415d6089 Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Tue, 25 Mar 2025 09:50:59 +0900 Subject: [PATCH] =?UTF-8?q?enhance(frontend):=20=E3=83=8A=E3=83=93?= =?UTF-8?q?=E3=82=B2=E3=83=BC=E3=82=B7=E3=83=A7=E3=83=B3=E3=83=90=E3=83=BC?= =?UTF-8?q?=E3=81=AE=E5=89=AF=E3=83=9C=E3=82=BF=E3=83=B3=E3=82=92=E9=9D=9E?= =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E3=81=AB=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/index.d.ts | 4 ++++ locales/ja-JP.yml | 1 + packages/frontend/src/pages/settings/navbar.vue | 11 +++++++++++ packages/frontend/src/preferences/def.ts | 3 +++ packages/frontend/src/ui/_common_/navbar.vue | 2 +- .../src/utility/autogen/settings-search-index.ts | 6 ++++++ 6 files changed, 26 insertions(+), 1 deletion(-) diff --git a/locales/index.d.ts b/locales/index.d.ts index 737a2d77d6..37028d0b65 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -5610,6 +5610,10 @@ export interface Locale extends ILocale { * 有効にすると、一部のシチュエーションでのユーザビリティが低下する場合があります。 */ "makeEveryTextElementsSelectable_description": string; + /** + * ナビゲーションバーに副ボタンを表示 + */ + "showNavbarSubButtons": string; }; "_preferencesProfile": { /** diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 93dc352799..a3660b914a 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1403,6 +1403,7 @@ _settings: timelineAndNote: "タイムラインとノート" makeEveryTextElementsSelectable: "全てのテキスト要素を選択可能にする" makeEveryTextElementsSelectable_description: "有効にすると、一部のシチュエーションでのユーザビリティが低下する場合があります。" + showNavbarSubButtons: "ナビゲーションバーに副ボタンを表示" _preferencesProfile: profileName: "プロファイル名" diff --git a/packages/frontend/src/pages/settings/navbar.vue b/packages/frontend/src/pages/settings/navbar.vue index 706cb731eb..b6fdd009b2 100644 --- a/packages/frontend/src/pages/settings/navbar.vue +++ b/packages/frontend/src/pages/settings/navbar.vue @@ -42,6 +42,14 @@ SPDX-License-Identifier: AGPL-3.0-only + + + + + + + + @@ -51,6 +59,8 @@ import MkRadios from '@/components/MkRadios.vue'; import MkButton from '@/components/MkButton.vue'; import FormSlot from '@/components/form/slot.vue'; import MkContainer from '@/components/MkContainer.vue'; +import MkSwitch from '@/components/MkSwitch.vue'; +import MkPreferenceContainer from '@/components/MkPreferenceContainer.vue'; import * as os from '@/os.js'; import { navbarItemDef } from '@/navbar.js'; import { store } from '@/store.js'; @@ -68,6 +78,7 @@ const items = ref(prefer.s.menu.map(x => ({ }))); const menuDisplay = computed(store.makeGetterSetter('menuDisplay')); +const showNavbarSubButtons = prefer.model('showNavbarSubButtons'); async function addItem() { const menu = Object.keys(navbarItemDef).filter(k => !prefer.s.menu.includes(k)); diff --git a/packages/frontend/src/preferences/def.ts b/packages/frontend/src/preferences/def.ts index 127ebeef0c..310c3856eb 100644 --- a/packages/frontend/src/preferences/def.ts +++ b/packages/frontend/src/preferences/def.ts @@ -329,6 +329,9 @@ export const PREF_DEF = { makeEveryTextElementsSelectable: { default: DEFAULT_DEVICE_KIND === 'desktop', }, + showNavbarSubButtons: { + default: true, + }, plugins: { default: [] as Plugin[], }, diff --git a/packages/frontend/src/ui/_common_/navbar.vue b/packages/frontend/src/ui/_common_/navbar.vue index 88ce3a96e2..0f00a25d7a 100644 --- a/packages/frontend/src/ui/_common_/navbar.vue +++ b/packages/frontend/src/ui/_common_/navbar.vue @@ -65,7 +65,7 @@ SPDX-License-Identifier: AGPL-3.0-only --> -
+
diff --git a/packages/frontend/src/utility/autogen/settings-search-index.ts b/packages/frontend/src/utility/autogen/settings-search-index.ts index 64fe328478..7c2ec90dd8 100644 --- a/packages/frontend/src/utility/autogen/settings-search-index.ts +++ b/packages/frontend/src/utility/autogen/settings-search-index.ts @@ -587,6 +587,12 @@ export const searchIndexes: SearchIndexItem[] = [ path: '/settings/other', icon: 'ti ti-dots', }, + { + id: 'pOot4giZs', + label: i18n.ts._settings.showNavbarSubButtons, + keywords: ['toggle', 'button', 'sub'], + path: '/settings/navbar', + }, { id: '3icEvyv2D', children: [