예제 #1
0
파일: eventmouse.go 프로젝트: sqp/godock
// OnMouseScroll triggers a dock mouse scroll action on the icon.
//
func OnMouseScroll(icon gldi.Icon, _ *gldi.Container, scrollUp bool) bool {
	switch {
	case icon == nil:

	case icon.IsSeparator(): // Cycle between desktops.
		log.Debug("SeparatorWheelChangeDesktop", confown.Settings.SeparatorWheelChangeDesktop)
		switch confown.Settings.SeparatorWheelChangeDesktop {
		case confown.SeparatorWheelChangeRange:
			desktops.Cycle(scrollUp, false)

		case confown.SeparatorWheelChangeLoop:
			desktops.Cycle(scrollUp, true)
		}
	// SeparatorDesktopLoop   bool

	case icon.IsMultiAppli() || icon.IsStackIcon(): // Cycle between subdock applets list.
		showPrevNextInSubdock(icon, scrollUp)

	case icon.IsAppli() && icon.HasClass():
		next := icon.GetPrevNextClassMateIcon(!scrollUp)
		if next != nil {
			next.Window().Show()
		}
	}
	return notif.AnswerLetPass
}