diff options
author | John Molakvoæ <skjnldsv@protonmail.com> | 2023-03-01 09:46:30 +0100 |
---|---|---|
committer | John Molakvoæ <skjnldsv@protonmail.com> | 2023-03-02 07:22:27 +0100 |
commit | 162cc3c8ead4d64e1925cad1f9840eb2346f3d79 (patch) | |
tree | cce789203e6861801ce2d8406b79b5afbf681cc4 /apps/theming/src | |
parent | 7d4cb9a13d77b6e5b8822b50b901feefc5b52240 (diff) | |
download | nextcloud-server-162cc3c8ead4d64e1925cad1f9840eb2346f3d79.tar.gz nextcloud-server-162cc3c8ead4d64e1925cad1f9840eb2346f3d79.zip |
fix(theming): select "no-background" option and fix layout order
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/theming/src')
-rw-r--r-- | apps/theming/src/components/BackgroundSettings.vue | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/apps/theming/src/components/BackgroundSettings.vue b/apps/theming/src/components/BackgroundSettings.vue index 3629ece40d2..b550eca05cf 100644 --- a/apps/theming/src/components/BackgroundSettings.vue +++ b/apps/theming/src/components/BackgroundSettings.vue @@ -33,6 +33,7 @@ tabindex="0" @click="pickFile"> {{ t('theming', 'Custom background') }} + <ImageEdit v-if="backgroundImage !== 'custom'" :size="26" /> <Check :size="44" /> </button> @@ -60,6 +61,17 @@ </button> </NcColorPicker> + <!-- Remove background --> + <button class="background background__delete" + :class="{ 'background--active': isBackgroundDisabled }" + data-user-theming-background-clear + tabindex="0" + @click="removeBackground"> + {{ t('theming', 'No background') }} + <Close v-if="!isBackgroundDisabled" :size="32" /> + <Check :size="44" /> + </button> + <!-- Background set selection --> <button v-for="shippedBackground in shippedBackgrounds" :key="shippedBackground.name" @@ -74,15 +86,6 @@ @click="setShipped(shippedBackground.name)"> <Check :size="44" /> </button> - - <!-- Remove background --> - <button class="background background__delete" - data-user-theming-background-clear - tabindex="0" - @click="removeBackground"> - {{ t('theming', 'Remove background') }} - <Close :size="32" /> - </button> </div> </template> @@ -92,6 +95,7 @@ import { loadState } from '@nextcloud/initial-state' import axios from '@nextcloud/axios' import Check from 'vue-material-design-icons/Check.vue' import Close from 'vue-material-design-icons/Close.vue' +import ImageEdit from 'vue-material-design-icons/ImageEdit.vue' import debounce from 'debounce' import NcColorPicker from '@nextcloud/vue/dist/Components/NcColorPicker' import Vibrant from 'node-vibrant' @@ -118,6 +122,7 @@ export default { components: { Check, Close, + ImageEdit, NcColorPicker, }, @@ -159,6 +164,11 @@ export default { isGlobalBackgroundDeleted() { return themingDefaultBackground === 'backgroundColor' }, + + isBackgroundDisabled() { + return this.backgroundImage === 'disabled' + || !this.backgroundImage + }, }, methods: { @@ -354,14 +364,15 @@ export default { margin: 4px; } - &__filepicker span, - &__default span, - &__shipped span { + .check-icon { display: none; } - &--active:not(.icon-loading) span { - display: block !important; + &--active:not(.icon-loading) { + .check-icon { + // Show checkmark + display: block !important; + } } } } |