Turn browser action helpers into macros
This commit is contained in:
parent
88becdd669
commit
e5c65a160c
1 changed files with 9 additions and 31 deletions
|
@ -205,37 +205,15 @@ midori_search_action_get_icon (KatzeItem* item,
|
||||||
static void
|
static void
|
||||||
_midori_browser_find_done (MidoriBrowser* browser);
|
_midori_browser_find_done (MidoriBrowser* browser);
|
||||||
|
|
||||||
static GtkAction*
|
#define _action_by_name(brwsr, nme) \
|
||||||
_action_by_name (MidoriBrowser* browser,
|
gtk_action_group_get_action (brwsr->action_group, nme)
|
||||||
const gchar* name)
|
#define _action_set_sensitive(brwsr, nme, snstv) \
|
||||||
{
|
gtk_action_set_sensitive (_action_by_name (brwsr, nme), snstv);
|
||||||
return gtk_action_group_get_action (browser->action_group, name);
|
#define _action_set_visible(brwsr, nme, vsbl) \
|
||||||
}
|
gtk_action_set_visible (_action_by_name (brwsr, nme), vsbl);
|
||||||
|
#define _action_set_active(brwsr, nme, actv) \
|
||||||
static void
|
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION ( \
|
||||||
_action_set_sensitive (MidoriBrowser* browser,
|
_action_by_name (brwsr, nme)), actv);
|
||||||
const gchar* name,
|
|
||||||
gboolean sensitive)
|
|
||||||
{
|
|
||||||
gtk_action_set_sensitive (_action_by_name (browser, name), sensitive);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_action_set_visible (MidoriBrowser* browser,
|
|
||||||
const gchar* name,
|
|
||||||
gboolean visible)
|
|
||||||
{
|
|
||||||
gtk_action_set_visible (_action_by_name (browser, name), visible);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_action_set_active (MidoriBrowser* browser,
|
|
||||||
const gchar* name,
|
|
||||||
gboolean active)
|
|
||||||
{
|
|
||||||
GtkAction* action = _action_by_name (browser, name);
|
|
||||||
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), active);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_toggle_tabbar_smartly (MidoriBrowser* browser)
|
_toggle_tabbar_smartly (MidoriBrowser* browser)
|
||||||
|
|
Loading…
Reference in a new issue