Skip to content

Commit

Permalink
fix(theming): select "no-background" option and fix layout order
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed Mar 1, 2023
1 parent 8657c93 commit 92f8283
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 20 deletions.
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" />
</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
Loading

0 comments on commit 92f8283

Please sign in to comment.