summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn-Mark Bell <jmb@netsurf-browser.org>2015-02-24 14:04:12 (GMT)
committer John-Mark Bell <jmb@netsurf-browser.org>2015-02-24 14:13:58 (GMT)
commit4c1e16c0772faaf074c19e278d569d70f5951827 (patch)
tree52f81bdd5d62a31b0b39123825feb75c21e3a2b4
parent5f0964fa0936764a1b9ba692f8f33086e280c0c3 (diff)
downloadnetsurf-jmb/gtk3hacks.tar.gz
netsurf-jmb/gtk3hacks.tar.bz2
Partially fix usage of APIs deprecated in GTK3.jmb/gtk3hacks
-rw-r--r--gtk/about.c17
-rw-r--r--gtk/compat.c38
-rw-r--r--gtk/compat.h3
-rw-r--r--gtk/download.c12
-rw-r--r--gtk/history.c4
-rw-r--r--gtk/hotlist.c4
-rw-r--r--gtk/menu.c4
-rw-r--r--gtk/menu.h146
-rw-r--r--gtk/preferences.c4
-rw-r--r--gtk/scaffolding.c20
-rw-r--r--gtk/scaffolding.h6
-rw-r--r--gtk/sexy_icon_entry.c10
-rw-r--r--gtk/theme.c25
13 files changed, 145 insertions, 148 deletions
diff --git a/gtk/about.c b/gtk/about.c
index 27c164a..aa9a14b 100644
--- a/gtk/about.c
+++ b/gtk/about.c
@@ -68,7 +68,7 @@ nsgtk_about_dialog_info(GtkWidget *button, gpointer data)
void nsgtk_about_dialog_init(GtkWindow *parent)
{
- GtkWidget *dialog, *vbox, *button, *image, *label;
+ GtkWidget *dialog, *vbox, *button, *label;
gchar *name_string;
GList *pixbufs = gtk_window_get_default_icon_list();
@@ -79,6 +79,7 @@ void nsgtk_about_dialog_init(GtkWindow *parent)
dialog = gtk_dialog_new_with_buttons("About NetSurf",
parent,
GTK_DIALOG_DESTROY_WITH_PARENT,
+ NULL,
NULL);
vbox = nsgtk_vbox_new(FALSE, 8);
@@ -86,14 +87,8 @@ void nsgtk_about_dialog_init(GtkWindow *parent)
gtk_box_pack_start(GTK_BOX(nsgtk_dialog_get_content_area(GTK_DIALOG(dialog))), vbox, TRUE, TRUE, 0);
if (pixbufs != NULL) {
- GtkIconSet *icon_set = gtk_icon_set_new_from_pixbuf(GDK_PIXBUF(g_list_nth_data(pixbufs, 0)));
+ GtkWidget *image = gtk_image_new_from_pixbuf(GDK_PIXBUF(pixbufs->data));
- image = gtk_image_new();
-
- gtk_image_set_from_icon_set (GTK_IMAGE (image),
- icon_set, GTK_ICON_SIZE_DIALOG);
-
- gtk_icon_set_unref (icon_set);
g_list_free (pixbufs);
gtk_box_pack_start(GTK_BOX (vbox), image, FALSE, FALSE, 0);
@@ -122,18 +117,18 @@ void nsgtk_about_dialog_init(GtkWindow *parent)
nsgtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
/* Add the OK button */
- gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
+ gtk_dialog_add_button(GTK_DIALOG(dialog), "_Close", GTK_RESPONSE_CLOSE);
gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_CLOSE);
/* Add the credits button */
- button = gtk_button_new_from_stock ("Credits");
+ button = gtk_button_new_with_label ("Credits");
gtk_box_pack_end(GTK_BOX(nsgtk_dialog_get_action_area(GTK_DIALOG(dialog))),
button, FALSE, TRUE, 0);
gtk_button_box_set_child_secondary (GTK_BUTTON_BOX(nsgtk_dialog_get_action_area(GTK_DIALOG(dialog))), button, TRUE);
g_signal_connect(button, "clicked", G_CALLBACK(nsgtk_about_dialog_info), (gpointer)"about:credits");
/* Add the Licence button */
- button = gtk_button_new_from_stock ("Licence");
+ button = gtk_button_new_with_label ("Licence");
gtk_box_pack_end(GTK_BOX (nsgtk_dialog_get_action_area(GTK_DIALOG(dialog))),
button, FALSE, TRUE, 0);
gtk_button_box_set_child_secondary (GTK_BUTTON_BOX(nsgtk_dialog_get_action_area(GTK_DIALOG(dialog))), button, TRUE);
diff --git a/gtk/compat.c b/gtk/compat.c
index 5f4c641..9884991 100644
--- a/gtk/compat.c
+++ b/gtk/compat.c
@@ -85,15 +85,6 @@ gboolean nsgtk_widget_is_drawable(GtkWidget *widget)
#endif
}
-GtkStateType nsgtk_widget_get_state(GtkWidget *widget)
-{
- #if GTK_CHECK_VERSION(2,18,0)
- return gtk_widget_get_state(widget);
- #else
- return GTK_WIDGET_STATE(widget);
- #endif
-}
-
void nsgtk_dialog_set_has_separator(GtkDialog *dialog, gboolean setting)
{
#if GTK_CHECK_VERSION(2,21,8)
@@ -161,7 +152,7 @@ void nsgtk_entry_set_icon_from_pixbuf(GtkWidget *entry, GtkEntryIconPosition ico
void nsgtk_entry_set_icon_from_stock(GtkWidget *entry, GtkEntryIconPosition icon_pos, const gchar *stock_id)
{
#if GTK_CHECK_VERSION(2,16,0)
- gtk_entry_set_icon_from_stock(GTK_ENTRY(entry), icon_pos, stock_id);
+ gtk_entry_set_icon_from_icon_name(GTK_ENTRY(entry), icon_pos, stock_id);
#else
GtkImage *image = GTK_IMAGE(gtk_image_new_from_stock(stock_id,
GTK_ICON_SIZE_LARGE_TOOLBAR));
@@ -286,7 +277,11 @@ GtkStyleContext *nsgtk_widget_get_style_context(GtkWidget *widget)
const PangoFontDescription* nsgtk_style_context_get_font(GtkStyleContext *style, GtkStateFlags state)
{
#if GTK_CHECK_VERSION(3,0,0)
- return gtk_style_context_get_font(style, state);
+ const PangoFontDescription *font = NULL;
+
+ gtk_style_context_get(style, state, "font", &font, NULL);
+
+ return font;
#else
return style->font_desc;
#endif
@@ -412,3 +407,24 @@ void nsgtk_widget_get_allocation(GtkWidget *widget, GtkAllocation *allocation)
allocation->height = widget->allocation.height;
#endif
}
+
+void nsgtk_window_set_opacity(GtkWindow *window, gdouble opacity)
+{
+#if GTK_CHECK_VERSION(3,8,0)
+ gtk_widget_set_opacity(GTK_WIDGET(window), opacity);
+#else
+ gtk_window_set_opacity(window, opacity);
+#endif
+}
+
+void nsgtk_scrolled_window_add_with_viewport(GtkScrolledWindow *window,
+ GtkWidget *child)
+{
+#if GTK_CHECK_VERSION(3,8,0)
+ gtk_container_add(GTK_CONTAINER(window), child);
+#else
+ gtk_scrolled_window_add_with_viewport(window, child);
+#endif
+}
+
+
diff --git a/gtk/compat.h b/gtk/compat.h
index ee2ebb2..9481296 100644
--- a/gtk/compat.h
+++ b/gtk/compat.h
@@ -33,7 +33,6 @@ gboolean nsgtk_widget_get_visible(GtkWidget *widget);
gboolean nsgtk_widget_get_realized(GtkWidget *widget);
gboolean nsgtk_widget_get_mapped(GtkWidget *widget);
gboolean nsgtk_widget_is_drawable(GtkWidget *widget);
-GtkStateType nsgtk_widget_get_state(GtkWidget *widget);
void nsgtk_dialog_set_has_separator(GtkDialog *dialog, gboolean setting);
GtkWidget *nsgtk_combo_box_text_new(void);
void nsgtk_combo_box_text_append_text(GtkWidget *combo_box, const gchar *text);
@@ -89,6 +88,8 @@ GtkWidget *nsgtk_dialog_get_content_area(GtkDialog *dialog);
gboolean nsgtk_show_uri(GdkScreen *screen, const gchar *uri, guint32 timestamp, GError **error);
GdkWindow *nsgtk_layout_get_bin_window(GtkLayout *layout);
void nsgtk_widget_get_allocation(GtkWidget *widget, GtkAllocation *allocation);
+void nsgtk_window_set_opacity(GtkWindow *window, gdouble opacity);
+void nsgtk_scrolled_window_add_with_viewport(GtkScrolledWindow *window, GtkWidget *child);
GtkAdjustment *nsgtk_layout_get_vadjustment(GtkLayout *layout);
GtkAdjustment *nsgtk_layout_get_hadjustment(GtkLayout *layout);
diff --git a/gtk/download.c b/gtk/download.c
index d2588ed..8a147e3 100644
--- a/gtk/download.c
+++ b/gtk/download.c
@@ -595,9 +595,9 @@ static gchar* nsgtk_download_dialog_show (const gchar *filename, const gchar *do
"\n\n<small>%s</small>",
message, info);
- gtk_dialog_add_buttons(GTK_DIALOG(dialog), GTK_STOCK_SAVE,
- GTK_RESPONSE_DOWNLOAD, GTK_STOCK_CANCEL,
- GTK_RESPONSE_CANCEL, GTK_STOCK_SAVE_AS,
+ gtk_dialog_add_buttons(GTK_DIALOG(dialog), "_Save",
+ GTK_RESPONSE_DOWNLOAD, "_Cancel",
+ GTK_RESPONSE_CANCEL, "Save _As",
GTK_RESPONSE_SAVE_AS, NULL);
gint result = gtk_dialog_run(GTK_DIALOG(dialog));
@@ -611,8 +611,8 @@ static gchar* nsgtk_download_dialog_show (const gchar *filename, const gchar *do
(messages_get("gtkSave"),
nsgtk_download_parent,
GTK_FILE_CHOOSER_ACTION_SAVE,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
+ "_Cancel", GTK_RESPONSE_CANCEL,
+ "_Save", GTK_RESPONSE_ACCEPT,
NULL);
gtk_file_chooser_set_current_name
(GTK_FILE_CHOOSER(dialog), filename);
@@ -664,7 +664,7 @@ static gchar* nsgtk_download_dialog_show (const gchar *filename, const gchar *do
"_Replace",
GTK_RESPONSE_DOWNLOAD);
gtk_button_set_image(GTK_BUTTON(button),
- gtk_image_new_from_stock(
+ gtk_image_new_from_icon_name(
"gtk-save",
GTK_ICON_SIZE_BUTTON));
diff --git a/gtk/history.c b/gtk/history.c
index 2cf1438..f0fb5f8 100644
--- a/gtk/history.c
+++ b/gtk/history.c
@@ -171,8 +171,8 @@ MENUHANDLER(export)
save_dialog = gtk_file_chooser_dialog_new("Save File",
wndHistory,
GTK_FILE_CHOOSER_ACTION_SAVE,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
+ "_Cancel", GTK_RESPONSE_CANCEL,
+ "_Save", GTK_RESPONSE_ACCEPT,
NULL);
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(save_dialog),
diff --git a/gtk/hotlist.c b/gtk/hotlist.c
index 0c98bd9..f86edab 100644
--- a/gtk/hotlist.c
+++ b/gtk/hotlist.c
@@ -178,8 +178,8 @@ MENUHANDLER(export)
save_dialog = gtk_file_chooser_dialog_new("Save File",
wndHotlist,
GTK_FILE_CHOOSER_ACTION_SAVE,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
+ "_Cancel", GTK_RESPONSE_CANCEL,
+ "_Save", GTK_RESPONSE_ACCEPT,
NULL);
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(save_dialog),
diff --git a/gtk/menu.c b/gtk/menu.c
index 8b684d6..b0174fd 100644
--- a/gtk/menu.c
+++ b/gtk/menu.c
@@ -35,12 +35,12 @@
*/
static bool nsgtk_menu_add_image_item(GtkMenu *menu,
- GtkImageMenuItem **item, const char *message,
+ GtkMenuItem **item, const char *message,
const char *messageAccel, GtkAccelGroup *group)
{
unsigned int key;
GdkModifierType mod;
- *item = GTK_IMAGE_MENU_ITEM(gtk_image_menu_item_new_with_mnemonic(
+ *item = GTK_MENU_ITEM(gtk_menu_item_new_with_mnemonic(
messages_get(message)));
if (*item == NULL)
return false;
diff --git a/gtk/menu.h b/gtk/menu.h
index b14c0bb..ab3d1df 100644
--- a/gtk/menu.h
+++ b/gtk/menu.h
@@ -23,100 +23,100 @@
struct nsgtk_file_menu {
GtkMenuItem *file; /* File menu item on menubar */
GtkMenu *file_menu;
- GtkImageMenuItem *newwindow_menuitem;
- GtkImageMenuItem *newtab_menuitem;
- GtkImageMenuItem *openfile_menuitem;
- GtkImageMenuItem *closewindow_menuitem;
- GtkImageMenuItem *savepage_menuitem;
- GtkImageMenuItem *export_menuitem;
+ GtkMenuItem *newwindow_menuitem;
+ GtkMenuItem *newtab_menuitem;
+ GtkMenuItem *openfile_menuitem;
+ GtkMenuItem *closewindow_menuitem;
+ GtkMenuItem *savepage_menuitem;
+ GtkMenuItem *export_menuitem;
struct nsgtk_export_submenu *export_submenu;
- GtkImageMenuItem *printpreview_menuitem;
- GtkImageMenuItem *print_menuitem;
- GtkImageMenuItem *quit_menuitem;
+ GtkMenuItem *printpreview_menuitem;
+ GtkMenuItem *print_menuitem;
+ GtkMenuItem *quit_menuitem;
};
struct nsgtk_edit_menu {
GtkMenuItem *edit; /* Edit menu item on menubar */
GtkMenu *edit_menu;
- GtkImageMenuItem *cut_menuitem;
- GtkImageMenuItem *copy_menuitem;
- GtkImageMenuItem *paste_menuitem;
- GtkImageMenuItem *delete_menuitem;
- GtkImageMenuItem *selectall_menuitem;
- GtkImageMenuItem *find_menuitem;
- GtkImageMenuItem *preferences_menuitem;
+ GtkMenuItem *cut_menuitem;
+ GtkMenuItem *copy_menuitem;
+ GtkMenuItem *paste_menuitem;
+ GtkMenuItem *delete_menuitem;
+ GtkMenuItem *selectall_menuitem;
+ GtkMenuItem *find_menuitem;
+ GtkMenuItem *preferences_menuitem;
};
struct nsgtk_view_menu {
GtkMenuItem *view; /* View menu item on menubar */
GtkMenu *view_menu; /* gtk menu attached to menu item */
- GtkImageMenuItem *stop_menuitem;
- GtkImageMenuItem *reload_menuitem;
- GtkImageMenuItem *scaleview_menuitem;
+ GtkMenuItem *stop_menuitem;
+ GtkMenuItem *reload_menuitem;
+ GtkMenuItem *scaleview_menuitem;
struct nsgtk_scaleview_submenu *scaleview_submenu;
- GtkImageMenuItem *fullscreen_menuitem;
- GtkImageMenuItem *images_menuitem;
+ GtkMenuItem *fullscreen_menuitem;
+ GtkMenuItem *images_menuitem;
struct nsgtk_images_submenu *images_submenu;
- GtkImageMenuItem *toolbars_menuitem;
+ GtkMenuItem *toolbars_menuitem;
struct nsgtk_toolbars_submenu *toolbars_submenu;
- GtkImageMenuItem *tabs_menuitem;
+ GtkMenuItem *tabs_menuitem;
struct nsgtk_tabs_submenu *tabs_submenu;
- GtkImageMenuItem *savewindowsize_menuitem;
+ GtkMenuItem *savewindowsize_menuitem;
};
struct nsgtk_nav_menu {
GtkMenuItem *nav; /* Nav menu item on menubar */
GtkMenu *nav_menu;
- GtkImageMenuItem *back_menuitem;
- GtkImageMenuItem *forward_menuitem;
- GtkImageMenuItem *home_menuitem;
- GtkImageMenuItem *localhistory_menuitem;
- GtkImageMenuItem *globalhistory_menuitem;
- GtkImageMenuItem *addbookmarks_menuitem;
- GtkImageMenuItem *showbookmarks_menuitem;
- GtkImageMenuItem *openlocation_menuitem;
+ GtkMenuItem *back_menuitem;
+ GtkMenuItem *forward_menuitem;
+ GtkMenuItem *home_menuitem;
+ GtkMenuItem *localhistory_menuitem;
+ GtkMenuItem *globalhistory_menuitem;
+ GtkMenuItem *addbookmarks_menuitem;
+ GtkMenuItem *showbookmarks_menuitem;
+ GtkMenuItem *openlocation_menuitem;
};
struct nsgtk_tools_menu {
GtkMenuItem *tools; /* Tools menu item on menubar */
GtkMenu *tools_menu;
- GtkImageMenuItem *showcookies_menuitem;
- GtkImageMenuItem *downloads_menuitem;
- GtkImageMenuItem *developer_menuitem;
+ GtkMenuItem *showcookies_menuitem;
+ GtkMenuItem *downloads_menuitem;
+ GtkMenuItem *developer_menuitem;
struct nsgtk_developer_submenu *developer_submenu;
};
struct nsgtk_help_menu {
GtkMenuItem *help; /* Help menu item on menubar */
GtkMenu *help_menu;
- GtkImageMenuItem *contents_menuitem;
- GtkImageMenuItem *guide_menuitem;
- GtkImageMenuItem *info_menuitem;
- GtkImageMenuItem *about_menuitem;
+ GtkMenuItem *contents_menuitem;
+ GtkMenuItem *guide_menuitem;
+ GtkMenuItem *info_menuitem;
+ GtkMenuItem *about_menuitem;
};
struct nsgtk_export_submenu {
GtkMenu *export_menu;
- GtkImageMenuItem *plaintext_menuitem;
- GtkImageMenuItem *drawfile_menuitem;
- GtkImageMenuItem *postscript_menuitem;
- GtkImageMenuItem *pdf_menuitem;
+ GtkMenuItem *plaintext_menuitem;
+ GtkMenuItem *drawfile_menuitem;
+ GtkMenuItem *postscript_menuitem;
+ GtkMenuItem *pdf_menuitem;
};
struct nsgtk_scaleview_submenu {
GtkMenu *scaleview_menu;
- GtkImageMenuItem *zoomplus_menuitem;
- GtkImageMenuItem *zoomminus_menuitem;
- GtkImageMenuItem *zoomnormal_menuitem;
+ GtkMenuItem *zoomplus_menuitem;
+ GtkMenuItem *zoomminus_menuitem;
+ GtkMenuItem *zoomnormal_menuitem;
};
struct nsgtk_tabs_submenu {
GtkMenu *tabs_menu;
- GtkImageMenuItem *nexttab_menuitem;
- GtkImageMenuItem *prevtab_menuitem;
- GtkImageMenuItem *closetab_menuitem;
+ GtkMenuItem *nexttab_menuitem;
+ GtkMenuItem *prevtab_menuitem;
+ GtkMenuItem *closetab_menuitem;
};
struct nsgtk_images_submenu {
@@ -134,10 +134,10 @@ struct nsgtk_toolbars_submenu {
struct nsgtk_developer_submenu {
GtkMenu *developer_menu;
- GtkImageMenuItem *viewsource_menuitem;
- GtkImageMenuItem *toggledebugging_menuitem;
- GtkImageMenuItem *debugboxtree_menuitem;
- GtkImageMenuItem *debugdomtree_menuitem;
+ GtkMenuItem *viewsource_menuitem;
+ GtkMenuItem *toggledebugging_menuitem;
+ GtkMenuItem *debugboxtree_menuitem;
+ GtkMenuItem *debugdomtree_menuitem;
};
@@ -155,55 +155,55 @@ struct nsgtk_bar_submenu {
struct nsgtk_popup_menu {
GtkMenu *popup_menu;
- GtkImageMenuItem *file_menuitem;
+ GtkMenuItem *file_menuitem;
struct nsgtk_file_menu *file_submenu;
- GtkImageMenuItem *edit_menuitem;
+ GtkMenuItem *edit_menuitem;
struct nsgtk_edit_menu *edit_submenu;
- GtkImageMenuItem *view_menuitem;
+ GtkMenuItem *view_menuitem;
struct nsgtk_view_menu *view_submenu;
- GtkImageMenuItem *nav_menuitem;
+ GtkMenuItem *nav_menuitem;
struct nsgtk_nav_menu *nav_submenu;
- GtkImageMenuItem *tabs_menuitem;
+ GtkMenuItem *tabs_menuitem;
struct nsgtk_tabs_submenu *tabs_submenu;
- GtkImageMenuItem *tools_menuitem;
+ GtkMenuItem *tools_menuitem;
struct nsgtk_tools_menu *tools_submenu;
- GtkImageMenuItem *help_menuitem;
+ GtkMenuItem *help_menuitem;
struct nsgtk_help_menu *help_submenu;
GtkWidget *first_separator;
/* navigation entries */
- GtkImageMenuItem *back_menuitem;
- GtkImageMenuItem *forward_menuitem;
+ GtkMenuItem *back_menuitem;
+ GtkMenuItem *forward_menuitem;
GtkWidget *third_separator;
/* view entries */
- GtkImageMenuItem *stop_menuitem;
- GtkImageMenuItem *reload_menuitem;
+ GtkMenuItem *stop_menuitem;
+ GtkMenuItem *reload_menuitem;
- GtkImageMenuItem *cut_menuitem;
- GtkImageMenuItem *copy_menuitem;
- GtkImageMenuItem *paste_menuitem;
- GtkImageMenuItem *customize_menuitem;
+ GtkMenuItem *cut_menuitem;
+ GtkMenuItem *copy_menuitem;
+ GtkMenuItem *paste_menuitem;
+ GtkMenuItem *customize_menuitem;
};
struct nsgtk_link_menu {
GtkMenu *link_menu;
- GtkImageMenuItem *opentab_menuitem;
- GtkImageMenuItem *openwin_menuitem;
+ GtkMenuItem *opentab_menuitem;
+ GtkMenuItem *openwin_menuitem;
- GtkImageMenuItem *save_menuitem;
- GtkImageMenuItem *bookmark_menuitem;
- GtkImageMenuItem *copy_menuitem;
+ GtkMenuItem *save_menuitem;
+ GtkMenuItem *bookmark_menuitem;
+ GtkMenuItem *copy_menuitem;
};
/**
diff --git a/gtk/preferences.c b/gtk/preferences.c
index 0255b4b..9c572ad 100644
--- a/gtk/preferences.c
+++ b/gtk/preferences.c
@@ -712,9 +712,9 @@ nsgtk_preferences_buttonAddTheme_clicked(GtkButton *button, struct ppref *priv)
fc = gtk_file_chooser_dialog_new(messages_get("gtkAddThemeTitle"),
GTK_WINDOW(priv->dialog),
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
- GTK_STOCK_OK,
+ "_OK",
GTK_RESPONSE_ACCEPT,
- GTK_STOCK_CANCEL,
+ "_Cancel",
GTK_RESPONSE_CANCEL,
NULL);
len = SLEN("themes") + strlen(res_dir_location) + 1;
diff --git a/gtk/scaffolding.c b/gtk/scaffolding.c
index b204dbe..d9afb8b 100644
--- a/gtk/scaffolding.c
+++ b/gtk/scaffolding.c
@@ -590,7 +590,7 @@ MULTIHANDLER(openfile)
scaf_current = g;
GtkWidget *dlgOpen = gtk_file_chooser_dialog_new("Open File",
scaf_current->window, GTK_FILE_CHOOSER_ACTION_OPEN,
- GTK_STOCK_CANCEL, -6, GTK_STOCK_OPEN, -5, NULL);
+ "_Cancel", -6, "_Open", -5, NULL);
gint response = gtk_dialog_run(GTK_DIALOG(dlgOpen));
if (response == GTK_RESPONSE_OK) {
@@ -624,8 +624,8 @@ MULTIHANDLER(savepage)
GtkWidget *fc = gtk_file_chooser_dialog_new(
messages_get("gtkcompleteSave"), g->window,
GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
+ "_Cancel", GTK_RESPONSE_CANCEL,
+ "_Save", GTK_RESPONSE_ACCEPT,
NULL);
DIR *d;
char *path;
@@ -720,8 +720,8 @@ MULTIHANDLER(pdf)
save_dialog = gtk_file_chooser_dialog_new("Export to PDF", g->window,
GTK_FILE_CHOOSER_ACTION_SAVE,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
+ "_Cancel", GTK_RESPONSE_CANCEL,
+ "_Save", GTK_RESPONSE_ACCEPT,
NULL);
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(save_dialog),
@@ -764,8 +764,8 @@ MULTIHANDLER(plaintext)
GtkWidget *fc = gtk_file_chooser_dialog_new(
messages_get("gtkplainSave"), g->window,
GTK_FILE_CHOOSER_ACTION_SAVE,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
+ "_Cancel", GTK_RESPONSE_CANCEL,
+ "_Save", GTK_RESPONSE_ACCEPT,
NULL);
char *filename;
nserror res;
@@ -1456,7 +1456,7 @@ MULTIHANDLER(localhistory)
-1, -1);
gtk_window_resize(g->history_window->window, width, height);
gtk_window_set_transient_for(g->history_window->window, g->window);
- gtk_window_set_opacity(g->history_window->window, 0.9);
+ nsgtk_window_set_opacity(g->history_window->window, 0.9);
gtk_widget_show(GTK_WIDGET(g->history_window->window));
gtk_window_move(g->history_window->window, x + g->historybase, y +
g->toolbarbase);
@@ -1846,7 +1846,7 @@ static void nsgtk_scaffolding_toolbar_init(struct nsgtk_scaffolding *g)
nsgtk_toolbar_##q##_toolbar_button_data
#define ITEM_POP(p, q) \
- g->buttons[p##_BUTTON]->popup = GTK_IMAGE_MENU_ITEM(\
+ g->buttons[p##_BUTTON]->popup = GTK_MENU_ITEM(\
g->menu_popup->q##_menuitem)
#define SENSITIVITY(q) \
@@ -2160,7 +2160,7 @@ struct nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel)
nsgtk_widget_override_background_color(GTK_WIDGET(g->history_window->drawing_area),
GTK_STATE_NORMAL,
0, 0xffff, 0xffff, 0xffff);
- gtk_scrolled_window_add_with_viewport(g->history_window->scrolled,
+ nsgtk_scrolled_window_add_with_viewport(g->history_window->scrolled,
GTK_WIDGET(g->history_window->drawing_area));
gtk_widget_show(GTK_WIDGET(g->history_window->drawing_area));
diff --git a/gtk/scaffolding.h b/gtk/scaffolding.h
index 887d658..098344f 100644
--- a/gtk/scaffolding.h
+++ b/gtk/scaffolding.h
@@ -104,9 +104,9 @@ struct nsgtk_button_connect {
GtkToolItem *button;
int location; /* in toolbar */
bool sensitivity;
- GtkImageMenuItem *main;
- GtkImageMenuItem *rclick;
- GtkImageMenuItem *popup;
+ GtkMenuItem *main;
+ GtkMenuItem *rclick;
+ GtkMenuItem *popup;
void *mhandler; /* menu item clicked */
void *bhandler; /* button clicked */
void *dataplus; /* customization -> toolbar */
diff --git a/gtk/sexy_icon_entry.c b/gtk/sexy_icon_entry.c
index b2899b1..c0385ea 100644
--- a/gtk/sexy_icon_entry.c
+++ b/gtk/sexy_icon_entry.c
@@ -90,6 +90,16 @@ G_DEFINE_TYPE_EXTENDED(SexyIconEntry, sexy_icon_entry, GTK_TYPE_ENTRY,
G_IMPLEMENT_INTERFACE(GTK_TYPE_EDITABLE,
sexy_icon_entry_editable_init));
+
+static GtkStateType nsgtk_widget_get_state(GtkWidget *widget)
+{
+ #if GTK_CHECK_VERSION(2,18,0)
+ return gtk_widget_get_state(widget);
+ #else
+ return GTK_WIDGET_STATE(widget);
+ #endif
+}
+
void
sexy_icon_entry_class_init(SexyIconEntryClass *klass)
{
diff --git a/gtk/theme.c b/gtk/theme.c
index 9e673da..9b1d3db 100644
--- a/gtk/theme.c
+++ b/gtk/theme.c
@@ -309,31 +309,6 @@ void nsgtk_theme_implement(struct nsgtk_scaffolding *g)
button = nsgtk_scaffolding_button(g, i);
if (button == NULL)
continue;
- /* gtk_image_menu_item_set_image accepts NULL image */
- if ((button->main != NULL) &&
- (theme[IMAGE_SET_MAIN_MENU] != NULL)) {
- gtk_image_menu_item_set_image(button->main,
- GTK_WIDGET(
- theme[IMAGE_SET_MAIN_MENU]->
- image[i]));
- gtk_widget_show_all(GTK_WIDGET(button->main));
- }
- if ((button->rclick != NULL) &&
- (theme[IMAGE_SET_RCLICK_MENU] != NULL)) {
- gtk_image_menu_item_set_image(button->rclick,
- GTK_WIDGET(
- theme[IMAGE_SET_RCLICK_MENU]->
- image[i]));
- gtk_widget_show_all(GTK_WIDGET(button->rclick));
- }
- if ((button->popup != NULL) &&
- (theme[IMAGE_SET_POPUP_MENU] != NULL)) {
- gtk_image_menu_item_set_image(button->popup,
- GTK_WIDGET(
- theme[IMAGE_SET_POPUP_MENU]->
- image[i]));
- gtk_widget_show_all(GTK_WIDGET(button->popup));
- }
if ((button->location != -1) && (button->button != NULL) &&
(theme[IMAGE_SET_BUTTONS] != NULL)) {
gtk_tool_button_set_icon_widget(