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

Add support for vuetify theming #262

Merged
merged 47 commits into from
Dec 23, 2021
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
427829a
Added app context config for vuetify theming
ntma Oct 18, 2021
717f4b5
Added toolbar button to control light/dark modes
ntma Oct 20, 2021
9ad9732
Initial attempt to colour both light and dark themes
ntma Oct 23, 2021
915ce9b
Lingual adjustments (locales/de.json)
ntma Oct 27, 2021
586fc6c
Light/dark theme for wgu-attributetable-win | wgu-geocoder-input | wg…
ntma Oct 28, 2021
4853d88
Applying orange tone for errors
ntma Oct 28, 2021
0cc6e87
Using onprimary to colorize typography/icons over primary panels
ntma Oct 29, 2021
c53336a
Documentation for theme configuration | revert dark property as input…
ntma Oct 29, 2021
d6b6d75
Missing locales (de)
ntma Oct 29, 2021
a4ffa8d
changed 'theme' property to 'colorTheme'
ntma Nov 4, 2021
287d47c
Linguistic adjustments
ntma Nov 4, 2021
79fe80c
Inline documentation for wgu-themeswitcher
ntma Nov 4, 2021
0e98d37
Fallback to defautl colors when colorTheme isn't defined
ntma Nov 4, 2021
313f778
Warning for deprecated baseColor | Removed incorrect 'onsurface' them…
ntma Nov 9, 2021
2a5502d
Removed all occurrences of the property 'darkLayout'
ntma Nov 9, 2021
c41f497
Fixed geocoder unfocused color | removed missing 'darkLayout' occurre…
ntma Nov 9, 2021
9ebb0a2
Added fallback system for colorTheme | updated docs
ntma Nov 10, 2021
fc06279
Added documentation on the asymmetry between light/dark mandatory colors
ntma Nov 10, 2021
04e5a14
More stable fix for font/icon colors in geocoder/attributetable
ntma Nov 11, 2021
ff36f9e
Delegate control over coloring to appFooter/appHeader
ntma Nov 11, 2021
61b5b1e
Delegate control over coloring to olmap/bgLayerSwitcher/mapLoadingStatus
ntma Nov 11, 2021
f33a07f
Update sidebar components/config/docs to the vuetify changes
ntma Nov 11, 2021
686a8f2
Removed remaining 'dark' properties | Removed 'color' from components…
ntma Nov 11, 2021
bc957a3
Fixed dark mode for wgu-infoclick
ntma Nov 11, 2021
b8ab3a1
Updated unit tests
ntma Nov 11, 2021
5a9a0ad
Refactor accent color to be handled internally | added the remaining …
ntma Nov 12, 2021
5c4e8d8
Added documentation on picking colors for the 'light' and 'dark' themes
ntma Nov 12, 2021
a84ec7d
Minor code adjustments
Nov 24, 2021
f1da70c
Refactored the initialization of the Vuetify theme object
Nov 25, 2021
b01e362
Restored default colors for app-conf-projected/app-conf-minimal
Nov 25, 2021
6881bdc
Added anchor color class to the theme configuration (managed internally)
Nov 25, 2021
b1e7684
Fixed hovering shade in BgLayerList and ToggleButtons
Nov 25, 2021
5af5790
Second attempt to fix colors for solo fields
Nov 26, 2021
eb06d5b
Changed ThemeSwitcher tool from v-btn to ToggleButton
Nov 26, 2021
590f553
checkLuminance function 2.0
Nov 26, 2021
4c2cbf3
Forced onprimary color to solo fields (light theme only)
Nov 26, 2021
cb37189
Added v-sheet as a class to ol.map overlay tooltip | dynamically chan…
Nov 29, 2021
5e6cb3f
Better fix for ToggleButton hover effect (suggested by @fschmenger)
Dec 9, 2021
0bbc9b1
Minor linguistic correction
Dec 9, 2021
d80e88a
Updated unit tests to the latest changes
Dec 9, 2021
d215fe7
Revert changes for hovering BgLayerList
Dec 14, 2021
1ba71d1
Removed unused unit test for css colors on ol buttons
Dec 14, 2021
e8b4760
Set primary to the hamburguer menu
Dec 17, 2021
43eb137
Simplify solo fields (using immutable filled property)
Dec 17, 2021
5ffd994
Moved color property to be fully controlled by each component
Dec 20, 2021
110d1e4
Wrapped solo fields CSS overrides into .wgu-solo-field
Dec 20, 2021
d2a2931
Updated unit tests for ThemeSwitcher
Dec 20, 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
16 changes: 7 additions & 9 deletions app-starter/WguAppTemplate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<slot name="wgu-app-begin" />

