mirror of
https://github.com/haexhub/haex-hub.git
synced 2025-12-17 06:30:50 +01:00
Make windows fullscreen on small screens
- Update window components to use fullscreen layout on small screens - Adjust UI components styling for better mobile display - Update desktop store for small screen handling
This commit is contained in:
@ -90,11 +90,14 @@ defineOptions({
|
||||
|
||||
const extensionStore = useExtensionsStore()
|
||||
const windowManagerStore = useWindowManagerStore()
|
||||
const uiStore = useUiStore()
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
const open = ref(false)
|
||||
|
||||
const { isSmallScreen } = storeToRefs(uiStore)
|
||||
|
||||
// Uninstall dialog state
|
||||
const showUninstallDialog = ref(false)
|
||||
const extensionToUninstall = ref<LauncherItem | null>(null)
|
||||
@ -242,6 +245,11 @@ const handleDragStart = (event: DragEvent, item: LauncherItem) => {
|
||||
if (dragImage) {
|
||||
event.dataTransfer.setDragImage(dragImage, 20, 20)
|
||||
}
|
||||
|
||||
// Close drawer on small screens to reveal workspace for drop
|
||||
if (isSmallScreen.value) {
|
||||
open.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="p-4 mx-auto space-y-6 bg-default/90 backdrop-blur-2xl">
|
||||
<div class="p-4 mx-auto space-y-6 bg-default">
|
||||
<div class="space-y-2">
|
||||
<h1 class="text-2xl font-bold">{{ t('title') }}</h1>
|
||||
<p class="text-sm opacity-70">{{ t('description') }}</p>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="w-full h-full bg-default">
|
||||
<div class="w-full h-full bg-default overflow-scroll">
|
||||
<div class="grid grid-cols-2 p-2">
|
||||
<div class="p-2">{{ t('language') }}</div>
|
||||
<div><UiDropdownLocale @select="onSelectLocaleAsync" /></div>
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
: 'border border-gray-200 dark:border-gray-700',
|
||||
]"
|
||||
@mousedown="handleActivate"
|
||||
@contextmenu.stop.prevent
|
||||
>
|
||||
<!-- Window Titlebar -->
|
||||
<div
|
||||
@ -50,6 +51,7 @@
|
||||
/>
|
||||
|
||||
<HaexWindowButton
|
||||
v-if="!isSmallScreen"
|
||||
:is-maximized
|
||||
variant="maximize"
|
||||
@click.stop="handleMaximize"
|
||||
@ -74,7 +76,7 @@
|
||||
|
||||
<!-- Resize Handles -->
|
||||
<HaexWindowResizeHandles
|
||||
:disabled="isMaximized"
|
||||
:disabled="isMaximized || isSmallScreen"
|
||||
@resize-start="handleResizeStart"
|
||||
/>
|
||||
</div>
|
||||
@ -114,12 +116,16 @@ const height = defineModel<number>('height', { default: 600 })
|
||||
const windowEl = useTemplateRef('windowEl')
|
||||
const titlebarEl = useTemplateRef('titlebarEl')
|
||||
|
||||
const uiStore = useUiStore()
|
||||
const { isSmallScreen } = storeToRefs(uiStore)
|
||||
|
||||
// Inject viewport size from parent desktop
|
||||
const viewportSize = inject<{
|
||||
width: Ref<number>
|
||||
height: Ref<number>
|
||||
}>('viewportSize')
|
||||
const isMaximized = ref(false) // Don't start maximized
|
||||
// Start maximized on small screens
|
||||
const isMaximized = ref(isSmallScreen.value)
|
||||
|
||||
// Store initial position/size for restore
|
||||
const preMaximizeState = ref({
|
||||
@ -151,7 +157,8 @@ const isResizingOrDragging = computed(
|
||||
// Setup drag with useDrag composable (supports mouse + touch)
|
||||
useDrag(
|
||||
({ movement: [mx, my], first, last }) => {
|
||||
if (isMaximized.value) return
|
||||
// Disable dragging on small screens (always fullscreen)
|
||||
if (isMaximized.value || isSmallScreen.value) return
|
||||
|
||||
if (first) {
|
||||
// Drag started - save initial position
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
...buttonProps,
|
||||
...$attrs,
|
||||
}"
|
||||
size="lg"
|
||||
@click="$emit('click', $event)"
|
||||
>
|
||||
<template
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
:readonly="props.readOnly"
|
||||
:leading-icon="props.leadingIcon"
|
||||
:ui="{ base: 'peer' }"
|
||||
:size="isSmallScreen ? 'lg' : 'md'"
|
||||
size="lg"
|
||||
@change="(e) => $emit('change', e)"
|
||||
@blur="(e) => $emit('blur', e)"
|
||||
@keyup="(e: KeyboardEvent) => $emit('keyup', e)"
|
||||
|
||||
Reference in New Issue
Block a user