Implement stock items for Tab Panel and plugin panel

This commit is contained in:
Enrico Tröger 2009-04-05 00:13:09 +02:00 committed by Christian Dywan
parent 64b4762d20
commit ad8558ab4c
4 changed files with 29 additions and 5 deletions

View file

@ -13,6 +13,8 @@
#include <midori/midori.h> #include <midori/midori.h>
#define STOCK_TAB_PANEL "tab-panel"
static void static void
tab_panel_app_add_browser_cb (MidoriApp* app, tab_panel_app_add_browser_cb (MidoriApp* app,
MidoriBrowser* browser) MidoriBrowser* browser)
@ -26,7 +28,7 @@ tab_panel_app_add_browser_cb (MidoriApp* app,
child = midori_view_new (NULL); child = midori_view_new (NULL);
gtk_widget_show (child); gtk_widget_show (child);
midori_panel_append_widget (MIDORI_PANEL (panel), child, midori_panel_append_widget (MIDORI_PANEL (panel), child,
GTK_STOCK_INDEX, "Tab Panel", NULL); STOCK_TAB_PANEL, _("Tab Panel"), NULL);
} }
static void static void
@ -40,8 +42,29 @@ tab_panel_activate_cb (MidoriExtension* extension,
MidoriExtension* MidoriExtension*
extension_init (void) extension_init (void)
{ {
MidoriExtension* extension = g_object_new (TAB_PANEL_TYPE_EXTENSION, MidoriExtension* extension;
"name", "Tab Panel", GtkIconFactory* factory;
GtkIconSource* icon_source;
GtkIconSet* icon_set;
static GtkStockItem items[] =
{
{ STOCK_TAB_PANEL, N_("T_ab Panel"), 0, 0, NULL },
};
factory = gtk_icon_factory_new ();
gtk_stock_add (items, G_N_ELEMENTS (items));
icon_set = gtk_icon_set_new ();
icon_source = gtk_icon_source_new ();
gtk_icon_source_set_icon_name (icon_source, GTK_STOCK_INDEX);
gtk_icon_set_add_source (icon_set, icon_source);
gtk_icon_source_free (icon_source);
gtk_icon_factory_add (factory, STOCK_TAB_PANEL, icon_set);
gtk_icon_set_unref (icon_set);
gtk_icon_factory_add_default (factory);
g_object_unref (factory);
extension = g_object_new (TAB_PANEL_TYPE_EXTENSION,
"name", _("Tab Panel"),
"description", "", "description", "",
"version", "0.1", "version", "0.1",
"authors", "Christian Dywan <christian@twotoasts.de>", "authors", "Christian Dywan <christian@twotoasts.de>",

View file

@ -30,6 +30,7 @@
#define STOCK_STYLES "gnome-settings-theme" #define STOCK_STYLES "gnome-settings-theme"
#define STOCK_TRANSFER "package" #define STOCK_TRANSFER "package"
#define STOCK_TRANSFERS "package" #define STOCK_TRANSFERS "package"
#define STOCK_PLUGINS GTK_STOCK_CONVERT
#define STOCK_BOOKMARK_ADD "stock_add-bookmark" #define STOCK_BOOKMARK_ADD "stock_add-bookmark"
#define STOCK_HOMEPAGE GTK_STOCK_HOME #define STOCK_HOMEPAGE GTK_STOCK_HOME

View file

@ -776,6 +776,7 @@ sokoke_register_stock_items (void)
{ STOCK_STYLES, N_("User_styles"), 0, 0, GTK_STOCK_SELECT_COLOR }, { STOCK_STYLES, N_("User_styles"), 0, 0, GTK_STOCK_SELECT_COLOR },
{ STOCK_TAB_NEW, N_("New _Tab"), 0, 0, GTK_STOCK_ADD }, { STOCK_TAB_NEW, N_("New _Tab"), 0, 0, GTK_STOCK_ADD },
{ STOCK_TRANSFERS, N_("_Transfers"), 0, 0, GTK_STOCK_SAVE }, { STOCK_TRANSFERS, N_("_Transfers"), 0, 0, GTK_STOCK_SAVE },
{ STOCK_PLUGINS, N_("P_lugins"), 0, 0, GTK_STOCK_CONVERT },
{ STOCK_USER_TRASH, N_("_Closed Tabs and Windows"), 0, 0, "gtk-undo-ltr" }, { STOCK_USER_TRASH, N_("_Closed Tabs and Windows"), 0, 0, "gtk-undo-ltr" },
{ STOCK_WINDOW_NEW, N_("New _Window"), 0, 0, GTK_STOCK_ADD }, { STOCK_WINDOW_NEW, N_("New _Window"), 0, 0, GTK_STOCK_ADD },
}; };

View file

@ -90,8 +90,7 @@ midori_plugins_get_label (MidoriViewable* viewable)
static const gchar* static const gchar*
midori_plugins_get_stock_id (MidoriViewable* viewable) midori_plugins_get_stock_id (MidoriViewable* viewable)
{ {
/* FIXME: We need a dedicated stock id */ return STOCK_PLUGINS;
return GTK_STOCK_CONVERT /* STOCK_PLUGINS */;
} }
static GtkWidget* static GtkWidget*