Merge pull request #3142 from janpeterd/master
calendar: add shift_reset action
This commit is contained in:
		
						commit
						3efebc2822
					
				| 
						 | 
				
			
			@ -73,6 +73,7 @@ class Clock final : public ALabel {
 | 
			
		|||
  void cldModeSwitch();
 | 
			
		||||
  void cldShift_up();
 | 
			
		||||
  void cldShift_down();
 | 
			
		||||
  void cldShift_reset();
 | 
			
		||||
  void tz_up();
 | 
			
		||||
  void tz_down();
 | 
			
		||||
  // Module Action Map
 | 
			
		||||
| 
						 | 
				
			
			@ -80,6 +81,7 @@ class Clock final : public ALabel {
 | 
			
		|||
      {"mode", &waybar::modules::Clock::cldModeSwitch},
 | 
			
		||||
      {"shift_up", &waybar::modules::Clock::cldShift_up},
 | 
			
		||||
      {"shift_down", &waybar::modules::Clock::cldShift_down},
 | 
			
		||||
      {"shift_reset", &waybar::modules::Clock::cldShift_reset},
 | 
			
		||||
      {"tz_up", &waybar::modules::Clock::tz_up},
 | 
			
		||||
      {"tz_down", &waybar::modules::Clock::tz_down}};
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -423,6 +423,9 @@ void waybar::modules::Clock::cldShift_up() {
 | 
			
		|||
void waybar::modules::Clock::cldShift_down() {
 | 
			
		||||
  cldCurrShift_ -= (months)((cldMode_ == CldMode::YEAR) ? 12 : 1) * cldShift_;
 | 
			
		||||
}
 | 
			
		||||
void waybar::modules::Clock::cldShift_reset() {
 | 
			
		||||
  cldCurrShift_ = (months)0;
 | 
			
		||||
}
 | 
			
		||||
void waybar::modules::Clock::tz_up() {
 | 
			
		||||
  const auto tzSize{tzList_.size()};
 | 
			
		||||
  if (tzSize == 1) return;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue