[Monodevelop-patches-list] r1476 - in trunk/MonoDevelop: build/AddIns src/Main/Base src/Main/Base/Gui/Components src/Main/Base/Gui/Workbench src/Main/Base/Gui/Workbench/Layouts src/Main/Base/Services/Toolbar
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Sun Apr 18 00:23:52 EDT 2004
Author: tberman
Date: 2004-04-18 00:23:52 -0400 (Sun, 18 Apr 2004)
New Revision: 1476
Modified:
trunk/MonoDevelop/build/AddIns/SharpDevelopCore.addin.xml
trunk/MonoDevelop/src/Main/Base/ChangeLog
trunk/MonoDevelop/src/Main/Base/Gui/Components/SdToolbarCommand.cs
trunk/MonoDevelop/src/Main/Base/Gui/Workbench/DefaultWorkbench.cs
trunk/MonoDevelop/src/Main/Base/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs
trunk/MonoDevelop/src/Main/Base/Services/Toolbar/ToolbarService.cs
Log:
fix the old broken toolbars, also use a handlebox cause its the cool thing to do.
Modified: trunk/MonoDevelop/build/AddIns/SharpDevelopCore.addin.xml
===================================================================
--- trunk/MonoDevelop/build/AddIns/SharpDevelopCore.addin.xml 2004-04-17 22:47:57 UTC (rev 1475)
+++ trunk/MonoDevelop/build/AddIns/SharpDevelopCore.addin.xml 2004-04-18 04:23:52 UTC (rev 1476)
@@ -473,7 +473,7 @@
class = "MonoDevelop.Commands.SaveAllFiles"/>
</Conditional>
<ToolbarItem id = "Separator1" tooltip = "-"/>
- <!-- <Conditional activewindow="*" action="Disable"> -->
+ <!-- <Conditional activewindow="*" action="Disable">-->
<ToolbarItem id = "Cut"
icon = "Icons.16x16.CutIcon"
tooltip = "${res:XML.MainMenu.EditMenu.Cut.Description}"
@@ -490,7 +490,7 @@
icon = "Icons.16x16.DeleteIcon"
tooltip = "${res:XML.MainMenu.EditMenu.Delete.Description}"
class = "MonoDevelop.Commands.Delete"/>
- <!-- </Conditional> -->
+ <!-- </Conditional>-->
<ToolbarItem id = "CutSeparator" insertafter ="Delete" insertbefore ="Find" tooltip = "-"/>
<!-- <Conditional action="Disable">
<Or>
Modified: trunk/MonoDevelop/src/Main/Base/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/Main/Base/ChangeLog 2004-04-17 22:47:57 UTC (rev 1475)
+++ trunk/MonoDevelop/src/Main/Base/ChangeLog 2004-04-18 04:23:52 UTC (rev 1476)
@@ -1,5 +1,16 @@
2004-04-17 Todd Berman <tberman at sevenl.net>
+ * Services/Toolbar/ToolbarService.cs:
+ * Gui/Workbench/Layouts/SdiWorkspaceLayout.cs:
+ * Gui/Workbench/DefaultWorkbench.cs:
+ * Gui/Components/SdToolbarCommand.cs:
+ Fixup the entire toolbar scheme to actually *work* properly.
+ This is only temporary, as the entire toolbar setup is going to be
+ rewritten again to support arbitrary widgetry, proper saving/loading of
+ toolbars tied to layouts, etc, etc.
+
+2004-04-17 Todd Berman <tberman at sevenl.net>
+
* Gui/Components/SdMenu.cs:
* Commands/MenuItemBuilders.cs:
Fix the menu system so we dont rebuild the menu's from scratch every
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Components/SdToolbarCommand.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Components/SdToolbarCommand.cs 2004-04-17 22:47:57 UTC (rev 1475)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Components/SdToolbarCommand.cs 2004-04-18 04:23:52 UTC (rev 1476)
@@ -18,7 +18,7 @@
namespace MonoDevelop.Gui.Components
{
- public class SdToolbarCommand : Gtk.Image, IStatusUpdate
+ public class SdToolbarCommand : Gtk.Button, IStatusUpdate
{
static StringParserService stringParserService = (StringParserService)ServiceManager.Services.GetService(typeof(StringParserService));
@@ -56,7 +56,7 @@
public SdToolbarCommand (string text) : base ()
{
ResourceService resourceService = (ResourceService)ServiceManager.Services.GetService (typeof(IResourceService));
-
+
if (text.StartsWith ("${")) {
localizedText = resourceService.GetString (text);
} else {
@@ -64,8 +64,9 @@
}
localizedText = localizedText.Replace ('&', '_');
+ Clicked += new EventHandler (ToolbarClicked);
}
-
+
public SdToolbarCommand(ConditionCollection conditionCollection, object caller, string label) : this(stringParserService.Parse(label))
{
this.caller = caller;
@@ -95,12 +96,12 @@
}
// To be called from ToolbarService
- public void ToolbarClicked() {
+ public void ToolbarClicked(object o, EventArgs e) {
if (menuCommand != null) {
menuCommand.Run();
}
}
-
+
public virtual void UpdateStatus()
{
if (conditionCollection != null) {
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Workbench/DefaultWorkbench.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Workbench/DefaultWorkbench.cs 2004-04-17 22:47:57 UTC (rev 1475)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Workbench/DefaultWorkbench.cs 2004-04-18 04:23:52 UTC (rev 1476)
@@ -618,11 +618,6 @@
}
}
- // this method simply copies over the enabled state of the toolbar,
- // this assumes that no item is inserted or removed.
- // TODO : make this method more add-in tree like, currently with Windows.Forms
- // toolbars this is not possible. (drawing fragments, slow etc.)
-
void CreateToolBars()
{
if (ToolBars == null) {
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs 2004-04-17 22:47:57 UTC (rev 1475)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs 2004-04-18 04:23:52 UTC (rev 1476)
@@ -42,7 +42,7 @@
Window wbWindow;
Container rootWidget;
- Container toolbarContainer;
+ VBox toolbarContainer;
Dock dock;
DockLayout dockLayout;
Notebook tabControl;
@@ -75,12 +75,14 @@
vbox.PackStart (workbench.TopMenu, false, false, 0);
if (workbench.ToolBars != null) {
- VBox toolvbox = new VBox (false, 0);
- toolbarContainer = toolvbox;
+ toolbarContainer = new VBox (false, 0);
for (int i = 0; i < workbench.ToolBars.Length; i++) {
- toolvbox.PackStart (workbench.ToolBars[i], false, false, 0);
+ Gtk.HandleBox toolHandleBox = new Gtk.HandleBox ();
+ toolHandleBox.Shadow = Gtk.ShadowType.None;
+ toolHandleBox.Add (workbench.ToolBars[i]);
+ vbox.PackStart (toolHandleBox, false, false, 0);
}
- vbox.PackStart(toolvbox, false, false, 0);
+ //vbox.PackStart(toolbarContainer, false, false, 0);
}
// Create the docking widget and add it to the window.
Modified: trunk/MonoDevelop/src/Main/Base/Services/Toolbar/ToolbarService.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Services/Toolbar/ToolbarService.cs 2004-04-17 22:47:57 UTC (rev 1475)
+++ trunk/MonoDevelop/src/Main/Base/Services/Toolbar/ToolbarService.cs 2004-04-18 04:23:52 UTC (rev 1476)
@@ -61,13 +61,16 @@
continue;
} else {
item = new SdToolbarCommand(childCodon.Conditions, owner, childCodon.ToolTip);
- Gtk.Image img = resourceService.GetImage(childCodon.Icon, Gtk.IconSize.Menu);
- if (img.StorageType == Gtk.ImageType.Stock) {
- item.Stock = img.Stock;
- item.IconSize = (int)Gtk.IconSize.Menu;
- } else {
- item.Pixbuf = img.Pixbuf;
- }
+ Gtk.Image img = resourceService.GetImage(childCodon.Icon, Gtk.IconSize.LargeToolbar);
+ item.Add (img);
+ item.Relief = ReliefStyle.None;
+
+ //if (img.StorageType == Gtk.ImageType.Stock) {
+ // item.Stock = img.Stock;
+ // item.IconSize = (int)Gtk.IconSize.SmallToolbar;
+ //} else {
+ // item.Pixbuf = img.Pixbuf;
+ //}
item.ShowAll();
}
} else {
@@ -76,7 +79,8 @@
if (childCodon.Class != null) {
((SdToolbarCommand)item).Command = (ICommand)childCodon.AddIn.CreateObject(childCodon.Class);
}
- bar.AppendItem(item.Text, item.Text, item.Text, item, new Gtk.SignalFunc(item.ToolbarClicked));
+ //bar.AppendItem(item.Text, item.Text, item.Text, item, new Gtk.SignalFunc(item.ToolbarClicked));
+ bar.AppendWidget (item, item.Text, item.Text);
}
return bar;
}
More information about the Monodevelop-patches-list
mailing list