Skip to content

Commit

Permalink
Merge branch 'mainsail-crew:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
4rnoP authored Dec 17, 2023
2 parents 392949b + 0783b4e commit 027a520
Show file tree
Hide file tree
Showing 77 changed files with 1,704 additions and 1,197 deletions.
1,315 changes: 694 additions & 621 deletions CHANGELOG.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mainsail",
"version": "2.8.0",
"version": "2.9.0",
"private": true,
"decription": "a klipper web interface",
"author": {
Expand Down
1 change: 1 addition & 0 deletions public/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"defaultLocale": "en",
"defaultTheme": "dark",
"hostname": null,
"port": null,
"instancesDB": "moonraker",
Expand Down
206 changes: 206 additions & 0 deletions public/img/sidebar-background-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions remote/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"defaultLocale": "en",
"defaultTheme": "dark",
"hostname": null,
"port": null,
"instancesDB": "browser",
Expand Down
24 changes: 20 additions & 4 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-app dark :style="cssVars">
<v-app :style="cssVars">
<template v-if="socketIsConnected && guiIsReady">
<the-sidebar />
<the-topbar />
Expand Down Expand Up @@ -28,6 +28,7 @@
import Component from 'vue-class-component'
import TheSidebar from '@/components/TheSidebar.vue'
import BaseMixin from '@/components/mixins/base'
import ThemeMixin from './components/mixins/theme'
import TheTopbar from '@/components/TheTopbar.vue'
import { Mixins, Watch } from 'vue-property-decorator'
import TheUpdateDialog from '@/components/TheUpdateDialog.vue'
Expand Down Expand Up @@ -63,7 +64,7 @@ Component.registerHooks(['metaInfo'])
TheScrewsTiltAdjustDialog,
},
})
export default class App extends Mixins(BaseMixin) {
export default class App extends Mixins(BaseMixin, ThemeMixin) {
public metaInfo(): any {
let title = this.$store.getters['getTitle']
Expand Down Expand Up @@ -101,8 +102,10 @@ export default class App extends Mixins(BaseMixin) {
}
// overwrite padding left for the sidebar
if (this.naviDrawer && this.navigationStyle === 'iconsAndText') style.paddingLeft = '220px'
if (this.naviDrawer && this.navigationStyle === 'iconsOnly') style.paddingLeft = '56px'
if (this.naviDrawer && !this.$vuetify.breakpoint.mdAndDown) {
if (this.navigationStyle === 'iconsAndText') style.paddingLeft = '220px'
if (this.navigationStyle === 'iconsOnly') style.paddingLeft = '56px'
}
return style
}
Expand All @@ -123,6 +126,10 @@ export default class App extends Mixins(BaseMixin) {
return this.$store.state.printer.print_stats?.filename ?? ''
}
get theme(): string {
return this.$store.state.gui.uiSettings.theme
}
get logoColor(): string {
return this.$store.state.gui.uiSettings.logo
}
Expand Down Expand Up @@ -199,6 +206,15 @@ export default class App extends Mixins(BaseMixin) {
})
}
@Watch('theme')
themeChanged(newVal: string): void {
const dark = newVal !== 'light'
this.$vuetify.theme.dark = dark
const doc = document.documentElement
doc.className = dark ? 'theme--dark' : 'theme--light'
}
drawFavicon(val: number): void {
const favicon16: HTMLLinkElement | null = document.querySelector("link[rel*='icon'][sizes='16x16']")
const favicon32: HTMLLinkElement | null = document.querySelector("link[rel*='icon'][sizes='32x32']")
Expand Down
26 changes: 26 additions & 0 deletions src/assets/styles/page.css
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,29 @@ body {
min-width: 100px;
min-height: 100px;
}

/* Light theme */
html.theme--light {
scrollbar-color: rgba(0, 0, 0, 0.55) #ffffff;
}

html.theme--light body {
background: #ffffff !important;
}

html.theme--light ::-webkit-scrollbar {
background-color: #ffffff;
}

html.theme--light ::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.4);
border-color: #ffffff;
}

html.theme--light .os-theme-light > .os-scrollbar > .os-scrollbar-track > .os-scrollbar-handle {
background: rgba(0, 0, 0, 0.4) !important;
}

html.theme--light .os-theme-light > .os-scrollbar > .os-scrollbar-track > .os-scrollbar-handle:hover {
background: rgba(0, 0, 0, 0.55) !important;
}
8 changes: 5 additions & 3 deletions src/components/TheConnectingDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<template>
<v-dialog v-model="showDialog" persistent :width="400">
<v-card dark>
<v-card>
<v-toolbar flat dense>
<v-toolbar-title>
<span class="subheading">
Expand All @@ -28,7 +28,7 @@
</div>
</v-card-text>
<v-card-text v-else class="pt-5">
<v-progress-linear color="white" indeterminate></v-progress-linear>
<v-progress-linear :color="progressBarColor" indeterminate></v-progress-linear>
</v-card-text>
</v-card>
</v-dialog>
Expand All @@ -38,6 +38,8 @@
import Component from 'vue-class-component'
import { Mixins } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import ThemeMixin from '@/components/mixins/theme'
import ConnectionStatus from '@/components/ui/ConnectionStatus.vue'
import { mdiConnection } from '@mdi/js'
Expand All @@ -46,7 +48,7 @@ import { mdiConnection } from '@mdi/js'
ConnectionStatus,
},
})
export default class TheConnectingDialog extends Mixins(BaseMixin) {
export default class TheConnectingDialog extends Mixins(BaseMixin, ThemeMixin) {
mdiConnection = mdiConnection
counter = 0
Expand Down
2 changes: 1 addition & 1 deletion src/components/TheEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
</v-card-text>
</panel>
</v-dialog>
<v-snackbar v-model="loaderBool" :timeout="-1" :value="true" fixed right bottom dark>
<v-snackbar v-model="loaderBool" :timeout="-1" :value="true" fixed right bottom>
<div>
{{ snackbarHeadline }}
<br />
Expand Down
4 changes: 4 additions & 0 deletions src/components/TheSettingsMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,10 @@ export default class TheSettingsMenu extends Mixins(BaseMixin) {
height: 100%;
}
html.theme--light .settings-tabs-bar {
border-right: 1px solid rgba(0, 0, 0, 0.12);
}
.settings-tabs.height500 {
height: 500px;
max-height: calc(var(--app-height) - 111px);
Expand Down
Loading

0 comments on commit 027a520

Please sign in to comment.