Implement Options menu via a button on the side panel
The new button is visible on all panels and pops up a menu, which allows toggling the panel titles and the operating controls. A new signal "populate-option-menu" makes it extendible.
This commit is contained in:
parent
a32bd1e39a
commit
ef785dd784
5 changed files with 233 additions and 22 deletions
|
@ -180,6 +180,11 @@ GtkWidget*
|
||||||
midori_panel_construct_menu_item (MidoriPanel* panel,
|
midori_panel_construct_menu_item (MidoriPanel* panel,
|
||||||
MidoriViewable* viewable);
|
MidoriViewable* viewable);
|
||||||
|
|
||||||
|
static void
|
||||||
|
midori_browser_settings_notify (MidoriWebSettings* web_settings,
|
||||||
|
GParamSpec* pspec,
|
||||||
|
MidoriBrowser* browser);
|
||||||
|
|
||||||
static GtkAction*
|
static GtkAction*
|
||||||
_action_by_name (MidoriBrowser* browser,
|
_action_by_name (MidoriBrowser* browser,
|
||||||
const gchar* name)
|
const gchar* name)
|
||||||
|
@ -3957,6 +3962,38 @@ midori_panel_notify_page_cb (MidoriPanel* panel,
|
||||||
g_object_set (browser->settings, "last-panel-page", page, NULL);
|
g_object_set (browser->settings, "last-panel-page", page, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
midori_panel_notify_show_titles_cb (MidoriPanel* panel,
|
||||||
|
GParamSpec* pspec,
|
||||||
|
MidoriBrowser* browser)
|
||||||
|
{
|
||||||
|
gboolean show_titles = katze_object_get_boolean (panel, "show-titles");
|
||||||
|
if (browser->settings)
|
||||||
|
{
|
||||||
|
g_signal_handlers_block_by_func (browser->settings,
|
||||||
|
midori_browser_settings_notify, browser);
|
||||||
|
g_object_set (browser->settings, "compact-sidepanel", !show_titles, NULL);
|
||||||
|
g_signal_handlers_unblock_by_func (browser->settings,
|
||||||
|
midori_browser_settings_notify, browser);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
midori_panel_notify_show_controls_cb (MidoriPanel* panel,
|
||||||
|
GParamSpec* pspec,
|
||||||
|
MidoriBrowser* browser)
|
||||||
|
{
|
||||||
|
gboolean show_controls = katze_object_get_boolean (panel, "show-controls");
|
||||||
|
if (browser->settings)
|
||||||
|
{
|
||||||
|
g_signal_handlers_block_by_func (browser->settings,
|
||||||
|
midori_browser_settings_notify, browser);
|
||||||
|
g_object_set (browser->settings, "show-panel-controls", show_controls, NULL);
|
||||||
|
g_signal_handlers_unblock_by_func (browser->settings,
|
||||||
|
midori_browser_settings_notify, browser);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
midori_panel_notify_right_aligned_cb (MidoriPanel* panel,
|
midori_panel_notify_right_aligned_cb (MidoriPanel* panel,
|
||||||
GParamSpec* pspec,
|
GParamSpec* pspec,
|
||||||
|
@ -5014,12 +5051,18 @@ midori_browser_init (MidoriBrowser* browser)
|
||||||
browser->panel = g_object_new (MIDORI_TYPE_PANEL,
|
browser->panel = g_object_new (MIDORI_TYPE_PANEL,
|
||||||
"menu", browser->menu_tools,
|
"menu", browser->menu_tools,
|
||||||
NULL);
|
NULL);
|
||||||
g_signal_connect (browser->panel, "notify::page",
|
g_object_connect (browser->panel,
|
||||||
G_CALLBACK (midori_panel_notify_page_cb), browser);
|
"signal::notify::page",
|
||||||
g_signal_connect (browser->panel, "notify::right-aligned",
|
midori_panel_notify_page_cb, browser,
|
||||||
G_CALLBACK (midori_panel_notify_right_aligned_cb), browser);
|
"signal::notify::show-titles",
|
||||||
g_signal_connect (browser->panel, "close",
|
midori_panel_notify_show_titles_cb, browser,
|
||||||
G_CALLBACK (midori_panel_close_cb), browser);
|
"signal::notify::show-controls",
|
||||||
|
midori_panel_notify_show_controls_cb, browser,
|
||||||
|
"signal::notify::right-aligned",
|
||||||
|
midori_panel_notify_right_aligned_cb, browser,
|
||||||
|
"signal::close",
|
||||||
|
midori_panel_close_cb, browser,
|
||||||
|
NULL);
|
||||||
gtk_paned_pack1 (GTK_PANED (hpaned), browser->panel, FALSE, FALSE);
|
gtk_paned_pack1 (GTK_PANED (hpaned), browser->panel, FALSE, FALSE);
|
||||||
|
|
||||||
/* Notebook, containing all views */
|
/* Notebook, containing all views */
|
||||||
|
@ -5317,7 +5360,7 @@ _midori_browser_update_settings (MidoriBrowser* browser)
|
||||||
gboolean remember_last_window_size;
|
gboolean remember_last_window_size;
|
||||||
gint last_window_width, last_window_height;
|
gint last_window_width, last_window_height;
|
||||||
MidoriWindowState last_window_state;
|
MidoriWindowState last_window_state;
|
||||||
gboolean compact_sidepanel, right_align_sidepanel;
|
gboolean compact_sidepanel, show_panel_controls, right_align_sidepanel;
|
||||||
gint last_panel_position, last_panel_page;
|
gint last_panel_position, last_panel_page;
|
||||||
gboolean show_menubar, show_bookmarkbar;
|
gboolean show_menubar, show_bookmarkbar;
|
||||||
gboolean show_panel, show_transferbar;
|
gboolean show_panel, show_transferbar;
|
||||||
|
@ -5338,6 +5381,7 @@ _midori_browser_update_settings (MidoriBrowser* browser)
|
||||||
"last-window-height", &last_window_height,
|
"last-window-height", &last_window_height,
|
||||||
"last-window-state", &last_window_state,
|
"last-window-state", &last_window_state,
|
||||||
"compact-sidepanel", &compact_sidepanel,
|
"compact-sidepanel", &compact_sidepanel,
|
||||||
|
"show-panel-controls", &show_panel_controls,
|
||||||
"right-align-sidepanel", &right_align_sidepanel,
|
"right-align-sidepanel", &right_align_sidepanel,
|
||||||
"last-panel-position", &last_panel_position,
|
"last-panel-position", &last_panel_position,
|
||||||
"last-panel-page", &last_panel_page,
|
"last-panel-page", &last_panel_page,
|
||||||
|
@ -5411,9 +5455,9 @@ _midori_browser_update_settings (MidoriBrowser* browser)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
midori_panel_set_compact (MIDORI_PANEL (browser->panel), compact_sidepanel);
|
g_object_set (browser->panel, "show-titles", !compact_sidepanel,
|
||||||
midori_panel_set_right_aligned (MIDORI_PANEL (browser->panel),
|
"show-controls", show_panel_controls,
|
||||||
right_align_sidepanel);
|
"right-aligned", right_align_sidepanel, NULL);
|
||||||
gtk_paned_set_position (GTK_PANED (gtk_widget_get_parent (browser->panel)),
|
gtk_paned_set_position (GTK_PANED (gtk_widget_get_parent (browser->panel)),
|
||||||
last_panel_position);
|
last_panel_position);
|
||||||
/* The browser may not yet be visible, which means that we can't set the
|
/* The browser may not yet be visible, which means that we can't set the
|
||||||
|
@ -5457,8 +5501,11 @@ midori_browser_settings_notify (MidoriWebSettings* web_settings,
|
||||||
else if (name == g_intern_string ("toolbar-items"))
|
else if (name == g_intern_string ("toolbar-items"))
|
||||||
_midori_browser_set_toolbar_items (browser, g_value_get_string (&value));
|
_midori_browser_set_toolbar_items (browser, g_value_get_string (&value));
|
||||||
else if (name == g_intern_string ("compact-sidepanel"))
|
else if (name == g_intern_string ("compact-sidepanel"))
|
||||||
midori_panel_set_compact (MIDORI_PANEL (browser->panel),
|
g_object_set (browser->panel, "show-titles",
|
||||||
g_value_get_boolean (&value));
|
!g_value_get_boolean (&value), NULL);
|
||||||
|
else if (name == g_intern_string ("show-controls"))
|
||||||
|
g_object_set (browser->panel, "show-controls",
|
||||||
|
g_value_get_boolean (&value), NULL);
|
||||||
else if (name == g_intern_string ("always-show-tabbar"))
|
else if (name == g_intern_string ("always-show-tabbar"))
|
||||||
_toggle_tabbar_smartly (browser);
|
_toggle_tabbar_smartly (browser);
|
||||||
else if (name == g_intern_string ("show-navigationbar"))
|
else if (name == g_intern_string ("show-navigationbar"))
|
||||||
|
|
|
@ -23,6 +23,7 @@ struct _MidoriPanel
|
||||||
{
|
{
|
||||||
GtkHBox parent_instance;
|
GtkHBox parent_instance;
|
||||||
|
|
||||||
|
GtkWidget* labelbar;
|
||||||
GtkWidget* toolbar;
|
GtkWidget* toolbar;
|
||||||
GtkToolItem* button_align;
|
GtkToolItem* button_align;
|
||||||
GtkToolItem* button_detach;
|
GtkToolItem* button_detach;
|
||||||
|
@ -32,6 +33,8 @@ struct _MidoriPanel
|
||||||
GtkWidget* notebook;
|
GtkWidget* notebook;
|
||||||
GtkMenu* menu;
|
GtkMenu* menu;
|
||||||
|
|
||||||
|
gboolean show_titles;
|
||||||
|
gboolean show_controls;
|
||||||
gboolean right_aligned;
|
gboolean right_aligned;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -53,6 +56,8 @@ enum
|
||||||
PROP_SHADOW_TYPE,
|
PROP_SHADOW_TYPE,
|
||||||
PROP_MENU,
|
PROP_MENU,
|
||||||
PROP_PAGE,
|
PROP_PAGE,
|
||||||
|
PROP_SHOW_TITLES,
|
||||||
|
PROP_SHOW_CONTROLS,
|
||||||
PROP_RIGHT_ALIGNED,
|
PROP_RIGHT_ALIGNED,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -160,6 +165,38 @@ midori_panel_class_init (MidoriPanelClass* class)
|
||||||
-1, G_MAXINT, -1,
|
-1, G_MAXINT, -1,
|
||||||
flags));
|
flags));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MidoriWebSettings:show-titles:
|
||||||
|
*
|
||||||
|
* Whether to show panel titles.
|
||||||
|
*
|
||||||
|
* Since: 0.1.9
|
||||||
|
*/
|
||||||
|
g_object_class_install_property (gobject_class,
|
||||||
|
PROP_SHOW_TITLES,
|
||||||
|
g_param_spec_boolean (
|
||||||
|
"show-titles",
|
||||||
|
"Show Titles",
|
||||||
|
"Whether to show panel titles",
|
||||||
|
TRUE,
|
||||||
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MidoriWebSettings:show-controls:
|
||||||
|
*
|
||||||
|
* Whether to show operating controls.
|
||||||
|
*
|
||||||
|
* Since: 0.1.9
|
||||||
|
*/
|
||||||
|
g_object_class_install_property (gobject_class,
|
||||||
|
PROP_SHOW_CONTROLS,
|
||||||
|
g_param_spec_boolean (
|
||||||
|
"show-controls",
|
||||||
|
"Show Controls",
|
||||||
|
"Whether to show operating controls",
|
||||||
|
TRUE,
|
||||||
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MidoriWebSettings:right-aligned:
|
* MidoriWebSettings:right-aligned:
|
||||||
*
|
*
|
||||||
|
@ -310,6 +347,8 @@ midori_panel_init (MidoriPanel* panel)
|
||||||
GtkWidget* labelbar;
|
GtkWidget* labelbar;
|
||||||
GtkToolItem* toolitem;
|
GtkToolItem* toolitem;
|
||||||
|
|
||||||
|
panel->show_titles = TRUE;
|
||||||
|
panel->show_controls = TRUE;
|
||||||
panel->right_aligned = FALSE;
|
panel->right_aligned = FALSE;
|
||||||
|
|
||||||
/* Create the sidebar */
|
/* Create the sidebar */
|
||||||
|
@ -326,6 +365,7 @@ midori_panel_init (MidoriPanel* panel)
|
||||||
|
|
||||||
/* Create the titlebar */
|
/* Create the titlebar */
|
||||||
labelbar = gtk_toolbar_new ();
|
labelbar = gtk_toolbar_new ();
|
||||||
|
panel->labelbar = labelbar;
|
||||||
gtk_toolbar_set_icon_size (GTK_TOOLBAR (labelbar), GTK_ICON_SIZE_MENU);
|
gtk_toolbar_set_icon_size (GTK_TOOLBAR (labelbar), GTK_ICON_SIZE_MENU);
|
||||||
gtk_toolbar_set_style (GTK_TOOLBAR (labelbar), GTK_TOOLBAR_ICONS);
|
gtk_toolbar_set_style (GTK_TOOLBAR (labelbar), GTK_TOOLBAR_ICONS);
|
||||||
toolitem = gtk_tool_item_new ();
|
toolitem = gtk_tool_item_new ();
|
||||||
|
@ -417,6 +457,19 @@ midori_panel_set_property (GObject* object,
|
||||||
case PROP_PAGE:
|
case PROP_PAGE:
|
||||||
midori_panel_set_current_page (panel, g_value_get_int (value));
|
midori_panel_set_current_page (panel, g_value_get_int (value));
|
||||||
break;
|
break;
|
||||||
|
case PROP_SHOW_TITLES:
|
||||||
|
panel->show_titles = g_value_get_boolean (value);
|
||||||
|
#if HAVE_HILDON
|
||||||
|
panel->show_titles = TRUE;
|
||||||
|
#endif
|
||||||
|
gtk_toolbar_set_style (GTK_TOOLBAR (panel->toolbar),
|
||||||
|
panel->show_titles ? GTK_TOOLBAR_BOTH : GTK_TOOLBAR_ICONS);
|
||||||
|
break;
|
||||||
|
case PROP_SHOW_CONTROLS:
|
||||||
|
panel->show_controls = g_value_get_boolean (value);
|
||||||
|
sokoke_widget_set_visible (panel->labelbar, panel->show_controls);
|
||||||
|
sokoke_widget_set_visible (panel->toolbar, panel->show_controls);
|
||||||
|
break;
|
||||||
case PROP_RIGHT_ALIGNED:
|
case PROP_RIGHT_ALIGNED:
|
||||||
midori_panel_set_right_aligned (panel, g_value_get_boolean (value));
|
midori_panel_set_right_aligned (panel, g_value_get_boolean (value));
|
||||||
break;
|
break;
|
||||||
|
@ -446,6 +499,12 @@ midori_panel_get_property (GObject* object,
|
||||||
case PROP_PAGE:
|
case PROP_PAGE:
|
||||||
g_value_set_int (value, midori_panel_get_current_page (panel));
|
g_value_set_int (value, midori_panel_get_current_page (panel));
|
||||||
break;
|
break;
|
||||||
|
case PROP_SHOW_TITLES:
|
||||||
|
g_value_set_boolean (value, panel->show_titles);
|
||||||
|
break;
|
||||||
|
case PROP_SHOW_CONTROLS:
|
||||||
|
g_value_set_boolean (value, panel->show_controls);
|
||||||
|
break;
|
||||||
case PROP_RIGHT_ALIGNED:
|
case PROP_RIGHT_ALIGNED:
|
||||||
g_value_set_boolean (value, panel->right_aligned);
|
g_value_set_boolean (value, panel->right_aligned);
|
||||||
break;
|
break;
|
||||||
|
@ -476,6 +535,8 @@ midori_panel_new (void)
|
||||||
* @compact: %TRUE if the panel should be compact
|
* @compact: %TRUE if the panel should be compact
|
||||||
*
|
*
|
||||||
* Determines if the panel should be compact.
|
* Determines if the panel should be compact.
|
||||||
|
*
|
||||||
|
* Deprecated: 0.1.9
|
||||||
**/
|
**/
|
||||||
void
|
void
|
||||||
midori_panel_set_compact (MidoriPanel* panel,
|
midori_panel_set_compact (MidoriPanel* panel,
|
||||||
|
@ -483,11 +544,7 @@ midori_panel_set_compact (MidoriPanel* panel,
|
||||||
{
|
{
|
||||||
g_return_if_fail (MIDORI_IS_PANEL (panel));
|
g_return_if_fail (MIDORI_IS_PANEL (panel));
|
||||||
|
|
||||||
#if HAVE_HILDON
|
g_object_set (panel, "show-titles", !compact, NULL);
|
||||||
compact = TRUE;
|
|
||||||
#endif
|
|
||||||
gtk_toolbar_set_style (GTK_TOOLBAR (panel->toolbar),
|
|
||||||
compact ? GTK_TOOLBAR_ICONS : GTK_TOOLBAR_BOTH);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -610,6 +667,54 @@ midori_panel_construct_tool_item (MidoriPanel* panel,
|
||||||
return toolitem;
|
return toolitem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
midori_panel_show_titles_toggled_cb (GtkWidget* menuitem,
|
||||||
|
MidoriPanel* panel)
|
||||||
|
{
|
||||||
|
g_object_set (panel, "show-titles", !panel->show_titles, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
midori_panel_show_controls_toggled_cb (GtkWidget* menuitem,
|
||||||
|
MidoriPanel* panel)
|
||||||
|
{
|
||||||
|
g_object_set (panel, "show-controls", !panel->show_controls, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
midori_panel_options_clicked_cb (GtkToolItem* toolitem,
|
||||||
|
MidoriPanel* panel)
|
||||||
|
{
|
||||||
|
gint n;
|
||||||
|
GtkWidget* viewable;
|
||||||
|
GtkWidget* menu;
|
||||||
|
GtkWidget* menuitem;
|
||||||
|
|
||||||
|
n = midori_panel_get_current_page (panel);
|
||||||
|
viewable = midori_panel_get_nth_page (panel, n);
|
||||||
|
menu = gtk_menu_new ();
|
||||||
|
#if !HAVE_HILDON
|
||||||
|
menuitem = gtk_check_menu_item_new_with_mnemonic (_("Show panel _titles"));
|
||||||
|
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem),
|
||||||
|
panel->show_titles);
|
||||||
|
g_signal_connect (menuitem, "toggled",
|
||||||
|
G_CALLBACK (midori_panel_show_titles_toggled_cb), panel);
|
||||||
|
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
|
||||||
|
gtk_widget_show (menuitem);
|
||||||
|
#endif
|
||||||
|
menuitem = gtk_check_menu_item_new_with_mnemonic (_("Show operating _controls"));
|
||||||
|
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem),
|
||||||
|
panel->show_controls);
|
||||||
|
g_signal_connect (menuitem, "toggled",
|
||||||
|
G_CALLBACK (midori_panel_show_controls_toggled_cb), panel);
|
||||||
|
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
|
||||||
|
gtk_widget_show (menuitem);
|
||||||
|
g_signal_emit_by_name (viewable, "populate-option-menu", menu);
|
||||||
|
|
||||||
|
katze_widget_popup (GTK_WIDGET (toolitem), GTK_MENU (menu),
|
||||||
|
NULL, SOKOKE_MENU_POSITION_LEFT);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* midori_panel_append_page:
|
* midori_panel_append_page:
|
||||||
* @panel: a #MidoriPanel
|
* @panel: a #MidoriPanel
|
||||||
|
@ -636,6 +741,7 @@ midori_panel_append_page (MidoriPanel* panel,
|
||||||
GObjectClass* gobject_class;
|
GObjectClass* gobject_class;
|
||||||
GtkWidget* widget;
|
GtkWidget* widget;
|
||||||
GtkWidget* toolbar;
|
GtkWidget* toolbar;
|
||||||
|
GtkToolItem* toolitem;
|
||||||
const gchar* label;
|
const gchar* label;
|
||||||
guint n;
|
guint n;
|
||||||
|
|
||||||
|
@ -666,6 +772,12 @@ midori_panel_append_page (MidoriPanel* panel,
|
||||||
gtk_container_add (GTK_CONTAINER (panel->notebook), scrolled);
|
gtk_container_add (GTK_CONTAINER (panel->notebook), scrolled);
|
||||||
|
|
||||||
toolbar = midori_viewable_get_toolbar (viewable);
|
toolbar = midori_viewable_get_toolbar (viewable);
|
||||||
|
toolitem = gtk_tool_button_new_from_stock (GTK_STOCK_PROPERTIES);
|
||||||
|
gtk_tool_item_set_tooltip_text (toolitem, _("Options"));
|
||||||
|
g_signal_connect (toolitem, "clicked",
|
||||||
|
G_CALLBACK (midori_panel_options_clicked_cb), panel);
|
||||||
|
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), toolitem, 0);
|
||||||
|
gtk_widget_show (GTK_WIDGET (toolitem));
|
||||||
gtk_widget_show (toolbar);
|
gtk_widget_show (toolbar);
|
||||||
gtk_container_add (GTK_CONTAINER (panel->toolbook), toolbar);
|
gtk_container_add (GTK_CONTAINER (panel->toolbook), toolbar);
|
||||||
g_signal_connect (viewable, "destroy",
|
g_signal_connect (viewable, "destroy",
|
||||||
|
|
|
@ -562,11 +562,9 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
|
||||||
#if !HAVE_HILDON
|
#if !HAVE_HILDON
|
||||||
button = katze_property_proxy (settings, "middle-click-opens-selection", NULL);
|
button = katze_property_proxy (settings, "middle-click-opens-selection", NULL);
|
||||||
INDENTED_ADD (button, 0, 1, 3, 4);
|
INDENTED_ADD (button, 0, 1, 3, 4);
|
||||||
button = katze_property_proxy (settings, "compact-sidepanel", NULL);
|
button = katze_property_proxy (settings, "open-popups-in-tabs", NULL);
|
||||||
WIDGET_ADD (button, 1, 2, 3, 4);
|
SPANNED_ADD (button, 1, 2, 3, 4);
|
||||||
#endif
|
#endif
|
||||||
/* button = katze_property_proxy (settings, "open-popups-in-tabs", NULL);
|
|
||||||
SPANNED_ADD (button, 0, 1, 4, 5);*/
|
|
||||||
button = katze_property_proxy (settings, "open-tabs-next-to-current", NULL);
|
button = katze_property_proxy (settings, "open-tabs-next-to-current", NULL);
|
||||||
WIDGET_ADD (button, 0, 1, 5, 6);
|
WIDGET_ADD (button, 0, 1, 5, 6);
|
||||||
button = katze_property_proxy (settings, "close-buttons-on-tabs", NULL);
|
button = katze_property_proxy (settings, "close-buttons-on-tabs", NULL);
|
||||||
|
|
|
@ -13,6 +13,14 @@
|
||||||
|
|
||||||
#include <glib/gi18n.h>
|
#include <glib/gi18n.h>
|
||||||
|
|
||||||
|
enum {
|
||||||
|
POPULATE_OPTION_MENU,
|
||||||
|
|
||||||
|
LAST_SIGNAL
|
||||||
|
};
|
||||||
|
|
||||||
|
static guint signals[LAST_SIGNAL];
|
||||||
|
|
||||||
static void
|
static void
|
||||||
midori_viewable_base_init (MidoriViewableIface* iface);
|
midori_viewable_base_init (MidoriViewableIface* iface);
|
||||||
|
|
||||||
|
@ -68,6 +76,27 @@ midori_viewable_base_init (MidoriViewableIface* iface)
|
||||||
if (initialized)
|
if (initialized)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MidoriViewable::populate-option-menu:
|
||||||
|
* @viewable: the object on which the signal is emitted
|
||||||
|
* @menu: the #GtkMenu to populate
|
||||||
|
*
|
||||||
|
* Emitted when an Option menu is displayed, for instance
|
||||||
|
* when the user clicks the Options button in the panel.
|
||||||
|
*
|
||||||
|
* Since: 0.1.9
|
||||||
|
*/
|
||||||
|
signals[POPULATE_OPTION_MENU] = g_signal_new (
|
||||||
|
"populate-option-menu",
|
||||||
|
G_TYPE_FROM_INTERFACE (iface),
|
||||||
|
(GSignalFlags)(G_SIGNAL_RUN_LAST),
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
NULL,
|
||||||
|
g_cclosure_marshal_VOID__OBJECT,
|
||||||
|
G_TYPE_NONE, 1,
|
||||||
|
GTK_TYPE_MENU);
|
||||||
|
|
||||||
iface->p = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
|
iface->p = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
|
||||||
|
|
||||||
iface->get_stock_id = midori_viewable_default_get_stock_id;
|
iface->get_stock_id = midori_viewable_default_get_stock_id;
|
||||||
|
@ -258,6 +287,6 @@ midori_viewable_get_toolbar (MidoriViewable* viewable)
|
||||||
|
|
||||||
toolbar = MIDORI_VIEWABLE_GET_IFACE (viewable)->get_toolbar (viewable);
|
toolbar = MIDORI_VIEWABLE_GET_IFACE (viewable)->get_toolbar (viewable);
|
||||||
if (!toolbar)
|
if (!toolbar)
|
||||||
toolbar = gtk_event_box_new ();
|
toolbar = gtk_toolbar_new ();
|
||||||
return toolbar;
|
return toolbar;
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,7 @@ struct _MidoriWebSettings
|
||||||
gboolean search_engines_in_completion;
|
gboolean search_engines_in_completion;
|
||||||
gchar* toolbar_items;
|
gchar* toolbar_items;
|
||||||
gboolean compact_sidepanel;
|
gboolean compact_sidepanel;
|
||||||
|
gboolean show_panel_controls;
|
||||||
gboolean right_align_sidepanel;
|
gboolean right_align_sidepanel;
|
||||||
|
|
||||||
MidoriStartup load_on_startup;
|
MidoriStartup load_on_startup;
|
||||||
|
@ -123,6 +124,7 @@ enum
|
||||||
PROP_SEARCH_ENGINES_IN_COMPLETION,
|
PROP_SEARCH_ENGINES_IN_COMPLETION,
|
||||||
PROP_TOOLBAR_ITEMS,
|
PROP_TOOLBAR_ITEMS,
|
||||||
PROP_COMPACT_SIDEPANEL,
|
PROP_COMPACT_SIDEPANEL,
|
||||||
|
PROP_SHOW_PANEL_CONTROLS,
|
||||||
PROP_RIGHT_ALIGN_SIDEPANEL,
|
PROP_RIGHT_ALIGN_SIDEPANEL,
|
||||||
|
|
||||||
PROP_LOAD_ON_STARTUP,
|
PROP_LOAD_ON_STARTUP,
|
||||||
|
@ -529,6 +531,22 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
|
||||||
FALSE,
|
FALSE,
|
||||||
flags));
|
flags));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MidoriWebSettings:show-panel-controls:
|
||||||
|
*
|
||||||
|
* Whether to show the operating controls of the panel.
|
||||||
|
*
|
||||||
|
* Since: 0.1.9
|
||||||
|
*/
|
||||||
|
g_object_class_install_property (gobject_class,
|
||||||
|
PROP_SHOW_PANEL_CONTROLS,
|
||||||
|
g_param_spec_boolean (
|
||||||
|
"show-panel-controls",
|
||||||
|
_("Show operating controls of the panel"),
|
||||||
|
_("Whether to show the operating controls of the panel"),
|
||||||
|
TRUE,
|
||||||
|
flags));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MidoriWebSettings:right-sidepanel:
|
* MidoriWebSettings:right-sidepanel:
|
||||||
*
|
*
|
||||||
|
@ -1000,6 +1018,7 @@ midori_web_settings_init (MidoriWebSettings* web_settings)
|
||||||
web_settings->notify_transfer_completed = TRUE;
|
web_settings->notify_transfer_completed = TRUE;
|
||||||
web_settings->download_folder = g_strdup (midori_get_download_dir ());
|
web_settings->download_folder = g_strdup (midori_get_download_dir ());
|
||||||
web_settings->http_proxy = NULL;
|
web_settings->http_proxy = NULL;
|
||||||
|
web_settings->show_panel_controls = TRUE;
|
||||||
web_settings->open_popups_in_tabs = TRUE;
|
web_settings->open_popups_in_tabs = TRUE;
|
||||||
web_settings->remember_last_form_inputs = TRUE;
|
web_settings->remember_last_form_inputs = TRUE;
|
||||||
web_settings->remember_last_downloaded_files = TRUE;
|
web_settings->remember_last_downloaded_files = TRUE;
|
||||||
|
@ -1174,6 +1193,9 @@ midori_web_settings_set_property (GObject* object,
|
||||||
case PROP_COMPACT_SIDEPANEL:
|
case PROP_COMPACT_SIDEPANEL:
|
||||||
web_settings->compact_sidepanel = g_value_get_boolean (value);
|
web_settings->compact_sidepanel = g_value_get_boolean (value);
|
||||||
break;
|
break;
|
||||||
|
case PROP_SHOW_PANEL_CONTROLS:
|
||||||
|
web_settings->show_panel_controls = g_value_get_boolean (value);
|
||||||
|
break;
|
||||||
case PROP_RIGHT_ALIGN_SIDEPANEL:
|
case PROP_RIGHT_ALIGN_SIDEPANEL:
|
||||||
web_settings->right_align_sidepanel = g_value_get_boolean (value);
|
web_settings->right_align_sidepanel = g_value_get_boolean (value);
|
||||||
break;
|
break;
|
||||||
|
@ -1386,6 +1408,9 @@ midori_web_settings_get_property (GObject* object,
|
||||||
case PROP_COMPACT_SIDEPANEL:
|
case PROP_COMPACT_SIDEPANEL:
|
||||||
g_value_set_boolean (value, web_settings->compact_sidepanel);
|
g_value_set_boolean (value, web_settings->compact_sidepanel);
|
||||||
break;
|
break;
|
||||||
|
case PROP_SHOW_PANEL_CONTROLS:
|
||||||
|
g_value_set_boolean (value, web_settings->show_panel_controls);
|
||||||
|
break;
|
||||||
case PROP_RIGHT_ALIGN_SIDEPANEL:
|
case PROP_RIGHT_ALIGN_SIDEPANEL:
|
||||||
g_value_set_boolean (value, web_settings->right_align_sidepanel);
|
g_value_set_boolean (value, web_settings->right_align_sidepanel);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue