Пример #1
0
 public override void RemoveAdditionalForm(Atk.Object obj)
 {
     RunInGuiThread(delegate() {
         Gtk.Window win = (Gtk.Window)mappings [obj];
         win.Hide();
         GailTestApp.MainClass.GiveMeARealButton(true).GrabFocus();
     });
 }
Пример #2
0
 void window_DeleteEvent(object o, Gtk.DeleteEventArgs args)
 {
     if (AutoDispose)
     {
         window.Hide();
         if (window.Modal)
         {
             /*never destroy modal windows automagically*/
         }
         else
         {
             window.Destroy();
         }
         args.RetVal = true; //we handled this event ourselves
     }
     else //dont autodispose
     {
         window.Hide();      //just hide the window
         args.RetVal = true; //we handled this event
     }
 }
Пример #3
0
 internal void HideWidget()
 {
     if (floatingWindow != null)
     {
         floatingWindow.Hide();
     }
     else if (dockBarItem != null)
     {
         dockBarItem.Hide();
     }
     else if (widget != null)
     {
         widget.Hide();
     }
 }
        void HandleWindowStateEvent(object o, Gtk.WindowStateEventArgs args)
        {
            if (args.Event.ChangedMask == Gdk.WindowState.Maximized)
            {
                Gtk.Window wndMax = (Gtk.Window)o;

                Gdk.Rectangle displayRect = wndMax.GdkWindow.FrameExtents;
                wndMax.Hide();

                if (displayRect.Width == 200)
                {
                    int w, h;
                    wndMax.GetSize(out w, out h);
                    System.Threading.Thread.Sleep(0);
                    Gtk.Application.RunIteration();
                    displayRect = wndMax.GdkWindow.FrameExtents;
                }

                Gdk.Rectangle windowRect = Screen.GetMonitorGeometry(Screen.GetMonitorAtPoint(wndMax.Allocation.X, wndMax.Allocation.Y));

                if (displayRect.Width == 200)
                {
                    displayRect.Location = Gdk.Point.Zero;
                    displayRect.Width    = windowRect.Width;
                    displayRect.Height   = windowRect.Height - 32;
                }

                int xLoc = windowRect.Right - BackgroundBitmap.Width - 1;
                int yLoc = windowRect.Bottom - BackgroundBitmap.Height - 1;
                if (displayRect.Right < windowRect.Right)
                {
                    xLoc = displayRect.Right - BackgroundBitmap.Width - 1;
                }
                else if (displayRect.Left > windowRect.Left)
                {
                    xLoc = displayRect.Left + 1;
                }
                if (displayRect.Top > windowRect.Top)
                {
                    yLoc = displayRect.Top + 1;
                }
                else if (displayRect.Bottom < windowRect.Bottom)
                {
                    yLoc = displayRect.Bottom - BackgroundBitmap.Height - 1;
                }

                switch (taskbarState)
                {
                case TaskbarStates.hidden:
                    if (timer != 0)
                    {
                        GLib.Source.Remove(timer);
                        timer = 0;
                    }
                    taskbarState       = TaskbarStates.appearing;
                    Opacity            = 0;
                    this.WidthRequest  = BackgroundBitmap.Width;
                    this.HeightRequest = BackgroundBitmap.Height;
                    this.Move(xLoc, yLoc);
                    timer = GLib.Timeout.Add(nShowEvents, OnTimer);
                    ShowAll();
                    Refresh(true);
                    break;

                case TaskbarStates.appearing:
                    Refresh(true);
                    break;

                case TaskbarStates.visible:
                    if (timer != 0)
                    {
                        GLib.Source.Remove(timer);
                        timer = 0;
                    }
                    if (nVisibleEvents > 0)
                    {
                        timer = GLib.Timeout.Add(nVisibleEvents, OnTimer);
                    }
                    Refresh(true);
                    break;

                case TaskbarStates.disappearing:
                    if (timer != 0)
                    {
                        GLib.Source.Remove(timer);
                        timer = 0;
                    }
                    taskbarState       = TaskbarStates.visible;
                    Opacity            = 1;
                    this.WidthRequest  = BackgroundBitmap.Width;
                    this.HeightRequest = BackgroundBitmap.Height;
                    this.Move(xLoc, yLoc);
                    if (nVisibleEvents > 0)
                    {
                        timer = GLib.Timeout.Add(nVisibleEvents, OnTimer);
                    }
                    Refresh(true);
                    break;
                }
            }
        }