Beispiel #1
0
        public void RegisterActions(Gtk.Application app, GLib.Menu menu)
        {
            app.AddAccelAction(CropToSelection, "<Primary><Shift>X");
            menu.AppendItem(CropToSelection.CreateMenuItem());

            app.AddAccelAction(AutoCrop, "<Ctrl><Alt>X");
            menu.AppendItem(AutoCrop.CreateMenuItem());

            app.AddAccelAction(Resize, "<Primary>R");
            menu.AppendItem(Resize.CreateMenuItem());

            app.AddAccelAction(CanvasSize, "<Primary><Shift>R");
            menu.AppendItem(CanvasSize.CreateMenuItem());

            var flip_section = new GLib.Menu();

            menu.AppendSection(null, flip_section);

            app.AddAction(FlipHorizontal);
            flip_section.AppendItem(FlipHorizontal.CreateMenuItem());

            app.AddAction(FlipVertical);
            flip_section.AppendItem(FlipVertical.CreateMenuItem());

            var rotate_section = new GLib.Menu();

            menu.AppendSection(null, rotate_section);

            app.AddAccelAction(RotateCW, "<Primary>H");
            rotate_section.AppendItem(RotateCW.CreateMenuItem());

            app.AddAccelAction(RotateCCW, "<Primary>G");
            rotate_section.AppendItem(RotateCCW.CreateMenuItem());

            app.AddAccelAction(Rotate180, "<Primary>J");
            rotate_section.AppendItem(Rotate180.CreateMenuItem());

            var flatten_section = new GLib.Menu();

            menu.AppendSection(null, flatten_section);

            app.AddAccelAction(Flatten, "<Primary><Shift>F");
            flatten_section.AppendItem(Flatten.CreateMenuItem());
        }