Skip to content

Commit

Permalink
apply the preference to colorize the app bar, throughout the UI
Browse files Browse the repository at this point in the history
  • Loading branch information
klinker24 committed Aug 26, 2018
1 parent d8e70dc commit d17f8a8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
28 changes: 22 additions & 6 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,10 @@ export default {
* @param color - rgb/hex color string.
*/
updateTheme (color) {
// Ignore if toolbar theme is false
if (!this.$store.state.theme_apply_appbar_color)
return false;
this.toolbar_color = color;
},
Expand Down Expand Up @@ -419,10 +423,10 @@ export default {
computed: {
icon_class () {
return {
'logo': false,
'logo_dark': this.full_theme,
'menu_toggle': false,
'menu_toggle_dark': !this.full_theme,
'logo': this.full_theme && !this.$store.state.theme_apply_appbar_color,
'logo_dark': this.full_theme && this.$store.state.theme_apply_appbar_color,
'menu_toggle': !this.full_theme && !this.$store.state.theme_apply_appbar_color,
'menu_toggle_dark': !this.full_theme && this.$store.state.theme_apply_appbar_color,
}
},
Expand Down Expand Up @@ -452,22 +456,34 @@ export default {
},
theme_toolbar () { // Determine toolbar color
if (!this.$store.state.theme_apply_appbar_color) // If not color toolbar
return this.default_toolbar_color;
if (this.$store.state.theme_use_global) // If use global
return this.$store.state.theme_global_default;
return this.toolbar_color;
},
default_toolbar_color () { // Determine default colors
if (this.$store.state.theme_global_default) {
if (!this.$store.state.theme_apply_appbar_color) {
if (this.theme_str.indexOf('black') >= 0) {
return "#000000";
} else if (this.theme_str.indexOf('dark') >= 0) {
return "#202b30";
} else {
return "#FFFFFF";
}
} else if (this.$store.state.theme_global_default) {
return this.$store.state.theme_global_default;
} else {
return "#009688";
}
},
text_color () { // Determines toolbar text color
return "#fff";
if (this.$store.state.theme_apply_appbar_color)
return "#fff";
}
},
watch: {
Expand Down
5 changes: 4 additions & 1 deletion src/components/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<label for="global-theme" class="mdl-switch mdl-js-switch mdl-js-ripple-effect mdl-js-ripple-effect--ignore-events">
<input id="global-theme" class="mdl-switch__input" type="checkbox" v-model="global_theme">
<span class="mdl-switch__label mdl-color-text--grey-900">
Apply to all Conversations
Apply Colors to all Conversations
</span>
</label>
</div> <!-- End Global Theme -->
Expand Down Expand Up @@ -92,6 +92,9 @@
</span>
</label>
</div>

<br />

<div class="label-item">
<label for="enter-to-send" class="mdl-switch mdl-js-switch mdl-js-ripple-effect mdl-js-ripple-effect--ignore-events">
<input id="enter-to-send" class="mdl-switch__input" type="checkbox" v-model="enter_to_send">
Expand Down

0 comments on commit d17f8a8

Please sign in to comment.