From 8f3ca867d2e03f8ee376d1f4fa9b1cc241af8376 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 17 Jul 2022 23:18:05 +0900 Subject: enhance(client): tweak ui --- locales/ja-JP.yml | 1 + packages/client/src/account.ts | 17 +++--- packages/client/src/components/ui/button.vue | 2 +- packages/client/src/components/ui/child-menu.vue | 63 --------------------- packages/client/src/components/ui/context-menu.vue | 4 +- packages/client/src/components/ui/menu.child.vue | 65 ++++++++++++++++++++++ packages/client/src/components/ui/menu.vue | 4 +- packages/client/src/pages/settings/profile.vue | 4 +- packages/client/src/ui/deck/column.vue | 53 ++++++++++-------- 9 files changed, 110 insertions(+), 103 deletions(-) delete mode 100644 packages/client/src/components/ui/child-menu.vue create mode 100644 packages/client/src/components/ui/menu.child.vue diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 21615a093e..e071b4bdab 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -890,6 +890,7 @@ activeEmailValidationDescription: "ユーザーのメールアドレスのバリ navbar: "ナビゲーションバー" shuffle: "シャッフル" account: "アカウント" +move: "移動" _sensitiveMediaDetection: description: "機械学習を使って自動でセンシティブなメディアを検出し、モデレーションに役立てることができます。サーバーの負荷が少し増えます。" diff --git a/packages/client/src/account.ts b/packages/client/src/account.ts index 38f2ee4b36..243aea68c4 100644 --- a/packages/client/src/account.ts +++ b/packages/client/src/account.ts @@ -206,17 +206,16 @@ export async function openAccountMenu(opts: { to: `/@${ $i.username }`, avatar: $i, }, null, ...(opts.includeCurrentAccount ? [createItem($i)] : []), ...accountItemPromises, { + type: 'parent', icon: 'fas fa-plus', text: i18n.ts.addAccount, - action: () => { - popupMenu([{ - text: i18n.ts.existingAccount, - action: () => { showSigninDialog(); }, - }, { - text: i18n.ts.createAccount, - action: () => { createAccount(); }, - }], ev.currentTarget ?? ev.target); - }, + children: [{ + text: i18n.ts.existingAccount, + action: () => { showSigninDialog(); }, + }, { + text: i18n.ts.createAccount, + action: () => { createAccount(); }, + }], }, { type: 'link', icon: 'fas fa-users', diff --git a/packages/client/src/components/ui/button.vue b/packages/client/src/components/ui/button.vue index 5f5d6d42ed..d3a4b5ea92 100644 --- a/packages/client/src/components/ui/button.vue +++ b/packages/client/src/components/ui/button.vue @@ -46,7 +46,7 @@ export default defineComponent({ rounded: { type: Boolean, required: false, - default: false, + default: true, }, inline: { type: Boolean, diff --git a/packages/client/src/components/ui/child-menu.vue b/packages/client/src/components/ui/child-menu.vue deleted file mode 100644 index a0c26b50cd..0000000000 --- a/packages/client/src/components/ui/child-menu.vue +++ /dev/null @@ -1,63 +0,0 @@ - - - - - diff --git a/packages/client/src/components/ui/context-menu.vue b/packages/client/src/components/ui/context-menu.vue index e637d361cf..165c3db462 100644 --- a/packages/client/src/components/ui/context-menu.vue +++ b/packages/client/src/components/ui/context-menu.vue @@ -1,16 +1,16 @@ + + diff --git a/packages/client/src/components/ui/menu.vue b/packages/client/src/components/ui/menu.vue index 26283ffe55..6d1a2cc770 100644 --- a/packages/client/src/components/ui/menu.vue +++ b/packages/client/src/components/ui/menu.vue @@ -50,7 +50,7 @@
- +
@@ -61,7 +61,7 @@ import { focusPrev, focusNext } from '@/scripts/focus'; import FormSwitch from '@/components/form/switch.vue'; import { MenuItem, InnerMenuItem, MenuPending, MenuAction } from '@/types/menu'; import * as os from '@/os'; -const XChild = defineAsyncComponent(() => import('./child-menu.vue')); +const XChild = defineAsyncComponent(() => import('./menu.child.vue')); const props = defineProps<{ items: MenuItem[]; diff --git a/packages/client/src/pages/settings/profile.vue b/packages/client/src/pages/settings/profile.vue index f30b0ccbdc..20c51c8836 100644 --- a/packages/client/src/pages/settings/profile.vue +++ b/packages/client/src/pages/settings/profile.vue @@ -3,9 +3,9 @@
- {{ i18n.ts._profile.changeAvatar }} + {{ i18n.ts._profile.changeAvatar }}
- {{ i18n.ts._profile.changeBanner }} + {{ i18n.ts._profile.changeBanner }}
diff --git a/packages/client/src/ui/deck/column.vue b/packages/client/src/ui/deck/column.vue index 1a1bd7d266..7b30ffad45 100644 --- a/packages/client/src/ui/deck/column.vue +++ b/packages/client/src/ui/deck/column.vue @@ -128,31 +128,36 @@ function getMenu() { if (canceled) return; updateColumn(props.column.id, result); }, - }, null, { - icon: 'fas fa-arrow-left', - text: i18n.ts._deck.swapLeft, - action: () => { - swapLeftColumn(props.column.id); - }, }, { - icon: 'fas fa-arrow-right', - text: i18n.ts._deck.swapRight, - action: () => { - swapRightColumn(props.column.id); - }, - }, props.isStacked ? { - icon: 'fas fa-arrow-up', - text: i18n.ts._deck.swapUp, - action: () => { - swapUpColumn(props.column.id); - }, - } : undefined, props.isStacked ? { - icon: 'fas fa-arrow-down', - text: i18n.ts._deck.swapDown, - action: () => { - swapDownColumn(props.column.id); - }, - } : undefined, null, { + type: 'parent', + text: i18n.ts.move + '...', + icon: 'fas fa-arrows-up-down-left-right', + children: [{ + icon: 'fas fa-arrow-left', + text: i18n.ts._deck.swapLeft, + action: () => { + swapLeftColumn(props.column.id); + }, + }, { + icon: 'fas fa-arrow-right', + text: i18n.ts._deck.swapRight, + action: () => { + swapRightColumn(props.column.id); + }, + }, props.isStacked ? { + icon: 'fas fa-arrow-up', + text: i18n.ts._deck.swapUp, + action: () => { + swapUpColumn(props.column.id); + }, + } : undefined, props.isStacked ? { + icon: 'fas fa-arrow-down', + text: i18n.ts._deck.swapDown, + action: () => { + swapDownColumn(props.column.id); + }, + } : undefined], + }, { icon: 'fas fa-window-restore', text: i18n.ts._deck.stackLeft, action: () => { -- cgit v1.2.3-freya