enhance(client): tweak ui

This commit is contained in:
syuilo
2022-07-18 05:03:39 +09:00
parent cbd07cdbe9
commit 49499f3d7d
5 changed files with 23 additions and 10 deletions

View File

@ -50,7 +50,7 @@ function onContextmenu(ev) {
icon: 'fas fa-expand-alt',
text: i18n.ts.showInPage,
action: () => {
router.push(props.to);
router.push(props.to, 'forcePage');
},
}, null, {
icon: 'fas fa-external-link-alt',
@ -79,7 +79,7 @@ function popout() {
popout_(props.to);
}
function nav() {
function nav(ev: MouseEvent) {
if (props.behavior === 'browser') {
location.href = props.to;
return;
@ -93,6 +93,10 @@ function nav() {
}
}
router.push(props.to);
if (ev.shiftKey) {
return openWindow();
}
router.push(props.to, ev.ctrlKey ? 'forcePage' : null);
}
</script>

View File

@ -1,6 +1,6 @@
<template>
<transition :name="$store.state.animation ? 'window' : ''" appear @after-leave="$emit('closed')">
<div v-if="showing" ref="rootEl" class="ebkgocck">
<div v-if="showing" ref="rootEl" class="ebkgocck" :class="{ maximized }">
<div class="body _shadow _narrow_" @mousedown="onBodyMousedown" @keydown="onKeydown">
<div class="header" :class="{ mini }" @contextmenu.prevent.stop="onContextmenu">
<span class="left">
@ -87,7 +87,7 @@ const emit = defineEmits<{
provide('inWindow', true);
let rootEl = $ref<HTMLElement>();
let rootEl = $ref<HTMLElement | null>();
let showing = $ref(true);
let beforeClickedAt = 0;
let maximized = $ref(false);
@ -116,7 +116,9 @@ function onContextmenu(ev: MouseEvent) {
// 最前面へ移動
function top() {
rootEl.style.zIndex = os.claimZIndex(props.front ? 'middle' : 'low');
if (rootEl) {
rootEl.style.zIndex = os.claimZIndex(props.front ? 'middle' : 'low');
}
}
function maximize() {
@ -412,7 +414,7 @@ defineExpose({
left: 0;
> .body {
overflow: hidden;
overflow: clip;
display: flex;
flex-direction: column;
contain: content;
@ -550,5 +552,11 @@ defineExpose({
cursor: nesw-resize;
}
}
&.maximized {
> .body {
border-radius: 0;
}
}
}
</style>