Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Minor changes to menu and settings tab #411

Merged
merged 26 commits into from
Nov 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2b55058
refactor(appbar): change buttons to new design
steadyjaw Nov 8, 2021
ff1437a
refactor(appbar): change height and add pritnername
steadyjaw Nov 8, 2021
e78ed57
refactor: small sidebar
steadyjaw Nov 9, 2021
11a9a8e
refactor(vuetify): define parts of the mainsail theme and expose colo…
steadyjaw Nov 9, 2021
413e642
refactor: ui settings add missing divider
steadyjaw Nov 9, 2021
46bb749
refactor: add farm printer selection and menu to new top and sidebar,…
steadyjaw Nov 9, 2021
d10caf3
refactor: make topbar buttons hideable via ui settings
steadyjaw Nov 9, 2021
be109a6
refactor: move miniConsole buttons to toolbar and make'em collapsible
steadyjaw Nov 9, 2021
39ede45
refactor: set matching colors for buttons on console page
steadyjaw Nov 9, 2021
88fb3f3
refactor: use colornames from theme and set play/resume button to green
steadyjaw Nov 9, 2021
c30ea16
fix: correct visibility of hide buttons on collapse
steadyjaw Nov 9, 2021
884a336
feature: add virtual tab button to console-input on touch devices
steadyjaw Nov 9, 2021
1dfa48a
refactor: remove hide e-stop button setting
steadyjaw Nov 12, 2021
9af6427
fix: add reactivity to hide upload and print button functionality
steadyjaw Nov 12, 2021
03408a0
refactor: move logo to topbar and clip menu under topbar
steadyjaw Nov 12, 2021
4d6d9de
refactor: remove unused TheSidebarPrinterMenu
steadyjaw Nov 12, 2021
cd2a534
feature: create and add about component to sidebar ...no dialog on cl…
steadyjaw Nov 12, 2021
f66e29d
fix: correct appearance of the close icon from interface settings dialog
steadyjaw Nov 12, 2021
b414572
Revert "fix: correct appearance of the close icon from interface sett…
steadyjaw Nov 13, 2021
7f67a35
Merge branch 'develop' into refactor/ui-redesign
steadyjaw Nov 13, 2021
dc2c034
Merge branch 'mainsail-crew:develop' into feature/ui-design
steadyjaw Nov 14, 2021
44cfcda
refactor: close ui settings on ESC and change close icon to tile
steadyjaw Nov 14, 2021
de8d400
refactor: change font style in wide sidebar and extend width of wide …
steadyjaw Nov 14, 2021
44f12e9
refactor: change menu style ui-settings-entry to dropdown
steadyjaw Nov 14, 2021
259aa1f
refactor: correct variablenames in locales
steadyjaw Nov 14, 2021
aadd989
refactor: re-do menuStyle setting implementation
steadyjaw Nov 14, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/TheSettingsMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<v-btn icon tile large @click="showSettings = true">
<v-icon>mdi-cogs</v-icon>
</v-btn>
<v-dialog v-model="showSettings" width="900" persistent :fullscreen="isMobile">
<v-dialog v-model="showSettings" width="900" persistent :fullscreen="isMobile" @keydown.esc="showSettings = false">
<panel :title="$t('Settings.InterfaceSettings')" icon="mdi-cogs" card-class="settings-menu-dialog" :margin-bottom="false" style="overflow: hidden;" :height="isMobile ? 0 : 548">
<template v-slot:buttons>
<v-btn icon @click="showSettings = false"><v-icon>mdi-close-thick</v-icon></v-btn>
<v-btn icon tile @click="showSettings = false"><v-icon>mdi-close-thick</v-icon></v-btn>
</template>
<template v-if="isMobile">
<v-tabs v-model="activeTab" :center-active="true" :show-arrows="true">
Expand Down
28 changes: 18 additions & 10 deletions src/components/TheSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,32 @@
.active-nav-item {
border-right: 4px solid var(--v-primary-base);
}
.nowrap {
white-space: nowrap !important;
.menu-item-icon {
opacity: .85;
}
.menu-item-title {
line-height: 30px;
font-size: 14px;
font-weight: 600;
text-transform: uppercase;
opacity: .85;
}
</style>

<template>
<v-navigation-drawer v-model="naviDrawer" :src="sidebarBackground" :mini-variant="!boolWideNavDrawer" :key="boolWideNavDrawer ? 'wide' : 'mini'" width="200px" clipped app>
<v-navigation-drawer v-model="naviDrawer" :src="sidebarBackground" :mini-variant="(menuStyle === 'iconsOnly')" :key="menuStyle" width="220px" clipped app>
<v-list class="pr-0 pt-0 ml-0">
<v-list-item-group active-class="active-nav-item">
<template v-if="countPrinters">
<v-list-item
router to="/allPrinters"
class="small-list-item mt-1"
>
<v-list-item-icon class="my-3 mr-3">
<v-list-item-icon class="my-3 mr-3 menu-item-icon">
<v-icon>mdi-view-dashboard-outline</v-icon>
</v-list-item-icon>
<v-list-item-content>
<v-list-item-title tile>{{ $t("App.Printers")}}</v-list-item-title>
<v-list-item-title tile class="menu-item-title">{{ $t("App.Printers")}}</v-list-item-title>
</v-list-item-content>

</v-list-item>
Expand All @@ -47,19 +54,19 @@
v-if="showInNavi(category)"
class="small-list-item"
>
<v-list-item-icon class="my-3 mr-3">
<v-list-item-icon class="my-3 mr-3 menu-item-icon">
<v-icon>mdi-{{ category.icon }}</v-icon>
</v-list-item-icon>
<v-list-item-content>
<v-list-item-title tile>{{ $t(`Router.${category.title}`) }}</v-list-item-title>
<v-list-item-title tile class="menu-item-title">{{ $t(`Router.${category.title}`) }}</v-list-item-title>
</v-list-item-content>
</v-list-item>
</div>
</v-list-item-group>
</v-list>
<template v-slot:append>
<v-list-item class="small-list-item mb-2">
<v-list-item-icon>
<v-list-item-icon class="menu-item-icon">
<about-modal></about-modal>
</v-list-item-icon>
</v-list-item>
Expand All @@ -82,6 +89,7 @@ import AboutModal from '@/components/modals/AboutModal.vue'
AboutModal
}
})

