示例#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
}