Setting dialog responsive design for smaller screen size (screen width < 1536) (#1472)

* Smaller queue button

* Smaller dialog padding

* Adjust setting content

* Fix keybinding panel
This commit is contained in:
Chenlei Hu
2024-11-08 11:18:26 -05:00
committed by GitHub
parent 904408de01
commit 1d9c3f00b7
6 changed files with 36 additions and 7 deletions

View File

@@ -4,6 +4,7 @@
class="comfyui-queue-button" class="comfyui-queue-button"
:label="activeQueueModeMenuItem.label" :label="activeQueueModeMenuItem.label"
severity="primary" severity="primary"
size="small"
@click="queuePrompt" @click="queuePrompt"
:model="queueModeMenuItems" :model="queueModeMenuItems"
data-testid="queue-button" data-testid="queue-button"
@@ -24,6 +25,7 @@
:label="item.label" :label="item.label"
:icon="item.icon" :icon="item.icon"
:severity="item.key === queueMode ? 'primary' : 'secondary'" :severity="item.key === queueMode ? 'primary' : 'secondary'"
size="small"
text text
v-tooltip="item.tooltip" v-tooltip="item.tooltip"
/> />

View File

@@ -16,6 +16,7 @@
size="small" size="small"
outlined outlined
:disabled="props.error" :disabled="props.error"
:title="props.url"
@click="download.triggerBrowserDownload" @click="download.triggerBrowserDownload"
/> />
</div> </div>

View File

@@ -2,6 +2,7 @@
<template> <template>
<Dialog <Dialog
v-model:visible="dialogStore.isVisible" v-model:visible="dialogStore.isVisible"
class="global-dialog"
modal modal
closable closable
closeOnEscape closeOnEscape
@@ -11,7 +12,6 @@
@hide="dialogStore.closeDialog" @hide="dialogStore.closeDialog"
@maximize="onMaximize" @maximize="onMaximize"
@unmaximize="onUnmaximize" @unmaximize="onUnmaximize"
:pt="{ header: 'pb-0' }"
:aria-labelledby="headerId" :aria-labelledby="headerId"
> >
<template #header> <template #header>
@@ -57,3 +57,15 @@ const contentProps = computed(() =>
const headerId = `dialog-${Math.random().toString(36).substr(2, 9)}` const headerId = `dialog-${Math.random().toString(36).substr(2, 9)}`
</script> </script>
<style>
.global-dialog .p-dialog-header {
@apply p-2 2xl:p-[var(--p-dialog-header-padding)];
@apply pb-0;
}
.global-dialog .p-dialog-content {
@apply p-2 2xl:p-[var(--p-dialog-content-padding)];
@apply pt-0;
}
</style>

View File

@@ -1,6 +1,6 @@
<template> <template>
<div class="settings-container"> <div class="settings-container">
<ScrollPanel class="settings-sidebar flex-shrink-0 p-2 w-64"> <ScrollPanel class="settings-sidebar flex-shrink-0 p-2 w-48 2xl:w-64">
<SearchBox <SearchBox
class="settings-search-box w-full mb-2" class="settings-search-box w-full mb-2"
v-model:modelValue="searchQuery" v-model:modelValue="searchQuery"
@@ -16,7 +16,7 @@
class="border-none w-full" class="border-none w-full"
/> />
</ScrollPanel> </ScrollPanel>
<Divider layout="vertical" /> <Divider layout="vertical" class="mx-1 2xl:mx-4" />
<ScrollPanel class="settings-content flex-grow"> <ScrollPanel class="settings-content flex-grow">
<Tabs :value="tabValue"> <Tabs :value="tabValue">
<FirstTimeUIMessage v-if="tabValue === 'Comfy'" /> <FirstTimeUIMessage v-if="tabValue === 'Comfy'" />

View File

@@ -19,7 +19,7 @@
</template> </template>
<Column field="actions" header=""> <Column field="actions" header="">
<template #body="slotProps"> <template #body="slotProps">
<div class="actions invisible"> <div class="actions invisible flex flex-row">
<Button <Button
icon="pi pi-pencil" icon="pi pi-pencil"
class="p-button-text" class="p-button-text"
@@ -34,7 +34,21 @@
</div> </div>
</template> </template>
</Column> </Column>
<Column field="id" header="Command ID" sortable></Column> <Column
field="id"
header="Command ID"
sortable
class="max-w-64 2xl:max-w-full"
>
<template #body="slotProps">
<div
class="overflow-hidden text-ellipsis whitespace-nowrap"
:title="slotProps.data.id"
>
{{ slotProps.data.id }}
</div>
</template>
</Column>
<Column field="keybinding" header="Keybinding"> <Column field="keybinding" header="Keybinding">
<template #body="slotProps"> <template #body="slotProps">
<KeyComboDisplay <KeyComboDisplay
@@ -229,7 +243,7 @@ async function resetKeybindings() {
<style scoped> <style scoped>
:deep(.p-datatable-tbody) > tr > td { :deep(.p-datatable-tbody) > tr > td {
padding: 1px; @apply p-1;
min-height: 2rem; min-height: 2rem;
} }

View File

@@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<h2> <h2 class="px-4">
<i class="pi pi-cog"></i> <i class="pi pi-cog"></i>
<span>{{ $t('settings') }}</span> <span>{{ $t('settings') }}</span>
</h2> </h2>