Ejemplo n.º 1
0
        void ShowPlaceholder(DockToolbar bar, bool horz, int x, int y, int w, int h)
        {
            if (orientation != Orientation.Horizontal)
            {
                horz = !horz;
            }

            PanelToWindow(x, y, w, h, out x, out y, out w, out h);

            bool created = false;

            if (placeholder == null || horz != currentPlaceholderHorz)
            {
                HidePlaceholder();
                placeholder            = new PlaceholderWindow(parentFrame);
                placeholderArrow1      = new ArrowWindow(parentFrame, horz ? ArrowWindow.Direction.Right : ArrowWindow.Direction.Down);
                placeholderArrow2      = new ArrowWindow(parentFrame, horz ? ArrowWindow.Direction.Left : ArrowWindow.Direction.Up);
                currentPlaceholderHorz = horz;
                created = true;
            }

            int sx, sy;

            this.GdkWindow.GetOrigin(out sx, out sy);
            sx += x;
            sy += y;

            int mg = -4;

            placeholder.Move(sx - mg, sy - mg);
            placeholder.Resize(w + mg * 2, h + mg * 2);

            if (horz)
            {
                placeholderArrow1.Move(sx - placeholderArrow1.Width, sy + (h / 2) - placeholderArrow1.Height / 2);
                placeholderArrow2.Move(sx + w, sy + (h / 2) - placeholderArrow1.Height / 2);
            }
            else
            {
                int px = sx + w / 2 - placeholderArrow1.Width / 2;
                if (px < 0)
                {
                    px = 0;
                }
                placeholderArrow1.Move(px, sy - placeholderArrow1.Height);
                placeholderArrow2.Move(px, sy + h);
            }

            if (created)
            {
                placeholder.Show();
                placeholder.Present();
                if (bar.FloatingDock != null)
                {
                    bar.FloatingDock.Present();
                }
                placeholderArrow1.Present();
                placeholderArrow2.Present();
            }
        }
Ejemplo n.º 2
0
        void HidePlaceholder()
        {
            if (placeholder == null)
            {
                return;
            }
            placeholder.Destroy();
            placeholder = null;
            placeholderArrow1.Destroy();
            placeholderArrow1 = null;
            placeholderArrow2.Destroy();
            placeholderArrow2 = null;

            if (dropRow != -1 && !dropNewRow)
            {
                RestoreShiftedBars(dropRow);
                dropRow = -1;
            }
        }
		void HidePlaceholder ()
		{
			if (placeholder == null) return;
			placeholder.Destroy ();
			placeholder = null;
			placeholderArrow1.Destroy ();
			placeholderArrow1 = null;
			placeholderArrow2.Destroy ();
			placeholderArrow2 = null;

			if (dropRow != -1 && !dropNewRow) {
				RestoreShiftedBars (dropRow);
				dropRow = -1;
			}
		}
		void ShowPlaceholder (DockToolbar bar, bool horz, int x, int y, int w, int h)
		{
			if (orientation != Orientation.Horizontal)
				horz = !horz;
			
			PanelToWindow (x, y, w, h, out x, out y, out w, out h);
			
			bool created = false;
			
			if (placeholder == null || horz != currentPlaceholderHorz) {
				HidePlaceholder ();
				placeholder = new PlaceholderWindow (parentFrame);
				placeholderArrow1 = new ArrowWindow (parentFrame, horz ? ArrowWindow.Direction.Right : ArrowWindow.Direction.Down);
				placeholderArrow2 = new ArrowWindow (parentFrame, horz ? ArrowWindow.Direction.Left : ArrowWindow.Direction.Up);
				currentPlaceholderHorz = horz;
				created = true;
			}
			
			int sx, sy;
			this.GdkWindow.GetOrigin (out sx, out sy);
			sx += x;
			sy += y;
			
			int mg = -4;
			placeholder.Move (sx - mg, sy - mg);
			placeholder.Resize (w + mg*2, h + mg * 2);
			
			if (horz) {
				placeholderArrow1.Move (sx - placeholderArrow1.Width, sy + (h/2) - placeholderArrow1.Height/2);
				placeholderArrow2.Move (sx + w, sy + (h/2) - placeholderArrow1.Height/2);
			} else {
				int px = sx + w/2 - placeholderArrow1.Width/2;
				if (px < 0) px = 0;
				placeholderArrow1.Move (px, sy - placeholderArrow1.Height);
				placeholderArrow2.Move (px, sy + h);
			}
			
			if (created) {
				placeholder.Show ();
				placeholder.Present ();
				if (bar.FloatingDock != null)
					bar.FloatingDock.Present ();
				placeholderArrow1.Present ();
				placeholderArrow2.Present ();
			}
		}