Skip to content

Commit

Permalink
fix: Fix the bug of long press icon deformation on mobile devices
Browse files Browse the repository at this point in the history
  • Loading branch information
wushuangs committed Dec 9, 2024
1 parent ff852e0 commit a2a761b
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 7 deletions.
28 changes: 25 additions & 3 deletions packages/frontend/src/pages/mobile/DockComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,19 @@
:key="'aood+index' + index"
>
<div class="launchapp column items-center">
<img
<div
class="app-img"
@click="openWindow(element)"
:id="element.id"
:src="element.icon"
:style="{
width: element.id === 'bdock:launchpad' ? '0.56rem' : '0.52rem',
height: element.id === 'bdock:launchpad' ? '0.56rem' : '0.52rem'
}"
/>
>
<img :src="element.icon" />
<div class="overlay"></div>
</div>

<div class="app-name q-mt-xs" v-if="element.id !== 'bdock:launchpad'">
{{ element.title }}
</div>
Expand Down Expand Up @@ -101,6 +104,25 @@ defineExpose({
width: 0.52rem;
height: 0.52rem;
border-radius: 0.14rem;
-webkit-touch-callout: none;
-webkit-user-select: none;
-webkit-user-drag: none;
overflow: hidden;
position: relative;
img {
width: 100%;
height: 100%;
}
.overlay {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: transparent;
}
}
.app-name {
width: 100%;
Expand Down
14 changes: 10 additions & 4 deletions packages/frontend/src/pages/mobile/LaunchPad.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
position: relative;
"
v-touch-hold:1200.mouse="handleHold"
:id="appStore.desktopApps[element].id"
Expand Down Expand Up @@ -68,11 +69,9 @@
</svg>
</div>
<img
class="pad-img"
:src="appStore.desktopApps[element].icon"
:style="`width:58px;height:58px;border-radius: ${borderRadiusFormat(
58,
58
)}px;`"
:style="`border-radius: ${borderRadiusFormat(58, 58)}px;`"
/>
<div
class="launchpadapps_name"
Expand Down Expand Up @@ -280,6 +279,13 @@ const goto = (value: number) => {
grid-template-columns: repeat(4, 25%);
grid-row-gap: 30px;
padding-top: 60px;
.pad-img {
width: 58px;
height: 58px;
-webkit-touch-callout: none;
-webkit-user-select: none;
-webkit-user-drag: none;
}
.launchpadapps_name {
width: 100%;
text-align: center;
Expand Down

0 comments on commit a2a761b

Please sign in to comment.