<wgu-app-header :color="baseColor">
<wgu-app-header>
<!-- forward the slots of AppHeader -->
<slot name="wgu-tb-start" slot="wgu-tb-start" />
<slot name="wgu-tb-after-title" slot="wgu-tb-after-title" />
Expand All @@ -17,7 +17,7 @@
<wgu-app-sidebar v-if="sidebarWins.length" v-bind="sidebarConfig">
<template v-for="(moduleWin, index) in sidebarWins">
<component
:is="moduleWin.type" :key="index" :color="baseColor"
:is="moduleWin.type" :key="index"
v-bind="moduleWin"
/>
</template>
Expand All @@ -26,29 +26,28 @@
<slot name="wgu-before-content" />
<v-content app>
<v-container id="ol-map-container" fluid fill-height class="pa-0">
<wgu-map :color="baseColor" />
<wgu-map />
<!-- layer loading indicator -->
<wgu-maploading-status :color="baseColor" />
<wgu-maploading-status />
<slot name="wgu-after-map">
</slot>
<!-- Portal to overlay the map content from an application module -->
<portal-target name="map-overlay" />
<wgu-app-logo />
<wgu-bglayerswitcher :color="baseColor"/>
<wgu-bglayerswitcher />
</v-container>
</v-content>

<template v-for="(moduleWin, index) in floatingWins">
<component
:is="moduleWin.type" :key="index" :color="baseColor"
:is="moduleWin.type" :key="index"
v-bind="moduleWin"
/>
</template>

<slot name="wgu-before-footer" />

