Beispiel #1
0
        /// <summary>
        /// Called by owning dock when item is scrolled
        /// </summary>
        /// <param name="direction">
        /// A <see cref="Gdk.ScrollDirection"/>
        /// </param>
        /// <param name="mod">
        /// A <see cref="Gdk.ModifierType"/>
        /// </param>
        public virtual void Scrolled(Gdk.ScrollDirection direction, Gdk.ModifierType mod)
        {
            try {
                OnScrolled(direction, mod);
            } catch (Exception e) {
                Log <AbstractDockItem> .Error(e.Message);

                Log <AbstractDockItem> .Debug(e.StackTrace);
            }
        }
        public override void Scrolled(Gdk.ScrollDirection direction, Gdk.ModifierType mod)
        {
            if (direction == ScrollDirection.Up)
            {
                CurrentPosition--;
            }
            else
            {
                CurrentPosition++;
            }

            ItemChanged();
        }
Beispiel #3
0
        protected override void OnScrolled(Gdk.ScrollDirection direction, Gdk.ModifierType mod)
        {
            int count = ManagedWindows.Count();

            if (count < 1 || (DateTime.UtcNow - last_scroll) < scroll_rate)
            {
                return;
            }

            last_scroll = DateTime.UtcNow;

            // This block will make sure that if we're scrolling on an app that is already active
            // that when we scroll we move on the next window instead of appearing to do nothing
            Wnck.Window focused = ManagedWindows.Where(w => w.IsActive).FirstOrDefault();
            if (focused != null)
            {
                for (; last_raised < count - 1; last_raised++)
                {
                    if (ManagedWindows.ElementAt(last_raised).Pid == focused.Pid)
                    {
                        break;
                    }
                }
            }

            switch (direction)
            {
            case ScrollDirection.Up:
            case ScrollDirection.Right:
                last_raised++;
                break;

            case ScrollDirection.Down:
            case ScrollDirection.Left:
                last_raised--;
                break;
            }

            if (last_raised < 0)
            {
                last_raised = count - 1;
            }
            else if (last_raised >= count)
            {
                last_raised = 0;
            }

            ManagedWindows.ElementAt(last_raised).CenterAndFocusWindow();
        }
Beispiel #4
0
        protected override void OnScrolled(Gdk.ScrollDirection direction, Gdk.ModifierType mod)
        {
            if (WeatherPreferences.Locations.Length <= 1)
            {
                return;
            }

            Status = WeatherDockletStatus.ManualReload;
            State |= ItemState.Wait;
            QueueRedraw();

            if (direction == Gdk.ScrollDirection.Up)
            {
                WeatherController.PreviousLocation();
            }
            else
            {
                WeatherController.NextLocation();
            }
        }
Beispiel #5
0
        protected override void OnScrolled(Gdk.ScrollDirection direction, Gdk.ModifierType mod)
        {
            if (!AreMultipleDesksAvailable || DeskGrid == null)
            {
                return;
            }

            switch (direction)
            {
            case ScrollDirection.Down:
                if (((mod & ModifierType.ShiftMask) == ModifierType.ShiftMask) || DeskGrid.GetLength(1) == 1)
                {
                    SwitchDesk(Wnck.MotionDirection.Right);
                }
                else
                {
                    SwitchDesk(Wnck.MotionDirection.Down);
                }
                break;

            case ScrollDirection.Right:
                SwitchDesk(Wnck.MotionDirection.Right);
                break;

            case ScrollDirection.Up:
                if (((mod & ModifierType.ShiftMask) == ModifierType.ShiftMask) || DeskGrid.GetLength(1) == 1)
                {
                    SwitchDesk(Wnck.MotionDirection.Left);
                }
                else
                {
                    SwitchDesk(Wnck.MotionDirection.Up);
                }
                break;

            case ScrollDirection.Left:
                SwitchDesk(Wnck.MotionDirection.Left);
                break;
            }
        }
Beispiel #6
0
        protected override void OnScrolled(Gdk.ScrollDirection direction, Gdk.ModifierType mod)
        {
            if (direction == Gdk.ScrollDirection.Up)
            {
                curPos++;
            }
            else
            {
                curPos--;
            }

            if (curPos < 1)
            {
                curPos = clips.Count;
            }
            else if (curPos > clips.Count)
            {
                curPos = 1;
            }

            Updated();
        }
Beispiel #7
0
 protected virtual void OnScrolled(Gdk.ScrollDirection direction, Gdk.ModifierType mod)
 {
 }