Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
39 changes: 25 additions & 14 deletions apps/theming/src/components/BackgroundSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
tabindex="0"
@click="pickFile">
{{ t('theming', 'Custom background') }}
<ImageEdit v-if="backgroundImage !== 'custom'" :size="26" />
<Check :size="44" />
</button>

Expand Down Expand Up @@ -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" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason you used css instead v-else ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't recall 🤷
I think it was like that before, and I left it when I switched from icon-confirm to the Check vue component
This is not related tot his PR anyway :)

</button>

<!-- Background set selection -->
<button v-for="shippedBackground in shippedBackgrounds"
:key="shippedBackground.name"
Expand All @@ -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>

Expand All @@ -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'
Expand All @@ -118,6 +122,7 @@ export default {
components: {
Check,
Close,
ImageEdit,
NcColorPicker,
},

Expand Down Expand Up @@ -159,6 +164,11 @@ export default {
isGlobalBackgroundDeleted() {
return themingDefaultBackground === 'backgroundColor'
},

isBackgroundDisabled() {
return this.backgroundImage === 'disabled'
|| !this.backgroundImage
},
},

methods: {
Expand Down Expand Up @@ -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;
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions dist/core-common.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-common.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/theming-personal-theming.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/theming-personal-theming.js.map

Large diffs are not rendered by default.