Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 07df1464 authored by Georg Ehrke's avatar Georg Ehrke
Browse files

Replace ColorIndicator with Checkbox

parent 3961ccab
Loading
Loading
Loading
Loading
+55 −0
Original line number Diff line number Diff line
<!--
  - @copyright Copyright (c) 2019 Georg Ehrke <oc.list@georgehrke.com>
  - @author Georg Ehrke <oc.list@georgehrke.com>
  -
  - @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>
+5 −11
Original line number Diff line number Diff line
@@ -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">
@@ -143,7 +139,6 @@ import {
	ActionInput,
	ActionLink,
	ActionText,
	AppNavigationIconBullet,
	AppNavigationItem,
} from '@nextcloud/vue'
import ClickOutside from 'vue-click-outside'
@@ -151,22 +146,21 @@ 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,