Skip to content

Commit

Permalink
Fixed hovering shade in BgLayerList and ToggleButtons
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuno Amorim committed Nov 25, 2021
1 parent 6881bdc commit b1e7684
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 24 deletions.
53 changes: 31 additions & 22 deletions src/components/bglayerswitcher/BgLayerList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,38 @@
:value="layer"
v-slot:default="{ active, toggle }"
>
<v-card
hover
:width="imageWidth"
:class="{
'ma-1': true,
'secondary': active,
'onsecondary--text': active
}"
@click="toggle"
>
<wgu-layerpreviewimage
:layer="layer"
:mapView="map.getView()"
<v-hover v-slot="{ hover }">
<v-card
hover
:width="imageWidth"
:height="imageHeight"
:previewIcon="previewIcon"
/>
<v-card-title class="caption">
<span class="d-inline-block text-truncate">
{{ layer.get('name') }}
</span>
</v-card-title>
</v-card>
:class="{
'ma-1': true,
'secondary': active,
'onsecondary--text': active
}"
@click="toggle"
>
<wgu-layerpreviewimage
:layer="layer"
:mapView="map.getView()"
:width="imageWidth"
:height="imageHeight"
:previewIcon="previewIcon"
/>
<v-card-title class="caption">
<span class="d-inline-block text-truncate">
{{ layer.get('name') }}
</span>
</v-card-title>

<v-overlay
absolute
opacity="0.2"
color="grey"
:value="hover"
/>
</v-card>
</v-hover>
</v-slide-item>
</v-slide-group>
</v-sheet>
Expand Down
17 changes: 15 additions & 2 deletions src/components/modulecore/ToggleButton.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<template>
<v-btn-toggle borderless dense
:color="color"
<v-btn-toggle
class="wgu-toggle-button"
borderless
dense
:color="color"
background-color="transparent"
:title="$t(moduleName + '.title')"
v-model="show">
Expand Down Expand Up @@ -38,3 +41,13 @@ export default {
}
};
</script>
<style>
/**
Required to fix the hover button color.
Also fixes the color of any possible text
inside the button.
*/
.wgu-toggle-button .v-btn {
color: inherit !important;
}
</style>

0 comments on commit b1e7684

Please sign in to comment.