コード例 #1
0
        private void RefreshThumbnails()
        {
            IntPtr  foregroundWindowHandle = WindowManagerNativeMethods.GetForegroundWindow();
            Boolean hideAllThumbnails      = (this._configuration.HideThumbnailsOnLostFocus && this.IsNonClientWindowActive(foregroundWindowHandle)) || !WindowManagerNativeMethods.DwmIsCompositionEnabled();

            this.DisableViewEvents();

            // Hide, show, resize and move
            foreach (KeyValuePair <IntPtr, IThumbnailView> entry in this._thumbnailViews)
            {
                IThumbnailView view = entry.Value;

                if (hideAllThumbnails || !view.IsEnabled)
                {
                    if (view.IsActive)
                    {
                        view.Hide();
                    }
                    continue;
                }

                if (this._configuration.HideActiveClientThumbnail && (view.Id == this._activeClientHandle))
                {
                    if (view.IsActive)
                    {
                        view.Hide();
                    }
                    continue;
                }

                // No need to update Thumbnails while one of them is highlighted
                if (!this._isHoverEffectActive)
                {
                    // Do not even move thumbnails with default caption
                    if (view.Title != ThumbnailManager.DefaultClientTitle)
                    {
                        view.ThumbnailLocation = this._configuration.GetThumbnailLocation(view.Title, this._activeClientTitle, view.ThumbnailLocation);
                    }

                    view.SetOpacity(this._configuration.ThumbnailOpacity);
                    view.SetTopMost(this._configuration.ShowThumbnailsAlwaysOnTop);
                }

                view.IsOverlayEnabled = this._configuration.ShowThumbnailOverlays;

                view.SetHighlight(this._configuration.EnableActiveClientHighlight && (view.Id == this._activeClientHandle),
                                  this._configuration.ActiveClientHighlightColor, this._configuration.ActiveClientHighlightThickness);

                if (!view.IsActive)
                {
                    view.Show();
                }
                else
                {
                    view.Refresh(false);
                }
            }

            this.EnableViewEvents();
        }
コード例 #2
0
        private void ThumbnailZoomOut(IThumbnailView view)
        {
            this.DisableViewEvents();

            view.ZoomOut();
            view.Refresh(false);

            this.EnableViewEvents();
        }
コード例 #3
0
        private void ThumbnailZoomIn(IThumbnailView view)
        {
            this.DisableViewEvents();

            view.ZoomIn(ViewZoomAnchorConverter.Convert(this._configuration.ThumbnailZoomAnchor), this._configuration.ThumbnailZoomFactor);
            view.Refresh(false);

            this.EnableViewEvents();
        }
コード例 #4
0
        public void RefreshThumbnails()
        {
            IntPtr  foregroundWindowHandle = DwmApiNativeMethods.GetForegroundWindow();
            Boolean hideAllThumbnails      = (this._configuration.HideThumbnailsOnLostFocus && this.IsNonClientWindowActive(foregroundWindowHandle)) || !DwmApiNativeMethods.DwmIsCompositionEnabled();

            this.DisableViewEvents();

            // Hide, show, resize and move
            foreach (KeyValuePair <IntPtr, IThumbnailView> entry in this._thumbnailViews)
            {
                IThumbnailView view = entry.Value;

                if (hideAllThumbnails || !view.IsEnabled)
                {
                    if (view.IsActive)
                    {
                        view.Hide();
                    }
                    continue;
                }

                if (this._configuration.HideActiveClientThumbnail && (view.Id == this._activeClientHandle))
                {
                    if (view.IsActive)
                    {
                        view.Hide();
                    }
                    continue;
                }

                if (!this._isHoverEffectActive)
                {
                    // No need to move Thumbnails while one of them is highlighted
                    view.ThumbnailLocation = this._configuration.GetThumbnailLocation(view.Title, this._activeClientTitle, view.ThumbnailLocation);
                    view.SetOpacity(this._configuration.ThumbnailsOpacity);
                    view.SetTopMost(this._configuration.ShowThumbnailsAlwaysOnTop);
                }

                view.IsOverlayEnabled = this._configuration.ShowThumbnailOverlays;

                if (!view.IsActive)
                {
                    view.Show();
                }
                else
                {
                    view.Refresh(false);
                }
            }

            this.EnableViewEvents();
        }
コード例 #5
0
        private void ThumbnailViewMoved(IntPtr id)
        {
            if (this._ignoreViewEvents)
            {
                return;
            }

            IThumbnailView view = this._thumbnailViews[id];

            this._configuration.SetThumbnailLocation(view.Title, this._activeClientTitle, view.ThumbnailLocation);

            view.Refresh(false);
        }
コード例 #6
0
        private void ThumbnailViewResized(IntPtr id)
        {
            if (this._ignoreViewEvents)
            {
                return;
            }

            IThumbnailView view = this._thumbnailViews[id];

            this.SetThumbnailsSize(view.ThumbnailSize);

            view.Refresh(false);
        }