<wgu-app-footer
:color="baseColor"
:footerTextLeft="$t('app.footerTextLeft')"
:footerTextRight="$t('app.footerTextRight')"
:showCopyrightYear="showCopyrightYear"
Expand Down Expand Up @@ -101,8 +100,7 @@
sidebarConfig: this.getSidebarConfig(),
floatingWins: this.getModuleWinData('floating'),
sidebarWins: this.getModuleWinData('sidebar'),
showCopyrightYear: Vue.prototype.$appConfig.showCopyrightYear,
baseColor: Vue.prototype.$appConfig.baseColor
showCopyrightYear: Vue.prototype.$appConfig.showCopyrightYear
}
},
created () {
Expand Down
7 changes: 3 additions & 4 deletions app-starter/components/AppFooter.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>

<v-footer :color="color" class="white--text" app>
<v-footer color="primary" class="onprimary--text" app>
<span class="wgu-footer-left" v-html="footerTextLeft"></span>
<v-spacer></v-spacer>
<div class="wgu-footer-right">
Expand All @@ -16,7 +16,6 @@
export default {
name: 'wgu-app-footer',
props: {
color: { type: String, required: false, default: 'red darken-3' },
footerTextLeft: { type: String, required: true },
footerTextRight: { type: String, required: true },
showCopyrightYear: { type: Boolean, required: false, default: true }
Expand All @@ -34,8 +33,8 @@ export default {
}
}
/* avoid special color for links in footer */
.v-application a {
color: inherit;
.v-footer a {
color: inherit !important;
}

</style>
20 changes: 10 additions & 10 deletions app-starter/components/AppHeader.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<v-app-bar
class="wgu-app-toolbar white--text"
:color="color"
class="wgu-app-toolbar onprimary--text"
color="primary"
fixed
app
clipped-left
Expand Down Expand Up @@ -34,12 +34,13 @@
<v-menu v-if="menuButtons.length" offset-y nudge-bottom="15">
<template v-slot:activator="{on}">

<v-btn icon dark v-on="on"
<v-btn icon v-on="on"
color="onprimary"
:title="$t('wgu-toolbar-menu.title')">
<v-icon medium>menu</v-icon>
</v-btn>
</template>
<v-list :color="color">
<v-list>
<template v-for="(tbButton, index) in menuButtons">
<v-list-item :key="index">
<component
Expand All @@ -65,6 +66,7 @@ import ZoomToMaxExtentButton from '../../src/components/maxextentbutton/ZoomToMa
import Geocoder from '../../src/components/geocoder/Geocoder'
import Geolocator from '../../src/components/geolocator/Geolocator'
import LocaleSwitcher from '../../src/components/localeswitcher/LocaleSwitcher'
import ThemeSwitcher from '../../src/components/themeswitcher/ThemeSwitcher'

export default {
name: 'wgu-app-header',
Expand All @@ -73,11 +75,10 @@ export default {
'wgu-geocoder-btn': Geocoder,
'wgu-zoomtomaxextent-btn': ZoomToMaxExtentButton,
'wgu-geolocator-btn': Geolocator,
'wgu-localeswitcher-btn': LocaleSwitcher
},
props: {
color: { type: String, required: false, default: 'red darken-3' }
'wgu-localeswitcher-btn': LocaleSwitcher,
'wgu-themeswitcher-btn': ThemeSwitcher
},
props: {},
data () {
return {
menuButtons: this.getModuleButtons('menu'),
Expand Down Expand Up @@ -108,8 +109,7 @@ export default {
buttons.push({
type: moduleOpts.win ? 'wgu-toggle-btn' : key + '-btn',
moduleName: key,
// TODO For further simplifications we should revise the config property 'darkLayout'.
dark: moduleOpts.darkLayout,
color: target === 'toolbar' ? 'onprimary' : 'secondary',
...moduleOpts
});
}
Expand Down
8 changes: 3 additions & 5 deletions app-starter/components/AppSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
app
clipped
:width=width
:color=color
v-model="sidebarOpen"
>
<!-- Forward the default slot for sidebar content. -->
Expand All @@ -15,10 +14,10 @@
class="wgu-app-sidebar-toggle-btn px0"
absolute
top
:color=color
color="secondary"
@click="sidebarOpen = !sidebarOpen">
<v-icon v-if="sidebarOpen">chevron_left</v-icon>
<v-icon v-else>chevron_right</v-icon>
<v-icon color="onsecondary" v-if="sidebarOpen">chevron_left</v-icon>
<v-icon color="onsecondary" v-else>chevron_right</v-icon>
</v-btn>
</template>
</v-navigation-drawer>
Expand All @@ -31,7 +30,6 @@ import { WguEventBus } from '../../src/WguEventBus'
export default {
name: 'wgu-app-sidebar',
props: {
color: { type: String, required: false, default: 'white' },
width: { type: Number, required: false, default: 400 },
visible: { type: Boolean, required: false, default: true },
autoScroll: { type: Boolean, required: false, default: true },
Expand Down
16 changes: 13 additions & 3 deletions app-starter/static/app-conf-minimal.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
{

"baseColor": "green darken-3",
"colorTheme": {
"dark": false,
"themes": {
"light": {
"primary": "#2E7D32"
},
"dark": {
"secondary": "#A5D6A7"
}
}
},

"showCopyrightYear": true,

"lang": {
Expand Down Expand Up @@ -35,8 +46,7 @@
"wgu-helpwin": {
"target": "toolbar",
"win": "floating",
"icon": "help",
"darkLayout": true
"icon": "help"
}
}

Expand Down
28 changes: 16 additions & 12 deletions app-starter/static/app-conf-projected.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{

"baseColor": "orange darken-3",
"colorTheme": {
"dark": false,
"themes": {
"light": {
"primary": "#EF6C00",
"onprimary": "#FFFFFF",
"onsecondary": "#FFFFFF"
},
"dark": {
"secondary": "#FFCC80"
}
}
},

"logo": "https://dummyimage.com/100x100/aaa/fff&text=Wegue",
"logoSize": "100",
Expand Down Expand Up @@ -130,14 +142,12 @@
"target": "menu",
"win": "floating",
"icon": "layers",
"darkLayout": true,
"draggable": false
},
"wgu-measuretool": {
"target": "menu",
"win": "floating",
"icon": "photo_size_select_small",
"darkLayout": true,
"draggable": false,
"strokeColor": "#c62828",
"fillColor": "rgba(198,40,40,0.2)",
Expand All @@ -150,7 +160,6 @@
"target": "menu",
"win":"floating",
"icon": "info",
"darkLayout": true,
"draggable": false,
"initPos": {
"left": 8,
Expand All @@ -159,7 +168,6 @@
},
"wgu-geocoder": {
"target": "toolbar",
"darkLayout": true,
"minChars": 4,
"queryDelay": 200,
"debug": false,
Expand All @@ -172,14 +180,12 @@
}
},
"wgu-zoomtomaxextent": {
"target": "toolbar",
"darkLayout": true
"target": "toolbar"
},
"wgu-maprecorder": {
"target": "toolbar",
"win": "floating",
"icon": "mdi-video",
"darkLayout": true,
"draggable": false,
"initPos": {
"left": 8,
Expand All @@ -189,12 +195,10 @@
"wgu-helpwin": {
"target": "toolbar",
"win": "floating",
"icon": "help",
"darkLayout": true
"icon": "help"
},
"wgu-localeswitcher": {
"target": "toolbar",
"darkLayout": true
"target": "toolbar"
}
}

Expand Down
25 changes: 10 additions & 15 deletions app-starter/static/app-conf-sidebar.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{

"baseColor": "red darken-3",
"colorTheme": {
"dark": false
},

"logo": "https://dummyimage.com/100x100/aaa/fff&text=Wegue",
"logoWidth": "100",
Expand Down Expand Up @@ -46,7 +48,6 @@
"sidebar": {
"visible": true,
"width": 400,
"color": "white",
"autoScroll": true,
"scrollDuration": 500
},
Expand Down Expand Up @@ -198,15 +199,13 @@
"target": "menu",
"win": "sidebar",
"icon": "layers",
"darkLayout": true,
"visible": true,
"minimizable": true
},
"wgu-measuretool": {
"target": "menu",
"win": "sidebar",
"icon": "photo_size_select_small",
"darkLayout": true,
"minimizable": true,
"strokeColor": "#c62828",
"fillColor": "rgba(198,40,40,0.2)",
Expand All @@ -219,12 +218,10 @@
"target": "menu",
"win": "sidebar",
"icon": "info",
"darkLayout": true,
"minimizable": true
},
"wgu-geocoder": {
"target": "toolbar",
"darkLayout": true,
"minChars": 2,
"queryDelay": 200,
"debug": false,
Expand All @@ -236,37 +233,35 @@
}
},
"wgu-zoomtomaxextent": {
"target": "toolbar",
"darkLayout": true
"target": "toolbar"
},
"wgu-maprecorder": {
"target": "toolbar",
"win": "sidebar",
"icon": "mdi-video",
"darkLayout": true,
"minimizable": true
},
"wgu-helpwin": {
"target": "toolbar",
"win": "floating",
"icon": "help",
"darkLayout": true
"icon": "help"
},
"wgu-geolocator": {
"target": "toolbar"
},
"wgu-themeswitcher": {
"target": "toolbar",
"darkLayout": true
"icon": "dark_mode"
},
"wgu-attributetable": {
"target": "menu",
"win": "sidebar",
"icon": "table_chart",
"darkLayout": true,
"minimizable": true,
"syncTableMapSelection": true
},
"wgu-localeswitcher": {
"target": "toolbar",
"darkLayout": true
"target": "toolbar"
}
}
}
Loading