Don't use GtkStock to refer to the stock icons in wxArtProvider

GtkStock is deprecated since GTK+ 3.10 and stock icons should be
identified directly by their names.
This commit is contained in:
Artur Wieczorek 2017-12-10 23:56:46 +01:00
parent 1e8ff2486a
commit 4862884ed8

View File

@ -58,6 +58,75 @@ wxString wxArtIDToStock(const wxArtID& id)
#define ART(wxid, gtkid) \
if (id == wxid) return gtkid;
#if defined(__WXGTK3__) && GTK_CHECK_VERSION(3,10,0)
if ( gtk_check_version(3,10,0) == NULL )
{
ART(wxART_ERROR, "dialog-error")
ART(wxART_INFORMATION, "dialog-information")
ART(wxART_WARNING, "dialog-warning")
ART(wxART_QUESTION, "dialog-question")
//ART(wxART_HELP_SIDE_PANEL, )
ART(wxART_HELP_SETTINGS, "preferences-desktop-font")
ART(wxART_HELP_BOOK, "help-contents")
ART(wxART_HELP_FOLDER, "folder")
ART(wxART_HELP_PAGE, "text-x-generic")
ART(wxART_MISSING_IMAGE, "image-missing")
ART(wxART_ADD_BOOKMARK, "list-add")
ART(wxART_DEL_BOOKMARK, "list-remove")
ART(wxART_GO_BACK, "go-previous")
ART(wxART_GO_FORWARD, "go-next")
ART(wxART_GO_UP, "go-up")
ART(wxART_GO_DOWN, "go-down")
ART(wxART_GO_TO_PARENT, "go-up")
ART(wxART_GO_HOME, "go-home")
ART(wxART_GOTO_FIRST, "go-first")
ART(wxART_GOTO_LAST, "go-last")
ART(wxART_FILE_OPEN, "document-open")
ART(wxART_PRINT, "document-print")
ART(wxART_HELP, "help-browser")
ART(wxART_TIP, "dialog-information")
//ART(wxART_REPORT_VIEW, )
//ART(wxART_LIST_VIEW, )
ART(wxART_NEW_DIR, "folder-new")
ART(wxART_FOLDER, "folder")
ART(wxART_FOLDER_OPEN, "folder-open")
//ART(wxART_GO_DIR_UP, )
ART(wxART_EXECUTABLE_FILE, "system-run")
ART(wxART_NORMAL_FILE, "text-x-generic")
//ART(wxART_TICK_MARK, )
//ART(wxART_CROSS_MARK, )
ART(wxART_FLOPPY, "media-floppy")
ART(wxART_CDROM, "drive-optical")
ART(wxART_HARDDISK, "drive-harddisk")
ART(wxART_REMOVABLE, "drive-removable-media")
ART(wxART_FILE_SAVE, "document-save")
ART(wxART_FILE_SAVE_AS, "document-save-as")
ART(wxART_COPY, "edit-copy")
ART(wxART_CUT, "edit-cut")
ART(wxART_PASTE, "document-open")
ART(wxART_DELETE, "edit-delete")
ART(wxART_NEW, "document-new")
ART(wxART_UNDO, "edit-undo")
ART(wxART_REDO, "edit-redo")
ART(wxART_PLUS, "list-add")
ART(wxART_MINUS, "list-remove")
ART(wxART_CLOSE, "window-close")
ART(wxART_QUIT, "application-exit")
ART(wxART_FIND, "edit-find")
ART(wxART_FIND_AND_REPLACE, "edit-find-replace")
ART(wxART_FULL_SCREEN, "view-fullscreen")
ART(wxART_EDIT, "accessories-text-editor")
}
#else
{
ART(wxART_ERROR, GTK_STOCK_DIALOG_ERROR)
ART(wxART_INFORMATION, GTK_STOCK_DIALOG_INFO)
ART(wxART_WARNING, GTK_STOCK_DIALOG_WARNING)
@ -98,7 +167,6 @@ wxString wxArtIDToStock(const wxArtID& id)
ART(wxART_CDROM, GTK_STOCK_CDROM)
ART(wxART_HARDDISK, GTK_STOCK_HARDDISK)
ART(wxART_REMOVABLE, GTK_STOCK_HARDDISK)
ART(wxART_FILE_SAVE, GTK_STOCK_SAVE)
ART(wxART_FILE_SAVE_AS, GTK_STOCK_SAVE_AS)
@ -120,9 +188,11 @@ wxString wxArtIDToStock(const wxArtID& id)
ART(wxART_FIND, GTK_STOCK_FIND)
ART(wxART_FIND_AND_REPLACE, GTK_STOCK_FIND_AND_REPLACE)
ART(wxART_FULL_SCREEN, GTK_STOCK_FULLSCREEN)
ART(wxART_EDIT, GTK_STOCK_EDIT)
}
#endif // GTK >= 3.10/ < 3.10
#undef ART
// allow passing GTK+ stock IDs to wxArtProvider -- if a recognized wx
// ID wasn't found, pass it to GTK+ in the hope it is a GTK+ or theme
// icon name: