Merge branch 'themes-accent' into shigusegubu

* themes-accent:
  update headers in switcher to better separate the subsections
  paper theme, updated todo, lol
  improve the display of disabled buttons
  attempt to fix some bugs with shadows control
  fix #774
  revert emoji reaction style
This commit is contained in:
Henry Jameson 2020-02-18 00:24:31 +02:00
commit c7ae982115
10 changed files with 227 additions and 107 deletions

View file

@ -35,7 +35,7 @@
</div>
<button
class="emoji-reaction btn btn-default"
:class="{ 'toggled': reactedWith(reaction.name), 'not-clickable': !loggedIn }"
:class="{ 'picked-reaction': reactedWith(reaction.name), 'not-clickable': !loggedIn }"
@click="emojiOnClick(reaction.name, $event)"
@mouseenter="fetchEmojiReactionsByIfMissing()"
>
@ -127,4 +127,10 @@
}
}
.picked-reaction {
border: 1px solid var(--accent, $fallback--link);
margin-left: -1px; // offset the border, can't use inset shadows either
margin-right: calc(0.5em - 1px);
}
</style>

View file

@ -3,6 +3,17 @@ import OpacityInput from '../opacity_input/opacity_input.vue'
import { getCssShadow } from '../../services/style_setter/style_setter.js'
import { hex2rgb } from '../../services/color_convert/color_convert.js'
const toModel = (object = {}) => ({
x: 0,
y: 0,
blur: 0,
spread: 0,
inset: false,
color: '#000000',
alpha: 1,
...object
})
export default {
// 'Value' and 'Fallback' can be undefined, but if they are
// initially vue won't detect it when they become something else
@ -15,7 +26,7 @@ export default {
return {
selectedId: 0,
// TODO there are some bugs regarding display of array (it's not getting updated when deleting for some reason)
cValue: this.value || this.fallback || []
cValue: (this.value || this.fallback || []).map(toModel)
}
},
components: {
@ -24,12 +35,12 @@ export default {
},
methods: {
add () {
this.cValue.push(Object.assign({}, this.selected))
this.cValue.push(toModel(this.selected))
this.selectedId = this.cValue.length - 1
},
del () {
this.cValue.splice(this.selectedId, 1)
this.selectedId = this.cValue.length === 0 ? undefined : this.selectedId - 1
this.selectedId = this.cValue.length === 0 ? undefined : Math.max(this.selectedId - 1, 0)
},
moveUp () {
const movable = this.cValue.splice(this.selectedId, 1)[0]
@ -46,34 +57,24 @@ export default {
this.cValue = this.value || this.fallback
},
computed: {
anyShadows () {
return this.cValue.length > 0
},
anyShadowsFallback () {
return this.fallback.length > 0
},
selected () {
if (this.ready && this.cValue.length > 0) {
if (this.ready && this.anyShadows) {
return this.cValue[this.selectedId]
} else {
return {
x: 0,
y: 0,
blur: 0,
spread: 0,
inset: false,
color: '#000000',
alpha: 1
}
return toModel({})
}
},
currentFallback () {
if (this.ready && this.fallback.length > 0) {
if (this.ready && this.anyShadowsFallback) {
return this.fallback[this.selectedId]
} else {
return {
x: 0,
y: 0,
blur: 0,
spread: 0,
inset: false,
color: '#000000',
alpha: 1
}
return toModel({})
}
},
moveUpValid () {

View file

@ -21,7 +21,7 @@
</div>
<div class="panel-body theme-preview-content">
<div class="post">
<div class="avatar">
<div class="avatar still-image">
( ͡° ͜ʖ ͡°)
</div>
<div class="content">

View file

@ -443,7 +443,7 @@
:label="$t('settings.style.advanced_colors.top_bar')"
/>
<ContrastRatio :contrast="previewContrast.btnTopBarText" />
<h4>{{ $t('settings.style.advanced_colors.pressed') }}</h4>
<h5>{{ $t('settings.style.advanced_colors.pressed') }}</h5>
<ColorInput
v-model="btnPressedColorLocal"
name="btnPressedColor"
@ -471,7 +471,7 @@
:label="$t('settings.style.advanced_colors.top_bar')"
/>
<ContrastRatio :contrast="previewContrast.btnPressedTopBarText" />
<h4>{{ $t('settings.style.advanced_colors.disabled') }}</h4>
<h5>{{ $t('settings.style.advanced_colors.disabled') }}</h5>
<ColorInput
v-model="btnDisabledColorLocal"
name="btnDisabledColor"
@ -496,7 +496,7 @@
:fallback="previewTheme.colors.btnDisabledTopBarText"
:label="$t('settings.style.advanced_colors.top_bar')"
/>
<h4>{{ $t('settings.style.advanced_colors.toggled') }}</h4>
<h5>{{ $t('settings.style.advanced_colors.toggled') }}</h5>
<ColorInput
v-model="btnToggledColorLocal"
name="btnToggledColor"