Beispiel #1
0
        public void Initialize(Dock workspace, Application app, GLib.Menu padMenu)
        {
            var      history      = new HistoryTreeView();
            DockItem history_item = new DockItem(history, "History")
            {
                Label = Translations.GetString("History")
            };

            // TODO-GTK3 (docking)
#if false
            history_item.DefaultLocation = "Images/Bottom";
            history_item.Icon            = Gtk.IconTheme.Default.LoadIcon(Resources.Icons.LayerDuplicate, 16);
            history_item.DefaultWidth    = 100;
            history_item.Behavior       |= DockItemBehavior.CantClose;
#endif
            var history_tb = history_item.AddToolBar();
            history_tb.Add(PintaCore.Actions.Edit.Undo.CreateDockToolBarItem());
            history_tb.Add(PintaCore.Actions.Edit.Redo.CreateDockToolBarItem());

            workspace.AddItem(history_item, DockPlacement.Right);

            var show_history = new ToggleCommand("history", Translations.GetString("History"), null, Resources.Icons.LayerDuplicate)
            {
                Value = true
            };
            app.AddAction(show_history);
            padMenu.AppendItem(show_history.CreateMenuItem());

            show_history.Toggled += (val) => { history_item.Visible = val; };
            history_item.VisibilityNotifyEvent += (o, args) => { show_history.Value = history_item.Visible; };
        }
Beispiel #2
0
        public void Initialize(Dock workspace, Application app, GLib.Menu padMenu)
        {
            var      layers      = new LayersListWidget();
            DockItem layers_item = new DockItem(layers, "Layers")
            {
                Label = Translations.GetString("Layers")
            };

            var layers_tb = layers_item.AddToolBar();

            layers_tb.Add(PintaCore.Actions.Layers.AddNewLayer.CreateDockToolBarItem());
            layers_tb.Add(PintaCore.Actions.Layers.DeleteLayer.CreateDockToolBarItem());
            layers_tb.Add(PintaCore.Actions.Layers.DuplicateLayer.CreateDockToolBarItem());
            layers_tb.Add(PintaCore.Actions.Layers.MergeLayerDown.CreateDockToolBarItem());
            layers_tb.Add(PintaCore.Actions.Layers.MoveLayerUp.CreateDockToolBarItem());
            layers_tb.Add(PintaCore.Actions.Layers.MoveLayerDown.CreateDockToolBarItem());

            // TODO-GTK3 (docking)
#if false
            layers_item.Icon         = Gtk.IconTheme.Default.LoadIcon(Resources.Icons.LayerMergeDown, 16);
            layers_item.DefaultWidth = 100;
            layers_item.Behavior    |= DockItemBehavior.CantClose;
#endif
            workspace.AddItem(layers_item, DockPlacement.Right);

            var show_layers = new ToggleCommand("layers", Translations.GetString("Layers"), null, Resources.Icons.LayerMergeDown)
            {
                Value = true
            };
            app.AddAction(show_layers);
            padMenu.AppendItem(show_layers.CreateMenuItem());

            show_layers.Toggled += (val) => { layers_item.Visible = val; };
            layers_item.VisibilityNotifyEvent += (o, args) => { show_layers.Value = layers_item.Visible; };
        }