forked from PintaProject/Pinta
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the tool box fixed on the left with a single column.
- Loading branch information
Showing
8 changed files
with
54 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
// | ||
// ToolBoxPad.cs | ||
// | ||
// ToolBoxToggledAction.cs | ||
// | ||
// Author: | ||
// Jonathan Pobst <[email protected]> | ||
// | ||
// Copyright (c) 2011 Jonathan Pobst | ||
// Copyright (c) 2020 Jonathan Pobst | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
|
@@ -24,42 +24,29 @@ | |
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
// THE SOFTWARE. | ||
|
||
using Gtk; | ||
using Pinta.Docking; | ||
using System; | ||
using Pinta.Core; | ||
using Pinta.Gui.Widgets; | ||
using Gtk; | ||
|
||
namespace Pinta | ||
namespace Pinta.Actions | ||
{ | ||
public class ToolBoxPad : IDockPad | ||
class ToolBoxToggledAction : IActionHandler | ||
{ | ||
public void Initialize (Dock workspace, Application app, GLib.Menu padMenu) | ||
#region IActionHandler Members | ||
public void Initialize () | ||
{ | ||
ToolBoxWidget toolbox = new ToolBoxWidget () { Name = "toolbox" }; | ||
|
||
DockItem toolbox_item = new DockItem(toolbox, "Toolbox") | ||
{ | ||
Label = Translations.GetString("Tools") | ||
}; | ||
|
||
// TODO-GTK3 (docking) | ||
#if false | ||
toolbox_item.Content = toolbox; | ||
toolbox_item.Icon = Gtk.IconTheme.Default.LoadIcon(Resources.Icons.ToolPencil, 16); | ||
toolbox_item.Behavior |= DockItemBehavior.CantClose; | ||
toolbox_item.DefaultWidth = 35; | ||
#endif | ||
workspace.AddItem(toolbox_item, DockPlacement.Left); | ||
PintaCore.Actions.View.ToolBox.Toggled += Activated; | ||
} | ||
|
||
var show_toolbox = new ToggleCommand("Tools", Translations.GetString("Tools"), null, Resources.Icons.ToolPencil) | ||
{ | ||
Value = true | ||
}; | ||
app.AddAction(show_toolbox); | ||
padMenu.AppendItem(show_toolbox.CreateMenuItem()); | ||
public void Uninitialize () | ||
{ | ||
PintaCore.Actions.View.ToolBox.Toggled -= Activated; | ||
} | ||
#endregion | ||
|
||
show_toolbox.Toggled += (val) => { toolbox_item.Visible = val; }; | ||
toolbox_item.VisibilityNotifyEvent += (o, args) => { show_toolbox.Value = toolbox_item.Visible; }; | ||
private void Activated (bool value) | ||
{ | ||
PintaCore.Chrome.ToolBox.Visible = value; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters