Skip to content
22 changes: 5 additions & 17 deletions Pinta.Core/Actions/LayerActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,13 @@ public LayerActions (
"movelayerup",
Translations.GetString ("Move Layer Up"),
null,
Resources.Icons.LayerMoveUp);
Resources.StandardIcons.LayerMoveUp);

MoveLayerDown = new Command (
"movelayerdown",
Translations.GetString ("Move Layer Down"),
null,
Resources.Icons.LayerMoveDown);
Resources.StandardIcons.LayerMoveDown);

Properties = new Command (
"properties",
Expand All @@ -135,20 +135,8 @@ public LayerActions (
this.image = image;
}

public void RegisterActions (Gtk.Application app, Gio.Menu menu)
public void RegisterActions (Gtk.Application app)
{
Gio.Menu flip_section = Gio.Menu.New ();
flip_section.AppendItem (FlipHorizontal.CreateMenuItem ());
flip_section.AppendItem (FlipVertical.CreateMenuItem ());
flip_section.AppendItem (RotateZoom.CreateMenuItem ());

Gio.Menu prop_section = Gio.Menu.New ();
prop_section.AppendItem (Properties.CreateMenuItem ());

menu.AppendItem (ImportFromFile.CreateMenuItem ());
menu.AppendSection (null, flip_section);
menu.AppendSection (null, prop_section);

app.AddCommands ([
AddNewLayer,
DeleteLayer,
Expand Down Expand Up @@ -306,7 +294,7 @@ private void HandlePintaCoreActionsLayersMoveLayerUpActivated (object sender, Ev
tools.Commit ();

SwapLayersHistoryItem hist = new (
Resources.Icons.LayerMoveUp,
Resources.StandardIcons.LayerMoveUp,
Translations.GetString ("Move Layer Up"),
doc.Layers.CurrentUserLayerIndex,
doc.Layers.CurrentUserLayerIndex + 1);
Expand All @@ -322,7 +310,7 @@ private void HandlePintaCoreActionsLayersMoveLayerDownActivated (object sender,
tools.Commit ();

SwapLayersHistoryItem hist = new (
Resources.Icons.LayerMoveDown,
Resources.StandardIcons.LayerMoveDown,
Translations.GetString ("Move Layer Down"),
doc.Layers.CurrentUserLayerIndex,
doc.Layers.CurrentUserLayerIndex - 1);
Expand Down
3 changes: 3 additions & 0 deletions Pinta.Resources/Icons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ public static class StandardIcons
public const string ImageGeneric = "image-x-generic-symbolic";
public const string ImageMissing = "image-missing-symbolic";

public const string LayerMoveUp = "pan-up-symbolic";
public const string LayerMoveDown = "pan-down-symbolic";

public const string OpenMenu = "open-menu-symbolic";

public const string ApplicationAddon = "application-x-addon-symbolic";
Expand Down
6 changes: 1 addition & 5 deletions Pinta/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,6 @@ private void CreateMainMenu ()
Gio.Menu fileMenu = Gio.Menu.New ();
Gio.Menu editMenu = Gio.Menu.New ();
Gio.Menu imageMenu = Gio.Menu.New ();
Gio.Menu layersMenu = Gio.Menu.New ();
Gio.Menu adjustmentsMenu = Gio.Menu.New ();
Gio.Menu effectsMenu = Gio.Menu.New ();
Gio.Menu addinsMenu = Gio.Menu.New ();
Expand All @@ -396,9 +395,6 @@ private void CreateMainMenu ()
if (usingMenuBar) {
menuBar.AppendSubmenu (Translations.GetString ("_View"), viewMenu);
menuBar.AppendSubmenu (Translations.GetString ("_Image"), imageMenu);
}
menuBar.AppendSubmenu (Translations.GetString ("_Layers"), layersMenu);
if (usingMenuBar) {
menuBar.AppendSubmenu (Translations.GetString ("_Adjustments"), adjustmentsMenu);
menuBar.AppendSubmenu (Translations.GetString ("Effe_cts"), effectsMenu);
}
Expand All @@ -421,7 +417,7 @@ private void CreateMainMenu ()
PintaCore.Actions.Edit.RegisterActions (app, editMenu);
PintaCore.Actions.View.RegisterActions (app, viewMenu);
PintaCore.Actions.Image.RegisterActions (app, imageMenu);
PintaCore.Actions.Layers.RegisterActions (app, layersMenu);
PintaCore.Actions.Layers.RegisterActions (app);
PintaCore.Actions.Addins.RegisterActions (app, addinsMenu);
PintaCore.Actions.Window.RegisterActions (app, windowMenu);
PintaCore.Actions.Help.RegisterActions (app, helpMenu);
Expand Down
39 changes: 31 additions & 8 deletions Pinta/Pads/LayersPad.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,38 @@ public void Initialize (Dock workspace)
Label = Translations.GetString ("Layers"),
};

Gio.Menu hamburger_menu = Gio.Menu.New ();

Gio.Menu flip_section = Gio.Menu.New ();
flip_section.AppendItem (layer_actions.FlipHorizontal.CreateMenuItem ());
flip_section.AppendItem (layer_actions.FlipVertical.CreateMenuItem ());
flip_section.AppendItem (layer_actions.RotateZoom.CreateMenuItem ());

Gio.Menu prop_section = Gio.Menu.New ();
prop_section.AppendItem (layer_actions.Properties.CreateMenuItem ());

hamburger_menu.AppendItem (layer_actions.ImportFromFile.CreateMenuItem ());
hamburger_menu.AppendSection (null, flip_section);
hamburger_menu.AppendSection (null, prop_section);

Gtk.MenuButton hamburger_button = new Gtk.MenuButton () {
MenuModel = hamburger_menu,
IconName = Resources.StandardIcons.OpenMenu
};

hamburger_button.Direction = Gtk.ArrowType.Up;

Gtk.Box toolbar_buttons = new Gtk.Box ();
toolbar_buttons.Append (layer_actions.AddNewLayer.CreateDockToolBarItem ());
toolbar_buttons.Append (layer_actions.DeleteLayer.CreateDockToolBarItem ());
toolbar_buttons.Append (layer_actions.DuplicateLayer.CreateDockToolBarItem ());
toolbar_buttons.Append (layer_actions.MergeLayerDown.CreateDockToolBarItem ());
toolbar_buttons.Append (layer_actions.MoveLayerUp.CreateDockToolBarItem ());
toolbar_buttons.Append (layer_actions.MoveLayerDown.CreateDockToolBarItem ());
toolbar_buttons.Append (hamburger_button);

Gtk.Box layers_tb = layers_item.AddToolBar ();
layers_tb.AppendMultiple ([
layer_actions.AddNewLayer.CreateDockToolBarItem (),
layer_actions.DeleteLayer.CreateDockToolBarItem (),
layer_actions.DuplicateLayer.CreateDockToolBarItem (),
layer_actions.MergeLayerDown.CreateDockToolBarItem (),
layer_actions.MoveLayerUp.CreateDockToolBarItem (),
layer_actions.MoveLayerDown.CreateDockToolBarItem (),
]);
layers_tb.Append (toolbar_buttons);

workspace.AddItem (layers_item, DockPlacement.Right);
}
Expand Down
Loading