禁用全局右键菜单,其他小调整

This commit is contained in:
pipipi-pikachu 2021-01-22 10:27:01 +08:00
parent 1f227e19ae
commit e282818a7c
5 changed files with 17 additions and 4 deletions

View File

@ -6,7 +6,7 @@
<meta name="renderer" content="webkit" /> <meta name="renderer" content="webkit" />
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>Hamster 幻灯片 v0.0.1-dev</title> <title>PPTist v0.0.1-dev</title>
</head> </head>
<body> <body>
<noscript> <noscript>
@ -14,5 +14,9 @@
</noscript> </noscript>
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
<script>
document.oncontextmenu = e => e.preventDefault()
</script>
</body> </body>
</html> </html>

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="color-picker" @contextmenu.prevent> <div class="color-picker">
<div class="picker-saturation-wrap"> <div class="picker-saturation-wrap">
<Saturation :value="color" :hue="hue" @change="value => changeColor(value)" /> <Saturation :value="color" :hue="hue" @change="value => changeColor(value)" />
</div> </div>

View File

@ -17,7 +17,12 @@ export default () => {
store.commit(MutationTypes.SET_CANVAS_PERCENTAGE, percentage) store.commit(MutationTypes.SET_CANVAS_PERCENTAGE, percentage)
} }
const setCanvasPercentage = (percentage: number) => {
store.commit(MutationTypes.SET_CANVAS_PERCENTAGE, percentage)
}
return { return {
scaleCanvas, scaleCanvas,
setCanvasPercentage,
} }
} }

View File

@ -117,7 +117,7 @@ export default defineComponent({
user-select: none; user-select: none;
&.multi-select { &.multi-select {
opacity: .3; opacity: 0;
} }
} }
.animation-index { .animation-index {

View File

@ -51,6 +51,9 @@
<IconMinus class="handler-item viewport-size" @click="scaleCanvas('-')" /> <IconMinus class="handler-item viewport-size" @click="scaleCanvas('-')" />
<span class="text">{{canvasScalePercentage}}</span> <span class="text">{{canvasScalePercentage}}</span>
<IconPlus class="handler-item viewport-size" @click="scaleCanvas('+')" /> <IconPlus class="handler-item viewport-size" @click="scaleCanvas('+')" />
<Tooltip :mouseLeaveDelay="0" :mouseEnterDelay="0.5" title="适配屏幕">
<IconFullScreen class="handler-item viewport-size-adaptation" @click="setCanvasPercentage(90)" />
</Tooltip>
</div> </div>
</div> </div>
</template> </template>
@ -85,7 +88,7 @@ export default defineComponent({
const canvasScalePercentage = computed(() => parseInt(canvasScale.value * 100 + '') + '%') const canvasScalePercentage = computed(() => parseInt(canvasScale.value * 100 + '') + '%')
const { scaleCanvas } = useScaleCanvas() const { scaleCanvas, setCanvasPercentage } = useScaleCanvas()
const { redo, undo } = useHistorySnapshot() const { redo, undo } = useHistorySnapshot()
const { createImageElement, createChartElement } = useCreateElement() const { createImageElement, createChartElement } = useCreateElement()
@ -123,6 +126,7 @@ export default defineComponent({
return { return {
scaleCanvas, scaleCanvas,
setCanvasPercentage,
canvasScalePercentage, canvasScalePercentage,
canUndo, canUndo,
canRedo, canRedo,