export default class TheSidebarAlt extends Mixins(BaseMixin) {
get naviDrawer(): boolean {
return this.$store.state.naviDrawer
Expand All @@ -91,8 +99,8 @@ export default class TheSidebarAlt extends Mixins(BaseMixin) {
this.$store.dispatch('setNaviDrawer', newVal)
}

get boolWideNavDrawer() {
return this.$store.state.gui.dashboard.boolWideNavDrawer ?? false
get menuStyle() {
return this.$store.state.gui.dashboard.menuStyle
}

get sidebarBackground(): string {
Expand Down
27 changes: 21 additions & 6 deletions src/components/settings/SettingsUiSettingsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
<v-switch v-model="confirmOnPowerDeviceChange" hide-details class="mt-0"></v-switch>
</settings-row>
<v-divider class="my-2"></v-divider>
<settings-row :title="$t('Settings.UiSettingsTab.BoolWideNavDrawer')" :sub-title="$t('Settings.UiSettingsTab.BoolWideNavDrawerDescription')" :dynamicSlotWidth="true">
<v-switch v-model="boolWideNavDrawer" hide-details class="mt-0"></v-switch>
<settings-row :title="$t('Settings.UiSettingsTab.MenuStyle')" :sub-title="$t('Settings.UiSettingsTab.MenuStyleDescription')">
<v-select v-model="menuStyleSetting" :items="menuStyles" outlined dense hide-details class="mt-0"></v-select>
</settings-row>
<v-divider class="my-2"></v-divider>
<settings-row :title="$t('Settings.UiSettingsTab.BoolHideUploadAndPrintButton')" :sub-title="$t('Settings.UiSettingsTab.BoolHideUploadAndPrintButtonDescription')" :dynamicSlotWidth="true">
Expand All @@ -80,9 +80,11 @@ import BaseMixin from '@/components/mixins/base'
import SettingsRow from '@/components/settings/SettingsRow.vue'
import {defaultLogoColor, defaultPrimaryColor} from '@/store/variables'
import {Debounce} from 'vue-debounce-decorator'

@Component({
components: {SettingsRow}
})

export default class SettingsUiSettingsTab extends Mixins(BaseMixin) {
private defaultLogoColor = defaultLogoColor
private defaultPrimaryColor = defaultPrimaryColor
Expand Down Expand Up @@ -151,12 +153,25 @@ export default class SettingsUiSettingsTab extends Mixins(BaseMixin) {
this.$store.dispatch('gui/saveSetting', {name: 'general.confirmOnPowerDeviceChange', value: newVal })
}

get boolWideNavDrawer() {
return this.$store.state.gui.dashboard.boolWideNavDrawer ?? false
get menuStyleSetting() {
return this.$store.state.gui.dashboard.menuStyle
}

set menuStyleSetting(newVal) {
this.$store.dispatch('gui/saveSetting', {name: 'dashboard.menuStyle', value: newVal })
}

set boolWideNavDrawer(newVal) {
this.$store.dispatch('gui/saveSetting', {name: 'dashboard.boolWideNavDrawer', value: newVal })
get menuStyles() {
return [
{
text: this.$t('Settings.UiSettingsTab.MenuStyleIconsOnly'),
value: 'iconsOnly'
},
{
text: this.$t('Settings.UiSettingsTab.MenuStyleIconsAndText'),
value: 'iconsAndText'
}
]
}

get boolHideUploadAndPrintButton() {
Expand Down
6 changes: 4 additions & 2 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -670,8 +670,10 @@
"ShowWebcamInNavigation": "Show Webcam in navigation",
"BoolBigThumbnail": "Large thumbnail",
"BoolBigThumbnailDescription": "Display a large thumbnail in the status panel during a print.",
"BoolWideNavDrawer": "Wide Navigation Drawer",
"BoolWideNavDrawerDescription": "Display a wider Navigation Toolbar",
"MenuStyle": "Style of the side menu",
"MenuStyleDescription": "Change the appearance of the side menu",
"MenuStyleIconsOnly": "Icons only",
"MenuStyleIconsAndText": "Icons + Text",
"BoolHideUploadAndPrintButton": "Hide Upload and Print Button",
"BoolHideUploadAndPrintButtonDescription": "Show or hide the \"Upload and Print\" button in the topbar.",
"DisplayCANCEL_PRINT": "Display CANCEL_PRINT",
Expand Down
1 change: 1 addition & 0 deletions src/store/gui/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const getDefaultState = (): GuiState => {
boolTempchart: true,
boolBigThumbnail: true,
boolWideNavDrawer: false,
menuStyle: 'iconsOnly',
macroManagement: 'simple',
hiddenMacros: [],
hiddenTempChart: [],
Expand Down