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
28 changes: 20 additions & 8 deletions apps/weather_status/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@
{{ locationText }}
</NcActionLink>
<NcActionButton v-if="gotWeather"
:icon="addRemoveFavoriteIcon"
:aria-hidden="true"
@click="onAddRemoveFavoriteClick">
<template #icon>
<component :is="addRemoveFavoriteIcon" :size="20" class="favorite-color" />
</template>
{{ addRemoveFavoriteText }}
</NcActionButton>
<NcActionSeparator v-if="address && !errorMessage" />
Expand All @@ -68,12 +70,14 @@
@click="showFavorites = !showFavorites">
{{ t('weather_status', 'Favorites') }}
</NcActionButton>
<NcActionButton v-for="f in displayedFavorites"
:key="f"
icon="icon-starred"
<NcActionButton v-for="favorite in displayedFavorites"
:key="favorite"
:aria-hidden="true"
@click="onFavoriteClick($event, f)">
{{ f }}
@click="onFavoriteClick($event, favorite)">
<template #icon>
<IconStar :size="20" :class="{'favorite-color': address === favorite}" />
</template>
{{ favorite }}
</NcActionButton>
</NcActions>
</div>
Expand All @@ -84,6 +88,8 @@
import { showError } from '@nextcloud/dialogs'
import moment from '@nextcloud/moment'
import { getLocale } from '@nextcloud/l10n'
import IconStar from 'vue-material-design-icons/Star.vue'
import IconStarOutline from 'vue-material-design-icons/StarOutline.vue'
import NcActions from '@nextcloud/vue/dist/Components/NcActions.js'
import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js'
import NcActionInput from '@nextcloud/vue/dist/Components/NcActionInput.js'
Expand Down Expand Up @@ -202,6 +208,7 @@ const weatherOptions = {
export default {
name: 'App',
components: {
IconStar,
NcActions,
NcActionButton,
NcActionInput,
Expand Down Expand Up @@ -289,8 +296,8 @@ export default {
},
addRemoveFavoriteIcon() {
return this.currentAddressIsFavorite
? 'icon-starred'
: 'icon-star'
? IconStar
: IconStarOutline
},
addRemoveFavoriteText() {
return this.currentAddressIsFavorite
Expand Down Expand Up @@ -602,6 +609,11 @@ export default {
min-height: 44px !important;
}

// Set color to primary element for current / active favorite address
.favorite-color {
color: #a08b00;
}

li:not(.inline) .weather-status-menu-item {
&__header {
display: block;
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/files-sidebar.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-sidebar.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/settings-apps-view-7418.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-apps-view-7418.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/settings-vue-settings-apps-users-management.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-vue-settings-apps-users-management.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/weather_status-weather-status.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/weather_status-weather-status.js.map

Large diffs are not rendered by default.