예제 #1
0
파일: TabStrip.cs 프로젝트: ywscr/Pinta
        void OnTabPress(object s, Gtk.ButtonPressEventArgs args)
        {
            CurrentTab = Array.IndexOf(box.Children, s);
            DockItemTitleTab t = (DockItemTitleTab)s;

            DockItem.SetFocus(t.Page);
            QueueDraw();
            args.RetVal = true;
        }
예제 #2
0
 public void Present(bool giveFocus)
 {
     AutoShow();
     if (giveFocus)
     {
         GLib.Timeout.Add(200, delegate {
             // Using a small delay because AutoShow uses an animation and setting focus may
             // not work until the item is visible
             if (autoShowFrame != null && autoShowFrame.ContainerWindow != null && autoShowFrame.ContainerWindow != (Gtk.Window)Toplevel)
             {
                 autoShowFrame.ContainerWindow.Present();
             }
             it.SetFocus();
             ScheduleAutoHide(false);
             return(false);
         });
     }
 }
예제 #3
0
파일: DockFrame.cs 프로젝트: ywscr/Pinta
        bool LoadLayout(string layoutName)
        {
            DockLayout dl;

            if (!layouts.TryGetValue(layoutName, out dl))
            {
                return(false);
            }

            var focus = GetActiveWidget();

            container.LoadLayout(dl);

            // Keep the currently focused widget when switching layouts
            if (focus != null && focus.IsRealized && focus.Visible)
            {
                DockItem.SetFocus(focus);
            }

            return(true);
        }
예제 #4
0
파일: DockGroup.cs 프로젝트: msiyer/Pinta
		internal void Present (DockItem it, bool giveFocus)
		{
			if (type == DockGroupType.Tabbed) {
				for (int n=0; n<VisibleObjects.Count; n++) {
					DockGroupItem dit = VisibleObjects[n] as DockGroupItem;
					if (dit.Item == it) {
						currentTabPage = n;
						if (boundTabStrip != null)
							boundTabStrip.CurrentPage = it.Widget;
						break;
					}
				}
			}
			if (giveFocus && it.Visible)
				it.SetFocus ();
		}