protected virtual ToggleToolButton CreateToolButton() { Image i2 = new Image (PintaCore.Resources.GetIcon (Icon)); i2.Show (); ToggleToolButton tool_item = new ToggleToolButton (); tool_item.IconWidget = i2; tool_item.Show (); tool_item.Label = Name; if (ShortcutKey != (Gdk.Key)0) tool_item.TooltipText = string.Format ("{0}\n{2}: {1}\n\n{3}", Name, ShortcutKey.ToString ().ToUpperInvariant (), Catalog.GetString ("Shortcut key"), StatusBarText); else tool_item.TooltipText = Name; return tool_item; }
protected virtual ToggleToolButton CreateToolButton() { Image i2 = new Image (PintaCore.Resources.GetIcon (Icon)); i2.Show (); ToggleToolButton tool_item = new ToggleToolButton (); tool_item.IconWidget = i2; tool_item.Show (); tool_item.Label = Name; tool_item.TooltipText = Name; return tool_item; }
private void BuildAlphaBlending(Toolbar tb) { Image blending_on_icon = new Image (PintaCore.Resources.GetIcon ("Toolbar.BlendingEnabledIcon.png")); blending_on_icon.Show (); Image blending_off_icon = new Image (PintaCore.Resources.GetIcon ("Toolbar.BlendingOverwriteIcon.png")); blending_off_icon.Show (); alphablending_btn = new ToggleToolButton (); alphablending_btn.IconWidget = blending_off_icon; alphablending_btn.Show (); alphablending_btn.Label = Catalog.GetString ("Antialiasing"); alphablending_btn.TooltipText = Catalog.GetString ("Normal blending / Overwrite blending"); alphablending_btn.Toggled += delegate { if (alphablending_btn.Active) alphablending_btn.IconWidget = blending_on_icon; else alphablending_btn.IconWidget = blending_off_icon; }; tb.AppendItem (alphablending_btn); }
private void BuildAntialiasingTool(Toolbar tb) { Image antialiasing_on_icon = new Image (PintaCore.Resources.GetIcon ("Toolbar.AntiAliasingEnabledIcon.png")); antialiasing_on_icon.Show (); Image antialiasing_off_icon = new Image (PintaCore.Resources.GetIcon ("Toolbar.AntiAliasingDisabledIcon.png")); antialiasing_off_icon.Show (); antialiasing_btn = new ToggleToolButton (); antialiasing_btn.IconWidget = antialiasing_off_icon; antialiasing_btn.Show (); antialiasing_btn.Label = Catalog.GetString ("Antialiasing"); antialiasing_btn.TooltipText = Catalog.GetString ("Antialiasing"); antialiasing_btn.Toggled += delegate { if (antialiasing_btn.Active) antialiasing_btn.IconWidget = antialiasing_on_icon; else antialiasing_btn.IconWidget = antialiasing_off_icon; }; tb.AppendItem (antialiasing_btn); }
public ToolbarToggle(ICommand cmd) : base(cmd) { _Button = new ToggleToolButton(cmd.Properties.Icon); _Button.Toggled += new EventHandler (OnToggled); _Button.Label = cmd.Properties.Text; this.Add(_Button); _Button.Show(); this.ShowAll(); }