mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-11-03 23:14:13 +00:00 
			
		
		
		
	Refactor analog clock widget (#2648)
This commit is contained in:
		
							parent
							
								
									bf7e19b288
								
							
						
					
					
						commit
						d92e9759f3
					
				
					 1 changed files with 4 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -1,8 +1,8 @@
 | 
			
		|||
<template>
 | 
			
		||||
<div class="mkw-analog-clock">
 | 
			
		||||
	<mk-widget-container :naked="!(props.design % 2)" :show-header="false">
 | 
			
		||||
	<mk-widget-container :naked="props.style % 2 === 0" :show-header="false">
 | 
			
		||||
		<div class="mkw-analog-clock--body">
 | 
			
		||||
			<mk-analog-clock :dark="$store.state.device.darkmode" :smooth="!(props.design && ~props.design)"/>
 | 
			
		||||
			<mk-analog-clock :dark="$store.state.device.darkmode" :smooth="props.style < 2"/>
 | 
			
		||||
		</div>
 | 
			
		||||
	</mk-widget-container>
 | 
			
		||||
</div>
 | 
			
		||||
| 
						 | 
				
			
			@ -13,13 +13,12 @@ import define from '../../../common/define-widget';
 | 
			
		|||
export default define({
 | 
			
		||||
	name: 'analog-clock',
 | 
			
		||||
	props: () => ({
 | 
			
		||||
		design: -1
 | 
			
		||||
		style: 0
 | 
			
		||||
	})
 | 
			
		||||
}).extend({
 | 
			
		||||
	methods: {
 | 
			
		||||
		func() {
 | 
			
		||||
			if (++this.props.design > 2)
 | 
			
		||||
				this.props.design = -1;
 | 
			
		||||
			this.props.style = (this.props.style + 1) % 4;
 | 
			
		||||
			this.save();
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue