Example #1
0
		public DockWindow () : base (Gtk.WindowType.Toplevel)
		{
			allWindows.Add (this);

			notebook = new DockNotebook ();
			notebook.NavigationButtonsVisible = false;
			Child = new DockNotebookContainer (notebook);
			notebook.InitSize ();
		}
Example #2
0
        public DockWindow() : base(Gtk.WindowType.Toplevel)
        {
            allWindows.Add(this);

            notebook = new DockNotebook();
            notebook.NavigationButtonsVisible = false;
            Child = new DockNotebookContainer(notebook);
            notebook.InitSize();
        }
Example #3
0
        public DockNotebook InsertLeft(SdiWorkspaceWindow window)
        {
            return(Insert(window, container => {
                var box = new HPanedThin {
                    GrabAreaSize = 6
                };
                var new_container = new DockNotebookContainer(tabControl);

                box.Pack1(container, true, true);
                box.Pack2(new_container, true, true);
                Child = box;
            }));
        }
Example #4
0
        public DockNotebook InsertRight(SdiWorkspaceWindow window)
        {
            return(Insert(window, container => {
                var box = new HPanedThin()
                {
                    GrabAreaSize = 6
                };
                var new_container = new DockNotebookContainer(tabControl);

                box.Pack1(new_container, true, true);
                box.Pack2(container, true, true);
                box.Position = Allocation.Width / 2;
                Child = box;
            }));
        }
Example #5
0
		public void Initialize (DockFrame workspace, Menu padMenu)
		{
            var tab = new DockNotebook () {
                NavigationButtonsVisible = false
            };

            NotebookContainer = new DockNotebookContainer (tab, true);

            tab.InitSize ();

            var canvas_dock = workspace.AddItem ("Canvas");
            canvas_dock.Behavior = DockItemBehavior.Locked;
            canvas_dock.Expand = true;

            canvas_dock.DrawFrame = false;
            canvas_dock.Label = Catalog.GetString ("Canvas");
            canvas_dock.Content = NotebookContainer;
        }
Example #6
0
        DockNotebook Insert(SdiWorkspaceWindow window, Action <DockNotebookContainer> callback)
        {
            var newNotebook = new DockNotebook();

            newNotebook.NavigationButtonsVisible = false;
            newNotebook.InitSize();
            var newContainer = new DockNotebookContainer(newNotebook);

            newNotebook.PageRemoved += HandlePageRemoved;

            if (window != null)
            {
                var newTab = newNotebook.AddTab(window);
                window.SetDockNotebook(newNotebook, newTab);
            }
            Remove(Child);

            callback(newContainer);

            tabControl.InitSize();
            ShowAll();
            return(newNotebook);
        }
Example #7
0
		public DockNotebook InsertRight (SdiWorkspaceWindow window)
		{
			return Insert (window, container => {
				var box = new HPanedThin () { GrabAreaSize = 6 };
				var new_container = new DockNotebookContainer (tabControl);

				box.Pack1 (new_container, true, true);
				box.Pack2 (container, true, true);
				box.Position = Allocation.Width / 2;
				Child = box;
			});
		}
Example #8
0
		public DockNotebook InsertLeft (SdiWorkspaceWindow window)
		{
			return Insert (window, container => {
				var box = new HPanedThin { GrabAreaSize = 6 };
				var new_container = new DockNotebookContainer (tabControl);

				box.Pack1 (container, true, true);
				box.Pack2 (new_container, true, true);
				Child = box;
			});
		}
Example #9
0
		DockNotebook Insert (SdiWorkspaceWindow window, Action<DockNotebookContainer> callback)
		{
			var newNotebook = new DockNotebook ();

			newNotebook.NavigationButtonsVisible = false;
			newNotebook.InitSize ();
			var newContainer = new DockNotebookContainer (newNotebook);
			newNotebook.PageRemoved += HandlePageRemoved;

			if (window != null) {
				var newTab = newNotebook.AddTab (window);
				window.SetDockNotebook (newNotebook, newTab);
			}
			Remove (Child);

			callback (newContainer);

			tabControl.InitSize ();
			ShowAll ();
			return newNotebook;
		}
Example #10
0
 internal static void RemoveContainer (DockNotebookContainer container)
 {
     all_containers.Remove (container);
 }
Example #11
0
 internal static void AddContainer (DockNotebookContainer container)
 {
     all_containers.Add (container);
 }
Example #12
0
 internal static void RemoveContainer(DockNotebookContainer container)
 {
     all_containers.Remove(container);
 }
Example #13
0
 internal static void AddContainer(DockNotebookContainer container)
 {
     all_containers.Add(container);
 }
Example #14
0
		private void CreateDockAndPads (HBox container)
		{
			Gtk.IconFactory fact = new Gtk.IconFactory ();
			fact.Add ("Tools.Pencil.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Tools.Pencil.png")));
			fact.Add ("Pinta.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Pinta.png")));
			fact.AddDefault ();

			// Dock widget
			dock = new DockFrame ();
			dock.CompactGuiLevel = 5;

            var style = new DockVisualStyle ();
            style.PadTitleLabelColor = Styles.PadLabelColor;
            style.PadBackgroundColor = Styles.PadBackground;
            style.InactivePadBackgroundColor = Styles.InactivePadBackground;
            style.TabStyle = DockTabStyle.Normal;
            style.ShowPadTitleIcon = false;
            dock.DefaultVisualStyle = style;

			// Toolbox pad
			var toolboxpad = new ToolBoxPad ();
			toolboxpad.Initialize (dock, show_pad);
		
			// Palette pad
			var palettepad = new ColorPalettePad ();
			palettepad.Initialize (dock, show_pad);

			// Canvas pad
			canvas_pad = new CanvasPad ();
			canvas_pad.Initialize (dock, show_pad);

            dock_container = canvas_pad.NotebookContainer;

			// Layer pad
			var layers_pad = new LayersPad ();
			layers_pad.Initialize (dock, show_pad);

			// Open Images pad
			var open_images_pad = new OpenImagesPad ();
			open_images_pad.Initialize (dock, show_pad);

			// History pad
			var history_pad = new HistoryPad ();
			history_pad.Initialize (dock, show_pad);

			container.PackStart (dock, true, true, 0);
			
			string layout_file = PintaCore.Settings.LayoutFilePath;

            if (System.IO.File.Exists(layout_file))
            {
                try
                {
                    dock.LoadLayouts(layout_file);
                }
                // If parsing layouts.xml fails for some reason, proceed to create the default layout.
                catch (Exception e)
                {
                    System.Console.Error.WriteLine ("Error reading " + PintaCore.Settings.LayoutFile + ": " + e.ToString());
                }
            }
			
			if (!dock.HasLayout ("Default"))
				dock.CreateLayout ("Default", false);
				
			dock.CurrentLayout = "Default";
		}