Fixes in the LOVE (#5402)

This commit is contained in:
Alexander Platov 2024-04-19 04:12:22 +03:00 committed by GitHub
parent e68837342b
commit 1192f0347d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 14 deletions

View File

@ -67,6 +67,7 @@
--global-accent-SkyText: #B9D1F5; --global-accent-SkyText: #B9D1F5;
--global-accent-BackgroundColor: #204DC8; --global-accent-BackgroundColor: #204DC8;
--global-no-priority-PriorityColor: #8E99AF;
--global-low-PriorityColor: #6493FF; --global-low-PriorityColor: #6493FF;
--global-medium-PriorityColor: #FFBD2E; --global-medium-PriorityColor: #FFBD2E;
--global-high-PriorityColor: #F6684B; --global-high-PriorityColor: #F6684B;
@ -157,6 +158,7 @@
--global-accent-SkyText:#B9D1F5; --global-accent-SkyText:#B9D1F5;
--global-accent-BackgroundColor: #3566E2; --global-accent-BackgroundColor: #3566E2;
--global-no-priority-PriorityColor: #7B879E;
--global-low-PriorityColor: #3566E2; --global-low-PriorityColor: #3566E2;
--global-medium-PriorityColor: #FF9838; --global-medium-PriorityColor: #FF9838;
--global-high-PriorityColor: #E9403D; --global-high-PriorityColor: #E9403D;

View File

@ -15,7 +15,7 @@
<script lang="ts"> <script lang="ts">
import { afterUpdate, onDestroy } from 'svelte' import { afterUpdate, onDestroy } from 'svelte'
import { resizeObserver } from '../resize' import { resizeObserver } from '../resize'
import { closeTooltip, tooltipstore as tooltip } from '../tooltips' import { closeTooltip, showTooltip, tooltipstore as tooltip } from '../tooltips'
import type { TooltipAlignment } from '../types' import type { TooltipAlignment } from '../types'
import Component from './Component.svelte' import Component from './Component.svelte'
import Label from './Label.svelte' import Label from './Label.svelte'
@ -221,8 +221,10 @@
closeTooltip() closeTooltip()
} }
$: shownTooltip = $tooltip.element && tooltipHTML
const whileShow = (ev: MouseEvent): void => { const whileShow = (ev: MouseEvent): void => {
if ($tooltip.element && tooltipHTML) { if (!$tooltip.element) return
const rectP = tooltipHTML.getBoundingClientRect() const rectP = tooltipHTML.getBoundingClientRect()
rect = $tooltip.element.getBoundingClientRect() rect = $tooltip.element.getBoundingClientRect()
const dT: number = dir === 'bottom' && $tooltip.kind !== 'submenu' ? 12 : 0 const dT: number = dir === 'bottom' && $tooltip.kind !== 'submenu' ? 12 : 0
@ -235,7 +237,6 @@
if ((tooltipSW && !inTrigger) || !(inTrigger || inPopup)) hideTooltip() if ((tooltipSW && !inTrigger) || !(inTrigger || inPopup)) hideTooltip()
} }
} }
}
$: if (kind === 'submenu') { $: if (kind === 'submenu') {
options = fitSubmenu() options = fitSubmenu()
@ -274,7 +275,7 @@
} }
}} }}
on:mousemove={(ev) => { on:mousemove={(ev) => {
whileShow(ev) if (shownTooltip) whileShow(ev)
}} }}
on:keydown={(evt) => { on:keydown={(evt) => {
if (($tooltip.component || $tooltip.label) && evt.key === 'Escape' && $tooltip.kind !== 'popup') { if (($tooltip.component || $tooltip.label) && evt.key === 'Escape' && $tooltip.kind !== 'popup') {