Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MultiTerm: Add support for GTK3 #95

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
29 changes: 29 additions & 0 deletions multiterm/src/context-menu.vala
Expand Up @@ -68,6 +68,20 @@ namespace MultiTerm
item.show();
}

private Gtk.MenuItem add_image_menu_item(string label_text, string icon_name)
lpaulsen93 marked this conversation as resolved.
Show resolved Hide resolved
{
Gtk.Box box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6);
var icon = new Gtk.Image.from_icon_name(icon_name, IconSize.MENU);
Label label = new Label(label_text);
Gtk.MenuItem *item;

item = new Gtk.MenuItem();

box.pack_start (icon, false, false, 0);
box.pack_start (label, false, false, 0);
((Gtk.Container)item).add (box);
}

public ContextMenu(Config? cfg)
{
Gtk.Menu menu;
Expand Down Expand Up @@ -112,13 +126,23 @@ namespace MultiTerm

//add_separator();

#if MULTITERM_GTK3
item = add_image_menu_item ("_Copy", "edit-copy");
item.activate.connect(() => copy_activate());
#else
image_item = new ImageMenuItem.from_stock(Gtk.Stock.COPY, null);
image_item.activate.connect(() => copy_activate());
#endif
//this.append(image_item);
//image_item.show();

#if MULTITERM_GTK3
item = add_image_menu_item ("_Paste", "edit-paste");
item.activate.connect(() => paste_activate());
#else
image_item = new ImageMenuItem.from_stock(Gtk.Stock.PASTE, null);
image_item.activate.connect(() => paste_activate());
#endif
//this.append(image_item);
//image_item.show();

Expand Down Expand Up @@ -146,8 +170,13 @@ namespace MultiTerm

//add_separator();

#if MULTITERM_GTK3
item = add_image_menu_item ("_Preferences", "preferences-system");
item.activate.connect(() => paste_activate());
#else
image_item = new ImageMenuItem.from_stock(Gtk.Stock.PREFERENCES, null);
image_item.activate.connect(() => preferences_activate());
#endif
//this.append(image_item);
//image_item.show();
}
Expand Down