Skip to content

Commit

Permalink
fix: adds missing File Browser button tooltips (#1094)
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
  • Loading branch information
pedrolamas authored Apr 28, 2023
1 parent 3d5daf3 commit 44d94e6
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 32 deletions.
1 change: 1 addition & 0 deletions components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ declare module 'vue' {
AppSetting: typeof import('./src/components/ui/AppSetting.vue')['default']
AppSettingsNav: typeof import('./src/components/layout/AppSettingsNav.vue')['default']
AppTextField: typeof import('./src/components/ui/AppTextField.vue')['default']
AppThumbnailSize: typeof import('./src/components/ui/AppThumbnailSize.vue')['default']
AppToolsDrawer: typeof import('./src/components/layout/AppToolsDrawer.vue')['default']
AppUploadAndPrintBtn: typeof import('./src/components/layout/AppUploadAndPrintBtn.vue')['default']
AppUserMenu: typeof import('./src/components/layout/AppUserMenu.vue')['default']
Expand Down
31 changes: 18 additions & 13 deletions src/components/ui/AppColumnPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,24 @@
min-width="150"
:close-on-content-click="false"
>
<template #activator="{ on, attrs }">
<v-btn
:disabled="disabled"
fab
small
text
v-bind="attrs"
v-on="on"
>
<v-icon>
$cogs
</v-icon>
</v-btn>
<template #activator="{ on: menu, attrs }">
<v-tooltip bottom>
<template #activator="{ on: tooltip }">
<v-btn
:disabled="disabled"
fab
small
text
v-bind="attrs"
v-on="{ ...tooltip, ...menu }"
>
<v-icon>
$tableColumn
</v-icon>
</v-btn>
</template>
<span>{{ $t('app.general.btn.select_columns') }}</span>
</v-tooltip>
</template>
<v-list
dense
Expand Down
55 changes: 55 additions & 0 deletions src/components/ui/AppThumbnailSize.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<template>
<v-menu
bottom
left
offset-y
transition="slide-y-transition"
min-width="150"
:close-on-content-click="false"
>
<template #activator="{ on: menu, attrs }">
<v-tooltip bottom>
<template #activator="{ on: tooltip }">
<v-btn
:disabled="disabled"
fab
small
text
v-bind="attrs"
v-on="{ ...tooltip, ...menu }"
>
<v-icon>
$imageSizeSelectLarge
</v-icon>
</v-btn>
</template>
<span>{{ $t('app.general.btn.thumbnail_size') }}</span>
</v-tooltip>
</template>
<v-sheet class="pa-2">
<app-named-slider
v-model="thumbnailSize"
class="ma-1"
:label="$t('app.general.label.thumbnail_size')"
:min="32"
:max="192"
:step="16"
:reset-value="32"
suffix="px"
/>
</v-sheet>
</v-menu>
</template>

<script lang="ts">
import { Component, Prop, VModel, Vue } from 'vue-property-decorator'
@Component({})
export default class FileSystemToolbar extends Vue {
@VModel({ type: Number, required: true })
thumbnailSize!: number
@Prop({ type: Boolean, default: false })
readonly disabled!: boolean
}
</script>
19 changes: 3 additions & 16 deletions src/components/widgets/filesystem/FileSystemToolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,10 @@
</slot>
</v-tooltip>

<app-btn-collapse-group
<app-thumbnail-size
v-if="['gcodes', 'timelapse'].includes(root)"
collapsed
menu-icon="$imageSizeSelectLarge"
size="small"
>
<app-named-slider
v-model="thumbnailSize"
class="ma-1"
:label="$t('app.general.label.thumbnail_size')"
:min="32"
:max="192"
:step="16"
:reset-value="32"
suffix="px"
/>
</app-btn-collapse-group>
v-model="thumbnailSize"
/>

<app-column-picker
v-if="headers && rootProperties.canConfigure"
Expand Down
2 changes: 2 additions & 0 deletions src/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ import {
mdiTrayFull,
mdiTrayPlus,
mdiFolderArrowUp,
mdiTableColumn,
mdiShape
} from '@mdi/js'

Expand Down Expand Up @@ -357,6 +358,7 @@ export const Icons = Object.freeze({
moves: mdiVectorLine,
extrusions: mdiPrinter3dNozzle,
retractions: mdiSwapVertical,
tableColumn: mdiTableColumn,
parts: mdiShape,
folderOpen: mdiFolderOpen,
fileZip: mdiArchive,
Expand Down
4 changes: 3 additions & 1 deletion src/locales/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ app:
refresh: Refresh
reload: Reload
remove: Remove
remove_all: Remove All
remove_all: Remove all
rename: Rename
reprint: Re-Print
reset_file: Clear File
Expand All @@ -192,13 +192,15 @@ app:
save_as: Save As
save_restart: Save & Restart
save_config_and_restart: Save config & restart
select_columns: Select columns
send: Send
set_color: Set Color
set_default_layout: Set as Default Layout
shutdown: Shutdown
snooze: Snooze
socket_reconnect: Re-Connect
socket_refresh: Force refresh
thumbnail_size: Thumbnail size
upload: Upload
upload_files: Upload Files
upload_folder: Upload Folder
Expand Down
4 changes: 2 additions & 2 deletions src/store/files/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const getters: GetterTree<FilesState, RootState> = {
canView: true,
canPrint: false,
canConfigure: false,
filterTypes: []
filterTypes: ['hidden_files']
}
case 'docs':
return {
Expand All @@ -66,7 +66,7 @@ export const getters: GetterTree<FilesState, RootState> = {
canView: true,
canPrint: false,
canConfigure: false,
filterTypes: []
filterTypes: ['hidden_files']
}
case 'logs':
return {
Expand Down

0 comments on commit 44d94e6

Please sign in to comment.