Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace ColorIndicator with Checkbox #1616

Closed
wants to merge 1 commit into from
Closed
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<!--
- @copyright Copyright (c) 2019 Georg Ehrke <[email protected]>
- @author Georg Ehrke <[email protected]>
-
- @license GNU AGPL version 3 or any later version
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-->

<template>
<svg
v-if="enabled"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 500 500"
height="32px"
width="32px">
<path d="M354.24 98H145.76c-25.54 0-46.44 20.9-46.44 46.44v211.12c0 25.54 20.9 46.44 46.44 46.44h208.47c25.54 0 46.44-20.9 46.44-46.44V144.44C400.68 118.9 379.78 98 354.24 98zM224.57 338.56l-84.59-87.23 27.93-26.71 56.66 58.43 107.31-109.42 27.51 27.47-134.82 137.46z" :fill="color" />
</svg>
<svg
v-else
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 500 500"
height="32px"
width="32px">
<path d="M354.24 98H145.76c-25.54 0-46.44 20.9-46.44 46.44v211.12c0 25.54 20.9 46.44 46.44 46.44h208.47c25.54 0 46.44-20.9 46.44-46.44V144.44C400.68 118.9 379.78 98 354.24 98zm10.75 268.28H135.01V133.72h229.98v232.56z" :fill="color" />
</svg>
</template>

<script>
export default {
name: 'AppNavigationColoredCheckbox',
props: {
color: {
type: String,
required: true,
},
enabled: {
type: Boolean,
required: true,
},
},
}
</script>
16 changes: 5 additions & 11 deletions src/components/AppNavigation/CalendarList/CalendarListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,11 @@
:title="calendar.displayName || $t('calendar', 'Untitled calendar')"
:class="{deleted: !!deleteTimeout, disabled: !calendar.enabled, 'open-sharing': shareMenuOpen}"
@click.prevent.stop="toggleEnabled">
<AppNavigationIconBullet
v-if="calendar.enabled"
<AppNavigationColoredCheckbox
slot="icon"
:enabled="calendar.enabled"
:color="calendar.color"
@click.prevent.stop="toggleEnabled" />
<AppNavigationDisabledCalendarIconBullet
v-if="!calendar.enabled"
slot="icon"
@click.prevent.stop="toggleEnabled" />
@click="toggleEnabled" />

<template v-if="!deleteTimeout" slot="counter">
<Actions v-if="showSharingIcon">
Expand Down Expand Up @@ -143,30 +139,28 @@ import {
ActionInput,
ActionLink,
ActionText,
AppNavigationIconBullet,
AppNavigationItem,
} from '@nextcloud/vue'
import ClickOutside from 'vue-click-outside'
import {
generateRemoteUrl,
} from '@nextcloud/router'

import AppNavigationDisabledCalendarIconBullet from './AppNavigationDisabledCalendarIconBullet.vue'
import CalendarListItemSharingSearch from './CalendarListItemSharingSearch.vue'
import CalendarListItemSharingPublishItem from './CalendarListItemSharingPublishItem.vue'
import CalendarListItemSharingShareItem from './CalendarListItemSharingShareItem.vue'
import AppNavigationColoredCheckbox from './AppNavigationColoredCheckbox.vue'

export default {
name: 'CalendarListItem',
components: {
AppNavigationColoredCheckbox,
Avatar,
Actions,
ActionButton,
ActionInput,
ActionLink,
ActionText,
AppNavigationDisabledCalendarIconBullet,
AppNavigationIconBullet,
AppNavigationItem,
CalendarListItemSharingSearch,
CalendarListItemSharingPublishItem,
Expand Down