Skip to content

Commit c88ac54

Browse files
committed
Fix double-gap if control-switch is hidden and hide controls-group in the settings menu as well
1 parent 75131cf commit c88ac54

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

common/webapp/src/components/ControlBar/ControlBar.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
<div class="space thin-hide greedy"></div>
4646
<DayNightSwitch v-if="showMapMenu" class="thin-hide" :title="$t('lighting.dayNightSwitch.tooltip')" />
4747
<div class="space thin-hide"></div>
48-
<ControlsSwitch v-if="showMapMenu" class="thin-hide"></ControlsSwitch>
49-
<div class="space thin-hide"></div>
48+
<ControlsSwitch v-if="showMapMenu && showViewControls" class="thin-hide"></ControlsSwitch>
49+
<div class="space thin-hide" v-if ="showViewControls"></div>
5050
<SvgButton v-if="showMapMenu" class="thin-hide" :title="$t('resetCamera.tooltip')" @action="$bluemap.resetCamera()">
5151
<svg viewBox="0 0 30 30">
5252
<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"/>
@@ -102,6 +102,10 @@
102102
showMapMenu() {
103103
return this.mapViewer.mapState === "loading" || this.mapViewer.mapState === "loaded";
104104
},
105+
showViewControls() {
106+
if (!this.mapViewer.map) return false;
107+
return this.mapViewer.map.views.length > 1;
108+
},
105109
showMarkerMenu() {
106110
return this.hasMarkers(this.markers)
107111
}

common/webapp/src/components/ControlBar/ControlsSwitch.vue

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="controls-switch" v-if="showViewControls">
2+
<div class="controls-switch">
33
<SvgButton v-if="mapViewer.map.perspectiveView" :active="isPerspectiveView" @action="setPerspectiveView" :title="$t('controls.perspective.tooltip')">
44
<svg viewBox="0 0 30 30">
55
<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
@@ -52,10 +52,6 @@
5252
},
5353
isFreeFlight() {
5454
return this.controls.state === "free";
55-
},
56-
showViewControls() {
57-
if (!this.mapViewer.map) return 0;
58-
return this.mapViewer.map.views.length > 1;
5955
}
6056
},
6157
methods: {

common/webapp/src/components/Menu/SettingsMenu.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div>
3-
<Group :title="$t('controls.title')">
3+
<Group v-if="showViewControls" :title="$t('controls.title')" >
44
<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>
55
<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>
66
<SimpleButton v-if="mapViewer.map.freeFlightView" :active="appState.controls.state === 'free'" @action="$bluemap.setFreeFlight(500)">{{$t('controls.freeFlight.button')}}</SimpleButton>
@@ -106,6 +106,12 @@ name: "SettingsMenu",
106106
themes: themes,
107107
}
108108
},
109+
computed: {
110+
showViewControls() {
111+
if (!this.mapViewer.map) return false;
112+
return this.mapViewer.map.views.length > 1;
113+
}
114+
},
109115
methods: {
110116
switchChunkBorders() {
111117
this.$bluemap.setChunkBorders(!this.mapViewer.uniforms.chunkBorders.value);

0 commit comments

Comments
 (0)