announcing 2 plug-ins: tabs-close and tabs-right



Hi,

I wrote two plug-ins in python, both are attached.

tabs-close: allows closing tabs by middle-clicking on the label
tabs-right: displays tabs on the right side of the window

cheers,
Greg
[Epiphany Extension]
Name=Tab Closer
Description=Allows closing tabs by middle-clicking on the labels.

[Loader]
Type=python
Module=tabs-close
#!/usr/bin/env python

#  Copyright (C) 2006 Gergely Nagy
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2, or (at your option)
#  any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

"""Allows tabs to be closed by middleclicking on the labels."""

def attach_tab(window, tab):
	label = window.get_notebook().get_tab_label(tab)
	sig = label.connect("button_press_event", tab_close_on_middleclick, tab)
	tab._close_on_middleclick_sig = sig

def detach_tab(window, tab):
	label = window.get_notebook().get_tab_label(tab)
	label.disconnect(tab._close_on_middleclick_sig)

def tab_close_on_middleclick(widget, event, tab):
	if event.button == 2:
		tab.destroy()
[Epiphany Extension]
Name=Tabs to Right
Description=Moves the browser tabs to the right side of the window. Also, tabs can be closed by middleclicking.

[Loader]
Type=python
Module=tabs-right
#!/usr/bin/env python

#  Copyright (C) 2006 Gergely Nagy
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2, or (at your option)
#  any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

"""A simple extension to move the browser tabs to the right."""

import epiphany

def attach_window(window):
	notebook = window.get_notebook()
	notebook.set_tab_pos("GTK_POS_RIGHT")


def detach_window(window):
	notebook = window.get_notebook()
	notebook.set_tab_pos("GTK_POS_TOP")


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]