Skip to content

Commit

Permalink
Fixes/qol in SelectedGame view
Browse files Browse the repository at this point in the history
- Remove redundant div, put row on viewport instead.
- Fixed tab labels wrapping so that resizing flows nicely.
- Translated the "No mods installed" text.
- Partially fixed some margin and width calc issues by using the app store.
- "Start Modded" button now disabled while no mods are installed.
  • Loading branch information
Owen3H committed Nov 24, 2024
1 parent eb68836 commit f08ce82
Show file tree
Hide file tree
Showing 12 changed files with 243 additions and 199 deletions.
1 change: 0 additions & 1 deletion frontend/src/assets/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ body {
padding: 0;
width: 100%;
height: 100%;
overflow: hidden;
}

body::before {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/general/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const appInfo = useDialog('app-info')
const appStore = useAppStore()
const {
sidebarExpanded,
sidebarWidth
sidebarWidthPx
} = storeToRefs(appStore)
const Dashboard = () => router.push('/')
Expand Down Expand Up @@ -145,7 +145,7 @@ const ModDevTools = () => router.push('/mod-dev-tools')
align-items: center;
position: fixed;
z-index: 999;
width: v-bind(sidebarWidth);
width: v-bind(sidebarWidthPx);
}
.collapsed {
Expand Down
9 changes: 4 additions & 5 deletions frontend/src/components/reusable/Viewport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import { useAppStore } from '@stores'
const appStore = useAppStore()
const {
sidebarWidth
sidebarOffsetPx,
topbarHeight
} = storeToRefs(appStore)
const topbarHeight = '30px'
</script>

<template>
Expand All @@ -19,7 +18,7 @@ const topbarHeight = '30px'
<style scoped>
.viewport {
max-height: calc(100vh - v-bind(topbarHeight));
margin-left: calc(v-bind(sidebarWidth) + 20px);
margin-right: 20px;
margin-left: calc(v-bind(sidebarOffsetPx));
/* margin-right: 30px; */
}
</style>
2 changes: 1 addition & 1 deletion frontend/src/components/selected-game/ProfileManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ onMounted(async () => {

<style scoped>
.profile-manager {
margin: 30px 10px 20px 10px;
margin: 30px 0px 20px 0px;
display: flex;
flex-direction: column;
flex: 1 0 auto;
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/i18n/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
"header": "Profilmanager",
"search-placeholder": "Suchprofile",
"new-profile": "Neues Profil"
}
},
"no-mods-installed": "Keine Mods installiert."
}
}
3 changes: 2 additions & 1 deletion frontend/src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"edit-button": "Edit"
},
"empty-results": "No mods match the search query",
"loading-mod-list": "Loading mod list"
"loading-mod-list": "Loading mod list",
"no-mods-installed": "No mods installed."
},
"settings": {
"select-language": "Select language",
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/i18n/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
"header": "Administrador de perfiles",
"search-placeholder": "Buscar perfiles",
"new-profile": "Nuevo perfil"
}
},
"no-mods-installed": "No hay modificaciones instaladas."
}
}
3 changes: 2 additions & 1 deletion frontend/src/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
"header": "Gestionnaire de profil",
"search-placeholder": "Rechercher des profils",
"new-profile": "Nouveau profil"
}
},
"no-mods-installed": "Aucun mod installé."
}
}
3 changes: 2 additions & 1 deletion frontend/src/i18n/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
"header": "Gestore del profilo",
"search-placeholder": "Cerca profili",
"new-profile": "Nuovo profilo"
}
},
"no-mods-installed": "Nessuna mod installata."
}
}
20 changes: 17 additions & 3 deletions frontend/src/stores/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,23 @@ import { computed, ref } from 'vue'
// sidebarWidth: string
// }

// TODO: Instead of hardcoding height/width refs, they should all be
// computed and point to their respective element in the DOM.
export const useAppStore = defineStore('AppStore', () => {
const maxThreads = ref(2)

const topbarHeight = ref(30)
const sidebarExpanded = ref(false)
const sidebarWidth = computed(() => sidebarExpanded.value ? '180px' : '75px')


const sidebarMargin = ref(20)
const sidebarMarginPx = computed(() => `${sidebarMargin.value}px`)

const sidebarWidth = computed(() => sidebarExpanded.value ? 180 : 75)
const sidebarWidthPx = computed(() => `${sidebarWidth.value}px`)

const sidebarOffset = computed(() => sidebarWidth.value + sidebarMargin.value)
const sidebarOffsetPx = computed(() => `${sidebarOffset.value}px`)

function toggleSidebar() {
sidebarExpanded.value = !sidebarExpanded.value
}
Expand All @@ -27,8 +38,11 @@ export const useAppStore = defineStore('AppStore', () => {

return {
maxThreads,
topbarHeight,
sidebarExpanded,
sidebarWidth,
sidebarMargin, sidebarMarginPx,
sidebarWidth, sidebarWidthPx,
sidebarOffset, sidebarOffsetPx,
toggleSidebar,
setMaxThreads
}
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/views/Dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ async function getPackages() {
}

:deep(.p-tab) {
font-size: 24px;
font-size: 25px;
font-weight: 450;
}
</style>
<!-- #endregion -->
Loading

0 comments on commit f08ce82

Please sign in to comment.