Skip to content

Commit

Permalink
Fix double-gap if control-switch is hidden and hide controls-group in…
Browse files Browse the repository at this point in the history
… the settings menu as well
  • Loading branch information
TBlueF committed Nov 21, 2024
1 parent 75131cf commit c88ac54
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
8 changes: 6 additions & 2 deletions common/webapp/src/components/ControlBar/ControlBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
<div class="space thin-hide greedy"></div>
<DayNightSwitch v-if="showMapMenu" class="thin-hide" :title="$t('lighting.dayNightSwitch.tooltip')" />
<div class="space thin-hide"></div>
<ControlsSwitch v-if="showMapMenu" class="thin-hide"></ControlsSwitch>
<div class="space thin-hide"></div>
<ControlsSwitch v-if="showMapMenu && showViewControls" class="thin-hide"></ControlsSwitch>
<div class="space thin-hide" v-if ="showViewControls"></div>
<SvgButton v-if="showMapMenu" class="thin-hide" :title="$t('resetCamera.tooltip')" @action="$bluemap.resetCamera()">
<svg viewBox="0 0 30 30">
<rect x="7.085" y="4.341" transform="matrix(0.9774 0.2116 -0.2116 0.9774 3.2046 -1.394)" width="2.063" height="19.875"/>
Expand Down Expand Up @@ -102,6 +102,10 @@
showMapMenu() {
return this.mapViewer.mapState === "loading" || this.mapViewer.mapState === "loaded";
},
showViewControls() {
if (!this.mapViewer.map) return false;
return this.mapViewer.map.views.length > 1;
},
showMarkerMenu() {
return this.hasMarkers(this.markers)
}
Expand Down
6 changes: 1 addition & 5 deletions common/webapp/src/components/ControlBar/ControlsSwitch.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="controls-switch" v-if="showViewControls">
<div class="controls-switch">
<SvgButton v-if="mapViewer.map.perspectiveView" :active="isPerspectiveView" @action="setPerspectiveView" :title="$t('controls.perspective.tooltip')">
<svg viewBox="0 0 30 30">
<path d="M19.475,10.574c-0.166-0.021-0.337-0.036-0.51-0.045c-0.174-0.009-0.35-0.013-0.525-0.011
Expand Down Expand Up @@ -52,10 +52,6 @@
},
isFreeFlight() {
return this.controls.state === "free";
},
showViewControls() {
if (!this.mapViewer.map) return 0;
return this.mapViewer.map.views.length > 1;
}
},
methods: {
Expand Down
8 changes: 7 additions & 1 deletion common/webapp/src/components/Menu/SettingsMenu.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div>
<Group :title="$t('controls.title')">
<Group v-if="showViewControls" :title="$t('controls.title')" >
<SimpleButton v-if="mapViewer.map.perspectiveView" :active="appState.controls.state === 'perspective'" @action="$bluemap.setPerspectiveView(500, appState.controls.state === 'free' ? 100 : 0)">{{$t('controls.perspective.button')}}</SimpleButton>
<SimpleButton v-if="mapViewer.map.flatView" :active="appState.controls.state === 'flat'" @action="$bluemap.setFlatView(500, appState.controls.state === 'free' ? 100 : 0)">{{$t('controls.flatView.button')}}</SimpleButton>
<SimpleButton v-if="mapViewer.map.freeFlightView" :active="appState.controls.state === 'free'" @action="$bluemap.setFreeFlight(500)">{{$t('controls.freeFlight.button')}}</SimpleButton>
Expand Down Expand Up @@ -106,6 +106,12 @@ name: "SettingsMenu",
themes: themes,
}
},
computed: {
showViewControls() {
if (!this.mapViewer.map) return false;
return this.mapViewer.map.views.length > 1;
}
},
methods: {
switchChunkBorders() {
this.$bluemap.setChunkBorders(!this.mapViewer.uniforms.chunkBorders.value);
Expand Down

0 comments on commit c88ac54

Please sign in to comment.