Skip to content

Commit 162cc3c

Browse files
committed
fix(theming): select "no-background" option and fix layout order
Signed-off-by: John Molakvoæ <[email protected]>
1 parent 7d4cb9a commit 162cc3c

File tree

5 files changed

+31
-20
lines changed

5 files changed

+31
-20
lines changed

apps/theming/src/components/BackgroundSettings.vue

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
tabindex="0"
3434
@click="pickFile">
3535
{{ t('theming', 'Custom background') }}
36+
<ImageEdit v-if="backgroundImage !== 'custom'" :size="26" />
3637
<Check :size="44" />
3738
</button>
3839

@@ -60,6 +61,17 @@
6061
</button>
6162
</NcColorPicker>
6263

64+
<!-- Remove background -->
65+
<button class="background background__delete"
66+
:class="{ 'background--active': isBackgroundDisabled }"
67+
data-user-theming-background-clear
68+
tabindex="0"
69+
@click="removeBackground">
70+
{{ t('theming', 'No background') }}
71+
<Close v-if="!isBackgroundDisabled" :size="32" />
72+
<Check :size="44" />
73+
</button>
74+
6375
<!-- Background set selection -->
6476
<button v-for="shippedBackground in shippedBackgrounds"
6577
:key="shippedBackground.name"
@@ -74,15 +86,6 @@
7486
@click="setShipped(shippedBackground.name)">
7587
<Check :size="44" />
7688
</button>
77-
78-
<!-- Remove background -->
79-
<button class="background background__delete"
80-
data-user-theming-background-clear
81-
tabindex="0"
82-
@click="removeBackground">
83-
{{ t('theming', 'Remove background') }}
84-
<Close :size="32" />
85-
</button>
8689
</div>
8790
</template>
8891

@@ -92,6 +95,7 @@ import { loadState } from '@nextcloud/initial-state'
9295
import axios from '@nextcloud/axios'
9396
import Check from 'vue-material-design-icons/Check.vue'
9497
import Close from 'vue-material-design-icons/Close.vue'
98+
import ImageEdit from 'vue-material-design-icons/ImageEdit.vue'
9599
import debounce from 'debounce'
96100
import NcColorPicker from '@nextcloud/vue/dist/Components/NcColorPicker'
97101
import Vibrant from 'node-vibrant'
@@ -118,6 +122,7 @@ export default {
118122
components: {
119123
Check,
120124
Close,
125+
ImageEdit,
121126
NcColorPicker,
122127
},
123128
@@ -159,6 +164,11 @@ export default {
159164
isGlobalBackgroundDeleted() {
160165
return themingDefaultBackground === 'backgroundColor'
161166
},
167+
168+
isBackgroundDisabled() {
169+
return this.backgroundImage === 'disabled'
170+
|| !this.backgroundImage
171+
},
162172
},
163173
164174
methods: {
@@ -354,14 +364,15 @@ export default {
354364
margin: 4px;
355365
}
356366
357-
&__filepicker span,
358-
&__default span,
359-
&__shipped span {
367+
.check-icon {
360368
display: none;
361369
}
362370
363-
&--active:not(.icon-loading) span {
364-
display: block !important;
371+
&--active:not(.icon-loading) {
372+
.check-icon {
373+
// Show checkmark
374+
display: block !important;
375+
}
365376
}
366377
}
367378
}

dist/core-common.js

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

dist/core-common.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/theming-personal-theming.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/theming-personal-theming.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)