Skip to content

Commit

Permalink
ショートカットキー割り当てダイアログのリデザイン (VOICEVOX#2348)
Browse files Browse the repository at this point in the history
Co-authored-by: Hiroshiba <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Dec 7, 2024
1 parent c707aae commit 0735fbe
Show file tree
Hide file tree
Showing 12 changed files with 282 additions and 185 deletions.
2 changes: 1 addition & 1 deletion src/components/Base/BaseButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ defineEmits<{
.button {
display: flex;
justify-content: space-between;
justify-content: center;
align-items: center;
text-wrap: nowrap;
height: vars.$size-control;
Expand Down
36 changes: 36 additions & 0 deletions src/components/Base/BaseIconButton.stories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import type { Meta, StoryObj } from "@storybook/vue3";

import { TooltipProvider } from "radix-vue";
import BaseIconButton from "./BaseIconButton.vue";

const meta: Meta<typeof BaseIconButton> = {
component: BaseIconButton,
render: (args) => ({
components: { BaseIconButton, TooltipProvider },
setup() {
return { args };
},
template: `
<TooltipProvider>
<BaseIconButton v-bind="args" />
</TooltipProvider>`,
}),
};

export default meta;
type Story = StoryObj<typeof BaseIconButton>;

export const Default: Story = {
args: {
label: "Default",
icon: "settings",
},
};

export const Disabled: Story = {
args: {
label: "Disabled",
icon: "settings",
disabled: true,
},
};
62 changes: 62 additions & 0 deletions src/components/Base/BaseIconButton.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<template>
<BaseTooltip :label>
<button
class="button"
:disabled
@click="(payload) => $emit('click', payload)"
>
<!-- 暫定でq-iconを使用 -->
<QIcon v-if="icon" :name="icon" size="sm" />
</button>
</BaseTooltip>
</template>

<script setup lang="ts">
import BaseTooltip from "./BaseTooltip.vue";
defineProps<{
icon: string;
label: string;
disabled?: boolean;
}>();
defineEmits<{
(e: "click", payload: MouseEvent): void;
}>();
</script>

<style scoped lang="scss">
@use "@/styles/v2/variables" as vars;
@use "@/styles/v2/mixin" as mixin;
@use "@/styles/v2/colors" as colors;
.button {
border: none;
display: flex;
justify-content: center;
align-items: center;
height: vars.$size-control;
width: vars.$size-control;
border-radius: vars.$radius-1;
color: colors.$display;
background-color: colors.$clear;
cursor: pointer;
&:focus-visible {
@include mixin.on-focus;
}
&:hover:not(:disabled) {
background-color: colors.$clear-hovered;
}
&:active:not(:disabled) {
background-color: colors.$clear-pressed;
}
&:disabled {
// Quasar側のopacity: 0.6 !important;を上書きするためimportantを付与
opacity: 0.4 !important;
}
}
</style>
1 change: 1 addition & 0 deletions src/components/Base/BaseScrollArea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import {
.ScrollAreaScrollbar {
user-select: none;
touch-action: none;
z-index: vars.$z-index-scrollbar;
}
.ScrollAreaScrollbar[data-orientation="vertical"] {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dialog/HotkeyRecordingDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
/>
<QBtn
padding="xs md"
label="ショートカットキーを未設定にする"
label="ショートカットキーを未割り当てにする"
unelevated
color="surface"
textColor="display"
Expand Down
Loading

0 comments on commit 0735fbe

Please sign in to comment.