Ejemplo n.º 1
0
        private void SaveUserSettings()
        {
            dock.SaveLayouts(System.IO.Path.Combine(PintaCore.Settings.GetUserSettingsDirectory(), "layouts.xml"));

            // Don't store the maximized height if the window is maximized
            if ((window_shell.GdkWindow.State & Gdk.WindowState.Maximized) == 0)
            {
                PintaCore.Settings.PutSetting("window-size-width", window_shell.GdkWindow.GetSize().Width);
                PintaCore.Settings.PutSetting("window-size-height", window_shell.GdkWindow.GetSize().Height);
            }

            var ruler_metric = MetricType.Pixels;

            if (PintaCore.Actions.View.Inches.Active)
            {
                ruler_metric = MetricType.Inches;
            }
            else if (PintaCore.Actions.View.Centimeters.Active)
            {
                ruler_metric = MetricType.Centimeters;
            }

            PintaCore.Settings.PutSetting("ruler-metric", (int)ruler_metric);
            PintaCore.Settings.PutSetting("window-maximized", (window_shell.GdkWindow.State & Gdk.WindowState.Maximized) != 0);
            PintaCore.Settings.PutSetting("ruler-shown", PintaCore.Actions.View.Rulers.Active);
            PintaCore.Settings.PutSetting("toolbar-shown", PintaCore.Actions.View.ToolBar.Active);
            PintaCore.Settings.PutSetting("pixel-grid-shown", PintaCore.Actions.View.PixelGrid.Active);
            PintaCore.Settings.PutSetting(LastDialogDirSettingKey, PintaCore.System.LastDialogDirectory);

            PintaCore.Settings.SaveSettings();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Saves the current window components layout and their last changed state.
        /// </summary>
        ///
        private void SaveLayout()
        {
            // Save all loaded plugins
            plugins.SavePluginsToFile(pluginsFile);

            File.Delete(layoutFile);
            File.Create(layoutFile).Close();
            dockFrame.SaveLayouts(layoutFile);
        }
Ejemplo n.º 3
0
    void CreateComponents()
    {
        fullViewVBox = new VBox(false, 0);
        rootWidget   = fullViewVBox;

        CreateMenuBar();

        CreateToolBar();

        // Create the docking widget and add it to the window.
        dock                   = new DockFrame();
        dock.Homogeneous       = false;
        dock.DefaultItemHeight = 100;
        dock.DefaultItemWidth  = 100;
        //dock.CompactGuiLevel = 1;

        toolbarFrame.AddContent(dock);

        // Create the notebook for the various documents.
        tabControl            = new DragNotebook(); //(dock.ShadedContainer);
        tabControl.Scrollable = true;
        tabControl.AppendPage(new Label("Other page"), new Label("Favorite Page  "));
        tabControl.AppendPage(new Label("What page"), new Label("Welcome/Start Page  "));
        tabControl.AppendPage(new TextView(), new Image("gtk-new", IconSize.Menu));
        tabControl.ShowAll();

        // The main document area
        documentDockItem                 = dock.AddItem("Documents");
        documentDockItem.Behavior        = DockItemBehavior.Locked;
        documentDockItem.Status          = DockItemStatus.AutoHide;
        documentDockItem.DefaultHeight   = 100;
        documentDockItem.DefaultWidth    = 100;
        documentDockItem.DefaultStatus   = DockItemStatus.AutoHide;
        documentDockItem.DefaultLocation = "Document/Right";
        documentDockItem.Expand          = true;
        documentDockItem.DrawFrame       = true;
        documentDockItem.Label           = "Documents";
        documentDockItem.Content         = tabControl;
        documentDockItem.DefaultVisible  = true;
        documentDockItem.Visible         = true;


        DockItem dit = dock.AddItem("left");

        dit.Status          = DockItemStatus.AutoHide;
        dit.DefaultHeight   = 100;
        dit.DefaultWidth    = 100;
        dit.DefaultStatus   = DockItemStatus.AutoHide;
        dit.DefaultLocation = "left";
        dit.Behavior        = DockItemBehavior.Normal;
        dit.Label           = "Left";
        dit.DefaultVisible  = true;
        dit.Visible         = true;
        DockItemToolbar tb = dit.GetToolbar(PositionType.Top);
        ToolButton      b  = new ToolButton(null, "Hello");

        tb.Add(b, false);
        tb.Visible = true;
        tb.ShowAll();

        dit                 = dock.AddItem("right");
        dit.Status          = DockItemStatus.AutoHide;
        dit.DefaultHeight   = 100;
        dit.DefaultWidth    = 100;
        dit.DefaultStatus   = DockItemStatus.AutoHide;
        dit.DefaultLocation = "Documents/Right";
        dit.Behavior        = DockItemBehavior.Normal;
        dit.Label           = "Right";
        dit.DefaultVisible  = true;
        dit.Visible         = true;
        //dit.Icon = Gdk.Pixbuf.LoadFromResource("Cage.Shell.Docking.stock-close-12.png");

        dit                 = dock.AddItem("top");
        dit.Status          = DockItemStatus.AutoHide;
        dit.DefaultHeight   = 100;
        dit.DefaultWidth    = 100;
        dit.DefaultStatus   = DockItemStatus.AutoHide;
        dit.DefaultLocation = "Documents/Top";
        dit.Behavior        = DockItemBehavior.Normal;
        dit.Label           = "Top";
        dit.DefaultVisible  = true;
        dit.Visible         = true;

        dit                 = dock.AddItem("bottom");
        dit.Status          = DockItemStatus.AutoHide;
        dit.DefaultHeight   = 100;
        dit.DefaultWidth    = 100;
        dit.DefaultStatus   = DockItemStatus.AutoHide;
        dit.DefaultLocation = "Documents/Bottom";
        dit.Behavior        = DockItemBehavior.Normal;
        dit.Label           = "Bottom";
        dit.DefaultVisible  = true;
        dit.Visible         = true;



        if (File.Exists("toolbar.status"))
        {
            toolbarFrame.LoadStatus("toolbar.status");
        }

        if (File.Exists("config.layout"))
        {
            dock.LoadLayouts("config.layout");
        }
        else
        {
            dock.CreateLayout("test", true);
        }


        dock.CurrentLayout = "test";
        dock.HandlePadding = 0;
        dock.HandleSize    = 10;

        dock.SaveLayouts("config.layout");
        toolbarFrame.SaveStatus("toolbar.status");

        Add(fullViewVBox);
        fullViewVBox.ShowAll();

        statusBar = new Gtk.Statusbar();
        fullViewVBox.PackEnd(statusBar, false, true, 0);
    }
Ejemplo n.º 4
0
 public void onButtonPressEvent(object sender, EventArgs args)
 {
     dock.SaveLayouts("config.layout");
     toolbarFrame.SaveStatus("toolbar.status");
     Gtk.Application.Quit();
 }