Change Maps button to a Servers button when <2 maps are defined in the current server

This commit is contained in:
James Lyne 2021-09-01 01:06:43 +01:00
parent 8a7a05c0d1
commit aa78d6ad63
2 changed files with 8 additions and 3 deletions

View File

@ -0,0 +1 @@
<svg width="228.1pt" height="303.253" version="1.0" viewBox="0 0 228.1 227.44" xmlns="http://www.w3.org/2000/svg"><g stroke-linecap="round" stroke-linejoin="bevel" stroke-width="30"><path d="M107.55 182.2v9.215h-.318a4.671 4.671 0 0 0-4.681 4.682v6.895h-.897a4.672 4.672 0 0 0-4.682 4.683v13.635a4.672 4.672 0 0 0 4.682 4.683h24.791a4.672 4.672 0 0 0 4.682-4.683v-13.635a4.672 4.672 0 0 0-4.682-4.683h-.895v-6.895a4.671 4.671 0 0 0-4.682-4.682h-.317V182.2zM11.637 0A11.611 11.611 0 0 0 0 11.637v30.895c0 6.447 5.19 11.637 11.637 11.637h204.82c6.447 0 11.638-5.19 11.638-11.637V11.637A11.613 11.613 0 0 0 216.457 0zm7.207 16.748h65.322a4.432 4.432 0 0 1 4.441 4.441V32.98a4.432 4.432 0 0 1-4.441 4.442H18.844a4.43 4.43 0 0 1-4.44-4.442V21.19a4.43 4.43 0 0 1 4.44-4.442zm184.49 0a10.336 10.336 0 0 1 10.337 10.337 10.336 10.336 0 0 1-10.337 10.336 10.336 10.336 0 0 1-10.336-10.336 10.336 10.336 0 0 1 10.336-10.337zM11.637 61.5A11.611 11.611 0 0 0 0 73.137v30.895c0 6.447 5.19 11.637 11.637 11.637h204.82c6.447 0 11.638-5.19 11.638-11.637V73.137A11.613 11.613 0 0 0 216.457 61.5zm7.207 16.748h65.322a4.432 4.432 0 0 1 4.441 4.441V94.48a4.432 4.432 0 0 1-4.441 4.442H18.844a4.43 4.43 0 0 1-4.44-4.442V82.69a4.43 4.43 0 0 1 4.44-4.442zm184.49 0a10.336 10.336 0 0 1 10.337 10.337 10.336 10.336 0 0 1-10.337 10.336 10.336 10.336 0 0 1-10.336-10.336 10.336 10.336 0 0 1 10.336-10.337zM11.637 123A11.612 11.612 0 0 0 0 134.637v30.895c0 6.447 5.19 11.637 11.637 11.637h204.82c6.447 0 11.638-5.19 11.638-11.637v-30.895A11.613 11.613 0 0 0 216.457 123zm7.207 16.748h65.322a4.432 4.432 0 0 1 4.441 4.441v11.791a4.432 4.432 0 0 1-4.441 4.442H18.844a4.43 4.43 0 0 1-4.44-4.442v-11.79a4.43 4.43 0 0 1 4.44-4.442zm184.49 0a10.336 10.336 0 0 1 10.337 10.337 10.336 10.336 0 0 1-10.337 10.336 10.336 10.336 0 0 1-10.336-10.336 10.336 10.336 0 0 1 10.336-10.337zM26.084 202.03a12.708 12.708 0 0 0-12.708 12.708 12.708 12.708 0 0 0 12.708 12.708 12.708 12.708 0 0 0 10.806-6.061h56v-13H37.087a12.708 12.708 0 0 0-11.002-6.353zm175.93 0a12.708 12.708 0 0 0-10.982 6.353h-55.824v13h56a12.708 12.708 0 0 0 10.806 6.061 12.708 12.708 0 0 0 12.708-12.707 12.708 12.708 0 0 0-12.708-12.708z"/></g></svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -18,9 +18,10 @@
<section class="sidebar" role="none" ref="sidebar"> <section class="sidebar" role="none" ref="sidebar">
<header class="sidebar__buttons"> <header class="sidebar__buttons">
<button v-if="mapCount > 1 || serverCount > 1" :class="{'button--maps': true}" @click="toggleMaps" <button v-if="mapCount > 1 || serverCount > 1" :class="{'button--maps': true}" @click="toggleMaps"
:title="messageWorlds" :aria-label="messageWorlds" :aria-expanded="mapsVisible" :title="mapCount > 1 ? messageWorlds : messageServers"
@keydown="handleMapsKeydown"> :aria-label="mapCount > 1 ? messageWorlds : messageServers"
<SvgIcon name="maps"></SvgIcon> :aria-expanded="mapsVisible" @keydown="handleMapsKeydown">
<SvgIcon :name="mapCount > 1 ? 'maps' : 'servers'"></SvgIcon>
</button> </button>
<button v-if="playerMakersEnabled" :class="{'button--players': true}" @click="togglePlayers" <button v-if="playerMakersEnabled" :class="{'button--players': true}" @click="togglePlayers"
:title="messagePlayers" :aria-label="messagePlayers" :aria-expanded="playersVisible" :title="messagePlayers" :aria-label="messagePlayers" :aria-expanded="playersVisible"
@ -49,6 +50,7 @@ import SvgIcon from "@/components/SvgIcon.vue";
import {MutationTypes} from "@/store/mutation-types"; import {MutationTypes} from "@/store/mutation-types";
import "@/assets/icons/players.svg"; import "@/assets/icons/players.svg";
import "@/assets/icons/maps.svg"; import "@/assets/icons/maps.svg";
import "@/assets/icons/servers.svg";
import {nextTick, ref, watch} from "vue"; import {nextTick, ref, watch} from "vue";
import {handleKeyboardEvent} from "@/util/events"; import {handleKeyboardEvent} from "@/util/events";
import {focus} from "@/util"; import {focus} from "@/util";
@ -74,6 +76,7 @@ export default defineComponent({
following = computed(() => store.state.followTarget), following = computed(() => store.state.followTarget),
messageWorlds = computed(() => store.state.messages.worldsHeading), messageWorlds = computed(() => store.state.messages.worldsHeading),
messageServers = computed(() => store.state.messages.serversHeading),
messagePlayers = computed(() => store.getters.playersHeading), messagePlayers = computed(() => store.getters.playersHeading),
playerMakersEnabled = computed(() => !!store.state.components.playerMarkers), playerMakersEnabled = computed(() => !!store.state.components.playerMarkers),
@ -127,6 +130,7 @@ export default defineComponent({
following, following,
messageWorlds, messageWorlds,
messageServers,
messagePlayers, messagePlayers,
previouslyVisible, previouslyVisible,