GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
#endif
NULL);
- #if GTK_CHECK_VERSION (3, 0, 0)
- gtk_style_context_add_class (gtk_widget_get_style_context (
- gtk_dialog_get_widget_for_response (GTK_DIALOG (dialog),
- GTK_RESPONSE_HELP)), "help_button");
- #endif
+ katze_widget_add_class (gtk_dialog_get_widget_for_response (
+ GTK_DIALOG (dialog), GTK_RESPONSE_HELP), "help_button");
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
g_signal_connect (dialog, "destroy",
G_CALLBACK (gtk_widget_destroyed), &dialog);
gtk_dialog_add_buttons (GTK_DIALOG (preferences),
GTK_STOCK_HELP, GTK_RESPONSE_HELP,
NULL);
- #if GTK_CHECK_VERSION (3, 0, 0)
- gtk_style_context_add_class (gtk_widget_get_style_context (
- gtk_dialog_get_widget_for_response (GTK_DIALOG (preferences),
- GTK_RESPONSE_HELP)), "help_button");
- #endif
+ katze_widget_add_class (gtk_dialog_get_widget_for_response (
+ GTK_DIALOG (preferences), GTK_RESPONSE_HELP), "help_button");
gtk_dialog_add_buttons (GTK_DIALOG (preferences),
#if HAVE_HILDON
return entry;
}
+void
+katze_widget_add_class (GtkWidget* widget,
+ const gchar* class_name)
+{
+ #if GTK_CHECK_VERSION (3,0,0)
+ GtkStyleContext* context = gtk_widget_get_style_context (widget);
+ gtk_style_context_add_class (context, class_name);
+ #endif
+}
+
/**
* katze_assert_str_equal:
* @input: a string
GtkWidget*
katze_uri_entry_new (GtkWidget* other_widget);
+void
+katze_widget_add_class (GtkWidget* widget,
+ const gchar* class_name);
+
void
katze_assert_str_equal (const gchar* input,
const gchar* result,
GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
_("_Clear private data"), GTK_RESPONSE_ACCEPT, NULL);
- #if GTK_CHECK_VERSION (3, 0, 0)
- gtk_style_context_add_class (gtk_widget_get_style_context (
- gtk_dialog_get_widget_for_response (GTK_DIALOG (dialog),
- GTK_RESPONSE_ACCEPT)), "noundo");
- #endif
+ katze_widget_add_class (gtk_dialog_get_widget_for_response (
+ GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT), "noundo");
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dialog), FALSE);
screen = gtk_widget_get_screen (GTK_WIDGET (browser));
/* Create the navigationbar */
browser->navigationbar = gtk_ui_manager_get_widget (
ui_manager, "/toolbar_navigation");
-#if GTK_CHECK_VERSION(3,0,0)
- gtk_style_context_add_class(gtk_widget_get_style_context(browser->navigationbar), "primary-toolbar");
-#endif
+ katze_widget_add_class (browser->navigationbar, "primary-toolbar");
/* FIXME: Settings should be connected with screen changes */
gtk_settings = gtk_widget_get_settings (GTK_WIDGET (browser));
if (gtk_settings)
/* Bookmarkbar */
browser->bookmarkbar = gtk_toolbar_new ();
-#if GTK_CHECK_VERSION (3, 0, 0)
- gtk_style_context_add_class (
- gtk_widget_get_style_context (browser->bookmarkbar), "secondary-toolbar");
-#endif
+ katze_widget_add_class (browser->bookmarkbar, "secondary-toolbar");
gtk_widget_set_name (browser->bookmarkbar, "MidoriBookmarkbar");
gtk_toolbar_set_icon_size (GTK_TOOLBAR (browser->bookmarkbar),
GTK_ICON_SIZE_MENU);
/* Create the titlebar */
labelbar = gtk_toolbar_new ();
+ katze_widget_add_class (labelbar, "secondary-toolbar");
panel->labelbar = labelbar;
gtk_toolbar_set_icon_size (GTK_TOOLBAR (labelbar), GTK_ICON_SIZE_MENU);
gtk_toolbar_set_style (GTK_TOOLBAR (labelbar), GTK_TOOLBAR_ICONS);
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
#endif
NULL);
- #if GTK_CHECK_VERSION (3, 0, 0)
- gtk_style_context_add_class (gtk_widget_get_style_context (
- gtk_dialog_get_widget_for_response (GTK_DIALOG (dialog),
- GTK_RESPONSE_HELP)), "help_button");
- #endif
+ katze_widget_add_class (gtk_dialog_get_widget_for_response (
+ GTK_DIALOG (dialog), GTK_RESPONSE_HELP), "help_button");
g_signal_connect (dialog, "destroy",
G_CALLBACK (gtk_widget_destroyed), &search_action->dialog);
gtk_window_set_icon_name (GTK_WINDOW (dialog), GTK_STOCK_PROPERTIES);
GtkToolItem* toolitem;
gtk_widget_set_name (GTK_WIDGET (findbar), "MidoriFindbar");
- #if GTK_CHECK_VERSION (3, 0, 0)
- gtk_style_context_add_class (
- gtk_widget_get_style_context (GTK_WIDGET (findbar)), "bottom-toolbar");
- #endif
+ katze_widget_add_class (GTK_WIDGET (findbar), "bottom-toolbar");
gtk_toolbar_set_icon_size (GTK_TOOLBAR (findbar), GTK_ICON_SIZE_MENU);
gtk_toolbar_set_style (GTK_TOOLBAR (findbar), GTK_TOOLBAR_BOTH_HORIZ);
gtk_toolbar_set_show_arrow (GTK_TOOLBAR (findbar), FALSE);