Пример #1
0
		private void InitializeToolButton ()
		{
			toolButton =
					new ToolMenuButton (Note.Window.Toolbar,
										new Gtk.Image (NotebookIcon),
										string.Empty, menu);
			toolButton.IsImportant = true;
			toolButton.Homogeneous = false;
			Gtk.Tooltips toolbarTips = new Gtk.Tooltips ();
			toolbarTips.SetTip (toolButton, Catalog.GetString ("Place this note into a notebook"), null);
			
			// Set the notebook submenu
			menu.Shown += OnMenuShown;
			toolButton.ShowAll ();
			AddToolItem (toolButton, -1);
			UpdateNotebookButtonLabel ();
			
			NotebookManager.NoteAddedToNotebook += OnNoteAddedToNotebook;
			NotebookManager.NoteRemovedFromNotebook += OnNoteRemovedFromNotebook;


			Note.TagAdded += delegate (Note taggedNote, Tag tag) {
				if (taggedNote == Note && tag == TemplateTag)
					UpdateButtonSensitivity (true);
			};

			// TODO: Make sure this is handled in NotebookNoteAddin, too
			Note.TagRemoved += delegate (Note taggedNote, string tag) {
				if (taggedNote == Note && tag == TemplateTag.NormalizedName)
					UpdateButtonSensitivity (false);
			};
		}
Пример #2
0
        private void InitializeToolButton()
        {
            toolButton =
                new ToolMenuButton(Note.Window.Toolbar,
                                   new Gtk.Image(NotebookIcon),
                                   string.Empty, menu);
            toolButton.IsImportant = true;
            toolButton.Homogeneous = false;
            Gtk.Tooltips toolbarTips = new Gtk.Tooltips();
            toolbarTips.SetTip(toolButton, Catalog.GetString("Place this note into a notebook"), null);

            // Set the notebook submenu
            menu.Shown += OnMenuShown;
            toolButton.ShowAll();
            AddToolItem(toolButton, -1);
            UpdateNotebookButtonLabel();

            NotebookManager.NoteAddedToNotebook     += OnNoteAddedToNotebook;
            NotebookManager.NoteRemovedFromNotebook += OnNoteRemovedFromNotebook;
        }
Пример #3
0
        private void InitializeToolButton()
        {
            toolButton =
                new ToolMenuButton(Note.Window.Toolbar,
                                   new Gtk.Image(NotebookIcon),
                                   string.Empty, menu);
            toolButton.IsImportant = true;
            toolButton.Homogeneous = false;
            Gtk.Tooltips toolbarTips = new Gtk.Tooltips();
            toolbarTips.SetTip(toolButton, Catalog.GetString("Place this note into a notebook"), null);

            // Set the notebook submenu
            menu.Shown += OnMenuShown;
            toolButton.ShowAll();
            AddToolItem(toolButton, -1);
            UpdateNotebookButtonLabel();

            NotebookManager.NoteAddedToNotebook     += OnNoteAddedToNotebook;
            NotebookManager.NoteRemovedFromNotebook += OnNoteRemovedFromNotebook;


            Note.TagAdded += delegate(Note taggedNote, Tag tag) {
                if (taggedNote == Note && tag == TemplateTag)
                {
                    UpdateButtonSensitivity(true);
                }
            };

            // TODO: Make sure this is handled in NotebookNoteAddin, too
            Note.TagRemoved += delegate(Note taggedNote, string tag) {
                if (taggedNote == Note && tag == TemplateTag.NormalizedName)
                {
                    UpdateButtonSensitivity(false);
                }
            };
        }
Пример #4
0
		//
		// Toolbar
		//
		// Add Link button, Font menu, Delete button to the window's
		// toolbar.
		//

		Gtk.Toolbar MakeToolbar ()
		{
			Gtk.Toolbar tb = new Gtk.Toolbar ();
			tb.Tooltips = true;

			toolbar_tips = new Gtk.Tooltips ();

			Gtk.ToolButton search = new Gtk.ToolButton (
				new Gtk.Image (Gtk.Stock.Find, tb.IconSize),
				Catalog.GetString ("Search"));
			search.IsImportant = true;
			search.Clicked += SearchActivate;
			// TODO: If we ever add a way to customize internal keybindings, this will need to change
			toolbar_tips.SetTip (search, Catalog.GetString ("Search your notes") + " (Ctrl-Shift-F)", null);
			search.AddAccelerator ("clicked",
			                       accel_group,
			                       (uint) Gdk.Key.f,
			                       (Gdk.ModifierType.ControlMask |
			                        Gdk.ModifierType.ShiftMask),
			                       Gtk.AccelFlags.Visible);
			search.ShowAll ();
			tb.Insert (search, -1);

			link_button = new Gtk.ToolButton (
				new Gtk.Image (Gtk.Stock.JumpTo, tb.IconSize),
				Catalog.GetString ("Link"));
			link_button.IsImportant = true;
			link_button.Sensitive = (note.Buffer.Selection != null);
			link_button.Clicked += LinkToNoteActivate;
			// TODO: If we ever add a way to customize internal keybindings, this will need to change
			toolbar_tips.SetTip (
				link_button,
				Catalog.GetString ("Link selected text to a new note") + " (Ctrl-L)",
				null);
			link_button.AddAccelerator ("clicked",
			                            accel_group,
			                            (uint) Gdk.Key.l,
			                            Gdk.ModifierType.ControlMask,
			                            Gtk.AccelFlags.Visible);
			link_button.ShowAll ();
			tb.Insert (link_button, -1);

			ToolMenuButton text_button =
			        new ToolMenuButton (tb,
			                            Gtk.Stock.SelectFont,
			                            Catalog.GetString ("_Text"),
			                            text_menu);
			text_button.IsImportant = true;
			text_button.ShowAll ();
			tb.Insert (text_button, -1);
			toolbar_tips.SetTip (text_button, Catalog.GetString ("Set properties of text"), null);

			ToolMenuButton plugin_button =
			        new ToolMenuButton (tb,
			                            Gtk.Stock.Execute,
			                            Catalog.GetString ("T_ools"),
			                            plugin_menu);
			plugin_button.ShowAll ();
			tb.Insert (plugin_button, -1);
			toolbar_tips.SetTip (plugin_button, Catalog.GetString ("Use tools on this note"), null);

			tb.Insert (new Gtk.SeparatorToolItem (), -1);

			delete = new Gtk.ToolButton (Gtk.Stock.Delete);
			delete.Clicked += OnDeleteButtonClicked;
			delete.ShowAll ();
			tb.Insert (delete, -1);
			toolbar_tips.SetTip (delete, Catalog.GetString ("Delete this note"), null);

			// Don't allow deleting the "Start Here" note...
			if (note.IsSpecial)
				delete.Sensitive = false;

			tb.Insert (new Gtk.SeparatorToolItem (), -1);

			sync_menu_item = new Gtk.ImageMenuItem (Catalog.GetString ("Synchronize Notes"));
			sync_menu_item.Image = new Gtk.Image (Gtk.Stock.Convert, Gtk.IconSize.Menu);
			sync_menu_item.Activated += SyncItemSelected;
			sync_menu_item.Show ();
			PluginMenu.Add (sync_menu_item);

			// We might want to know when various settings are altered.
			Preferences.SettingChanged += Preferences_SettingChanged;

			// Update items based on configuration.
			UpdateMenuItems ();

			tb.ShowAll ();
			return tb;
		}