Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ショートカットキー割り当てダイアログのリデザイン #2348

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
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
28 changes: 28 additions & 0 deletions src/components/Base/BaseIconButton.stories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import type { Meta, StoryObj } from "@storybook/vue3";

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

const meta: Meta<typeof BaseIconButton> = {
component: BaseIconButton,
};

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

export const Default: Story = {
args: {
label: "Default",
icon: "settings",
},
render: (args) => ({
components: { BaseIconButton, TooltipProvider },
setup() {
return { args };
},
template: `
<TooltipProvider>
<BaseIconButton v-bind="args" />
</TooltipProvider>`,
}),
};
57 changes: 57 additions & 0 deletions src/components/Base/BaseIconButton.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<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;
}
}
</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: 1;
}

.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