diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index a44e36d7487..7015e1e82fc 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -61,7 +61,7 @@ qt_internal_add_module(Gui image/qabstractfileiconprovider.cpp image/qabstractfileiconprovider.h image/qabstractfileiconprovider_p.h image/qbitmap.cpp image/qbitmap.h image/qbmphandler.cpp image/qbmphandler_p.h - image/qicon.cpp image/qicon.h image/qicon_p.h image/qiconconstants_impl.h + image/qicon.cpp image/qicon.h image/qicon_p.h image/qiconengine.cpp image/qiconengine.h image/qiconengine_p.h image/qiconengineplugin.cpp image/qiconengineplugin.h image/qiconloader.cpp image/qiconloader_p.h diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index dc65c3897ec..673f51515a3 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -25,6 +25,7 @@ #include "private/qhexstring_p.h" #include "private/qguiapplication_p.h" +#include "private/qoffsetstringarray_p.h" #include "qpa/qplatformtheme.h" #ifndef QT_NO_ICON @@ -1399,6 +1400,571 @@ bool QIcon::hasThemeIcon(const QString &name) return icon.name() == name; } +static constexpr QLatin1StringView themeIconName(QIcon::ThemeIcon icon) +{ + constexpr auto mapping = qOffsetStringArray( + "address-book-new", + "application-exit", + "appointment-new", + "call-start", + "call-stop", + "contact-new", + "document-new", + "document-open", + "document-open-recent", + "document-page-setup", + "document-print", + "document-print-preview", + "document-properties", + "document-revert", + "document-save", + "document-save-as", + "document-send", + "edit-clear", + "edit-copy", + "edit-cut", + "edit-delete", + "edit-find", + "edit-find-replace", + "edit-paste", + "edit-redo", + "edit-select-all", + "edit-undo", + "folder-new", + "format-indent-less", + "format-indent-more", + "format-justify-center", + "format-justify-fill", + "format-justify-left", + "format-justify-right", + "format-text-direction-ltr", + "format-text-direction-rtl", + "format-text-bold", + "format-text-italic", + "format-text-underline", + "format-text-strikethrough", + "go-bottom", + "go-down", + "go-first", + "go-home", + "go-jump", + "go-last", + "go-next", + "go-previous", + "go-top", + "go-up", + "help-about", + "help-contents", + "help-faq", + "insert-image", + "insert-link", + "insert-object", + "insert-text", + "list-add", + "list-remove", + "mail-forward", + "mail-mark-important", + "mail-mark-junk", + "mail-mark-notjunk", + "mail-mark-read", + "mail-mark-unread", + "mail-message-new", + "mail-reply-all", + "mail-reply-sender", + "mail-send", + "mail-send-receive", + "media-eject", + "media-playback-pause", + "media-playback-start", + "media-playback-stop", + "media-record", + "media-seek-backward", + "media-seek-forward", + "media-skip-backward", + "media-skip-forward", + "object-flip-horizontal", + "object-flip-vertical", + "object-rotate-left", + "object-rotate-right", + "process-stop", + "system-lock-screen", + "system-log-out", + "system-run", + "system-search", + "system-reboot", + "system-shutdown", + "tools-check-spelling", + "view-fullscreen", + "view-refresh", + "view-restore", + "view-sort-ascending", + "view-sort-descending", + "window-close", + "window-new", + "zoom-fit-best", + "zoom-in", + "zoom-original", + "zoom-out", + + "process-working", + + "accessories-calculator", + "accessories-character-map", + "accessories-dictionary", + "accessories-text-editor", + "help-browser", + "multimedia-volume-control", + "preferences-desktop-accessibility", + "preferences-desktop-font", + "preferences-desktop-keyboard", + "preferences-desktop-locale", + "preferences-desktop-multimedia", + "preferences-desktop-screensaver", + "preferences-desktop-theme", + "preferences-desktop-wallpaper", + "system-file-manager", + "system-software-install", + "system-software-update", + "utilities-system-monitor", + "utilities-terminal", + + "applications-accessories", + "applications-development", + "applications-engineering", + "applications-games", + "applications-graphics", + "applications-internet", + "applications-multimedia", + "applications-office", + "applications-other", + "applications-science", + "applications-system", + "applications-utilities", + "preferences-desktop", + "preferences-desktop-peripherals", + "preferences-desktop-personal", + "preferences-other", + "preferences-system", + "preferences-system-network", + "system-help", + + "audio-card", + "audio-input-microphone", + "battery", + "camera-photo", + "camera-video", + "camera-web", + "computer", + "drive-harddisk", + "drive-optical", + "drive-removable-media", + "input-gaming", + "input-keyboard", + "input-mouse", + "input-tablet", + "media-flash", + "media-floppy", + "media-optical", + "media-tape", + "modem", + "multimedia-player", + "network-wired", + "network-wireless", + "pda", + "phone", + "printer", + "scanner", + "video-display", + + "emblem-default", + "emblem-documents", + "emblem-downloads", + "emblem-favorite", + "emblem-important", + "emblem-mail", + "emblem-photos", + "emblem-readonly", + "emblem-shared", + "emblem-symbolic-link", + "emblem-synchronized", + "emblem-system", + "emblem-unreadable", + + "appointment-missed", + "appointment-soon", + "audio-volume-high", + "audio-volume-low", + "audio-volume-medium", + "audio-volume-muted", + "battery-caution", + "battery-low", + "dialog-error", + "dialog-information", + "dialog-password", + "dialog-question", + "dialog-warning", + "folder-drag-accept", + "folder-open", + "folder-visiting", + "image-loading", + "image-missing", + "mail-attachment", + "mail-unread", + "mail-read", + "mail-replied", + "mail-signed", + "mail-signed-verified", + "media-playlist-repeat", + "media-playlist-shuffle", + "network-error", + "network-idle", + "network-offline", + "network-receive", + "network-transmit", + "network-transmit-receive", + "printer-error", + "printer-printing", + "security-high", + "security-medium", + "security-low", + "software-update-available", + "software-update-urgent", + "sync-error", + "sync-synchronizing", + "task-due", + "task-past-due", + "user-available", + "user-away", + "user-idle", + "user-offline", + "user-trash-full", + "weather-clear", + "weather-clear-night", + "weather-few-clouds", + "weather-few-clouds-night", + "weather-fog", + "weather-overcast", + "weather-severe-alert", + "weather-showers", + "weather-showers-scattered", + "weather-snow", + "weather-storm" + ); + static_assert(QIcon::ThemeIcon::NThemeIcons == QIcon::ThemeIcon(mapping.count())); + + using ThemeIconIndex = std::underlying_type_t; + const auto index = static_cast(icon); + Q_ASSERT(index < mapping.count()); + return QLatin1StringView(mapping.viewAt(index)); +} + +/*! + \enum QIcon::ThemeIcon + + This enum provides access to icons that are provided by most + icon theme implementations. + + \value AddressBookNew + \value ApplicationExit + \value AppointmentNew + \value CallStart + \value CallStop + \value ContactNew + \value DocumentNew + \value DocumentOpen + \value DocumentOpenRecent + \value DocumentPageSetup + \value DocumentPrint + \value DocumentPrintPreview + \value DocumentProperties + \value DocumentRevert + \value DocumentSave + \value DocumentSaveAs + \value DocumentSend + \value EditClear + \value EditCopy + \value EditCut + \value EditDelete + \value EditFind + \value EditFindReplace + \value EditPaste + \value EditRedo + \value EditSelectAll + \value EditUndo + \value FolderNew + \value FormatIndentLess + \value FormatIndentMore + \value FormatJustifyCenter + \value FormatJustifyFill + \value FormatJustifyLeft + \value FormatJustifyRight + \value FormatTextDirectionLtr + \value FormatTextDirectionRtl + \value FormatTextBold + \value FormatTextItalic + \value FormatTextUnderline + \value FormatTextStrikethrough + \value GoBottom + \value GoDown + \value GoFirst + \value GoHome + \value GoJump + \value GoLast + \value GoNext + \value GoPrevious + \value GoTop + \value GoUp + \value HelpAbout + \value HelpContents + \value HelpFaq + \value InsertImage + \value InsertLink + \value InsertObject + \value InsertText + \value ListAdd + \value ListRemove + \value MailForward + \value MailMarkImportant + \value MailMarkJunk + \value MailMarkNotjunk + \value MailMarkRead + \value MailMarkUnread + \value MailMessageNew + \value MailReplyAll + \value MailReplySender + \value MailSend + \value MailSendReceive + \value MediaEject + \value MediaPlaybackPause + \value MediaPlaybackStart + \value MediaPlaybackStop + \value MediaRecord + \value MediaSeekBackward + \value MediaSeekForward + \value MediaSkipBackward + \value MediaSkipForward + \value ObjectFlipHorizontal + \value ObjectFlipVertical + \value ObjectRotateLeft + \value ObjectRotateRight + \value ProcessStop + \value SystemLockScreen + \value SystemLogOut + \value SystemRun + \value SystemSearch + \value SystemReboot + \value SystemShutdown + \value ToolsCheckSpelling + \value ViewFullscreen + \value ViewRefresh + \value ViewRestore + \value ViewSortAscending + \value ViewSortDescending + \value WindowClose + \value WindowNew + \value ZoomFitBest + \value ZoomIn + \value ZoomOriginal + \value ZoomOut + + \value ProcessWorking + + \value AccessoriesCalculator + \value AccessoriesCharacterMap + \value AccessoriesDictionary + \value AccessoriesTextEditor + \value HelpBrowser + \value MultimediaVolumeControl + \value PreferencesDesktopAccessibility + \value PreferencesDesktopFont + \value PreferencesDesktopKeyboard + \value PreferencesDesktopLocale + \value PreferencesDesktopMultimedia + \value PreferencesDesktopScreensaver + \value PreferencesDesktopTheme + \value PreferencesDesktopWallpaper + \value SystemFileManager + \value SystemSoftwareInstall + \value SystemSoftwareUpdate + \value UtilitiesSystemMonitor + \value UtilitiesTerminal + + \value ApplicationsAccessories + \value ApplicationsDevelopment + \value ApplicationsEngineering + \value ApplicationsGames + \value ApplicationsGraphics + \value ApplicationsInternet + \value ApplicationsMultimedia + \value ApplicationsOffice + \value ApplicationsOther + \value ApplicationsScience + \value ApplicationsSystem + \value ApplicationsUtilities + \value PreferencesDesktop + \value PreferencesDesktopPeripherals + \value PreferencesDesktopPersonal + \value PreferencesOther + \value PreferencesSystem + \value PreferencesSystemNetwork + \value SystemHelp + + \value AudioCard + \value AudioInputMicrophone + \value Battery + \value CameraPhoto + \value CameraVideo + \value CameraWeb + \value Computer + \value DriveHarddisk + \value DriveOptical + \value DriveRemovableMedia + \value InputGaming + \value InputKeyboard + \value InputMouse + \value InputTablet + \value MediaFlash + \value MediaFloppy + \value MediaOptical + \value MediaTape + \value Modem + \value MultimediaPlayer + \value NetworkWired + \value NetworkWireless + \value Pda + \value Phone + \value Printer + \value Scanner + \value VideoDisplay + + \value EmblemDefault + \value EmblemDocuments + \value EmblemDownloads + \value EmblemFavorite + \value EmblemImportant + \value EmblemMail + \value EmblemPhotos + \value EmblemReadonly + \value EmblemShared + \value EmblemSymbolicLink + \value EmblemSynchronized + \value EmblemSystem + \value EmblemUnreadable + + \value AppointmentMissed + \value AppointmentSoon + \value AudioVolumeHigh + \value AudioVolumeLow + \value AudioVolumeMedium + \value AudioVolumeMuted + \value BatteryCaution + \value BatteryLow + \value DialogError + \value DialogInformation + \value DialogPassword + \value DialogQuestion + \value DialogWarning + \value FolderDragAccept + \value FolderOpen + \value FolderVisiting + \value ImageLoading + \value ImageMissing + \value MailAttachment + \value MailUnread + \value MailRead + \value MailReplied + \value MailSigned + \value MailSignedVerified + \value MediaPlaylistRepeat + \value MediaPlaylistShuffle + \value NetworkError + \value NetworkIdle + \value NetworkOffline + \value NetworkReceive + \value NetworkTransmit + \value NetworkTransmitReceive + \value PrinterError + \value PrinterPrinting + \value SecurityHigh + \value SecurityMedium + \value SecurityLow + \value SoftwareUpdateAvailable + \value SoftwareUpdateUrgent + \value SyncError + \value SyncSynchronizing + \value TaskDue + \value TaskPastDue + \value UserAvailable + \value UserAway + \value UserIdle + \value UserOffline + \value UserTrashFull + \value WeatherClear + \value WeatherClearNight + \value WeatherFewClouds + \value WeatherFewCloudsNight + \value WeatherFog + \value WeatherOvercast + \value WeatherSevereAlert + \value WeatherShowers + \value WeatherShowersScattered + \value WeatherSnow + \value WeatherStorm + + \omitvalue NThemeIcons + + \sa {QIcon#Creating an icon from a theme or icon library}, + fromTheme() +*/ + +/*! + \since 6.7 + \overload + + Returns \c true if there is an icon available for \a icon in the + current icon theme or any of the fallbacks, as described by + fromTheme(), otherwise returns \c false. + + \sa fromTheme() +*/ +bool QIcon::hasThemeIcon(QIcon::ThemeIcon icon) +{ + return hasThemeIcon(themeIconName(icon)); +} + +/*! + \fn QIcon QIcon::fromTheme(QIcon::ThemeIcon icon) + \fn QIcon QIcon::fromTheme(QIcon::ThemeIcon icon, const QIcon &fallback) + \since 6.7 + \overload + + Returns the QIcon corresponding to \a icon in the + \l{themeName()}{current icon theme}. + + If the current theme does not provide an icon for \a icon, + the \l{fallbackThemeName()}{fallback icon theme} is consulted, + before falling back to looking up standalone icon files in the + \l{QIcon::fallbackSearchPaths()}{fallback icon search path}. + Finally, the platform's native icon library is consulted. + + If no icon is found and a \a fallback is provided, \a fallback is + returned. This is useful to provide a guaranteed fallback, regardless + of whether the current set of icon themes and fallbacks paths + support the requested icon. + + If no icon is found and no \a fallback is provided, a default + constructed, empty QIcon is returned. +*/ +QIcon QIcon::fromTheme(QIcon::ThemeIcon icon) +{ + return fromTheme(themeIconName(icon)); +} + +QIcon QIcon::fromTheme(QIcon::ThemeIcon icon, const QIcon &fallback) +{ + return fromTheme(themeIconName(icon), fallback); +} + /*! \since 5.6 diff --git a/src/gui/image/qicon.h b/src/gui/image/qicon.h index ee421bf732d..1a5c47731f2 100644 --- a/src/gui/image/qicon.h +++ b/src/gui/image/qicon.h @@ -22,8 +22,255 @@ public: enum Mode { Normal, Disabled, Active, Selected }; enum State { On, Off }; - struct ThemeIcon { -#include + enum class ThemeIcon { + AddressBookNew, + ApplicationExit, + AppointmentNew, + CallStart, + CallStop, + ContactNew, + DocumentNew, + DocumentOpen, + DocumentOpenRecent, + DocumentPageSetup, + DocumentPrint, + DocumentPrintPreview, + DocumentProperties, + DocumentRevert, + DocumentSave, + DocumentSaveAs, + DocumentSend, + EditClear, + EditCopy, + EditCut, + EditDelete, + EditFind, + EditFindReplace, + EditPaste, + EditRedo, + EditSelectAll, + EditUndo, + FolderNew, + FormatIndentLess, + FormatIndentMore, + FormatJustifyCenter, + FormatJustifyFill, + FormatJustifyLeft, + FormatJustifyRight, + FormatTextDirectionLtr, + FormatTextDirectionRtl, + FormatTextBold, + FormatTextItalic, + FormatTextUnderline, + FormatTextStrikethrough, + GoBottom, + GoDown, + GoFirst, + GoHome, + GoJump, + GoLast, + GoNext, + GoPrevious, + GoTop, + GoUp, + HelpAbout, + HelpContents, + HelpFaq, + InsertImage, + InsertLink, + InsertObject, + InsertText, + ListAdd, + ListRemove, + MailForward, + MailMarkImportant, + MailMarkJunk, + MailMarkNotjunk, + MailMarkRead, + MailMarkUnread, + MailMessageNew, + MailReplyAll, + MailReplySender, + MailSend, + MailSendReceive, + MediaEject, + MediaPlaybackPause, + MediaPlaybackStart, + MediaPlaybackStop, + MediaRecord, + MediaSeekBackward, + MediaSeekForward, + MediaSkipBackward, + MediaSkipForward, + ObjectFlipHorizontal, + ObjectFlipVertical, + ObjectRotateLeft, + ObjectRotateRight, + ProcessStop, + SystemLockScreen, + SystemLogOut, + SystemRun, + SystemSearch, + SystemReboot, + SystemShutdown, + ToolsCheckSpelling, + ViewFullscreen, + ViewRefresh, + ViewRestore, + ViewSortAscending, + ViewSortDescending, + WindowClose, + WindowNew, + ZoomFitBest, + ZoomIn, + ZoomOriginal, + ZoomOut, + + ProcessWorking, + + AccessoriesCalculator, + AccessoriesCharacterMap, + AccessoriesDictionary, + AccessoriesTextEditor, + HelpBrowser, + MultimediaVolumeControl, + PreferencesDesktopAccessibility, + PreferencesDesktopFont, + PreferencesDesktopKeyboard, + PreferencesDesktopLocale, + PreferencesDesktopMultimedia, + PreferencesDesktopScreensaver, + PreferencesDesktopTheme, + PreferencesDesktopWallpaper, + SystemFileManager, + SystemSoftwareInstall, + SystemSoftwareUpdate, + UtilitiesSystemMonitor, + UtilitiesTerminal, + + ApplicationsAccessories, + ApplicationsDevelopment, + ApplicationsEngineering, + ApplicationsGames, + ApplicationsGraphics, + ApplicationsInternet, + ApplicationsMultimedia, + ApplicationsOffice, + ApplicationsOther, + ApplicationsScience, + ApplicationsSystem, + ApplicationsUtilities, + PreferencesDesktop, + PreferencesDesktopPeripherals, + PreferencesDesktopPersonal, + PreferencesOther, + PreferencesSystem, + PreferencesSystemNetwork, + SystemHelp, + + AudioCard, + AudioInputMicrophone, + Battery, + CameraPhoto, + CameraVideo, + CameraWeb, + Computer, + DriveHarddisk, + DriveOptical, + DriveRemovableMedia, + InputGaming, + InputKeyboard, + InputMouse, + InputTablet, + MediaFlash, + MediaFloppy, + MediaOptical, + MediaTape, + Modem, + MultimediaPlayer, + NetworkWired, + NetworkWireless, + Pda, + Phone, + Printer, + Scanner, + VideoDisplay, + + EmblemDefault, + EmblemDocuments, + EmblemDownloads, + EmblemFavorite, + EmblemImportant, + EmblemMail, + EmblemPhotos, + EmblemReadonly, + EmblemShared, + EmblemSymbolicLink, + EmblemSynchronized, + EmblemSystem, + EmblemUnreadable, + + AppointmentMissed, + AppointmentSoon, + AudioVolumeHigh, + AudioVolumeLow, + AudioVolumeMedium, + AudioVolumeMuted, + BatteryCaution, + BatteryLow, + DialogError, + DialogInformation, + DialogPassword, + DialogQuestion, + DialogWarning, + FolderDragAccept, + FolderOpen, + FolderVisiting, + ImageLoading, + ImageMissing, + MailAttachment, + MailUnread, + MailRead, + MailReplied, + MailSigned, + MailSignedVerified, + MediaPlaylistRepeat, + MediaPlaylistShuffle, + NetworkError, + NetworkIdle, + NetworkOffline, + NetworkReceive, + NetworkTransmit, + NetworkTransmitReceive, + PrinterError, + PrinterPrinting, + SecurityHigh, + SecurityMedium, + SecurityLow, + SoftwareUpdateAvailable, + SoftwareUpdateUrgent, + SyncError, + SyncSynchronizing, + TaskDue, + TaskPastDue, + UserAvailable, + UserAway, + UserIdle, + UserOffline, + UserTrashFull, + WeatherClear, + WeatherClearNight, + WeatherFewClouds, + WeatherFewCloudsNight, + WeatherFog, + WeatherOvercast, + WeatherSevereAlert, + WeatherShowers, + WeatherShowersScattered, + WeatherSnow, + WeatherStorm, + + NThemeIcons }; QIcon() noexcept; @@ -85,6 +332,10 @@ public: static QIcon fromTheme(const QString &name, const QIcon &fallback); static bool hasThemeIcon(const QString &name); + static QIcon fromTheme(ThemeIcon icon); + static QIcon fromTheme(ThemeIcon icon, const QIcon &fallback); + static bool hasThemeIcon(ThemeIcon icon); + static QStringList themeSearchPaths(); static void setThemeSearchPaths(const QStringList &searchpath); diff --git a/src/gui/image/qiconconstants_impl.h b/src/gui/image/qiconconstants_impl.h deleted file mode 100644 index e2e34372639..00000000000 --- a/src/gui/image/qiconconstants_impl.h +++ /dev/null @@ -1,268 +0,0 @@ -// Copyright (C) 2023 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only - -#ifndef QICONCONSTANTS_IMPL_H -#define QICONCONSTANTS_IMPL_H - -#ifndef QICON_H -#error Do not include qiconconstants_impl.h directly -#endif - -#if 0 -#pragma qt_sync_skip_header_check -#pragma qt_sync_stop_processing -#endif - -#define QT_THEME_ICON(Constant, string) \ -static constexpr auto Constant = QLatin1StringView(string) - -QT_THEME_ICON(AddressBookNew, "address-book-new"); -QT_THEME_ICON(ApplicationExit, "application-exit"); -QT_THEME_ICON(AppointmentNew, "appointment-new"); -QT_THEME_ICON(CallStart, "call-start"); -QT_THEME_ICON(CallStop, "call-stop"); -QT_THEME_ICON(ContactNew, "contact-new"); -QT_THEME_ICON(DocumentNew, "document-new"); -QT_THEME_ICON(DocumentOpen, "document-open"); -QT_THEME_ICON(DocumentOpenRecent, "document-open-recent"); -QT_THEME_ICON(DocumentPageSetup, "document-page-setup"); -QT_THEME_ICON(DocumentPrint, "document-print"); -QT_THEME_ICON(DocumentPrintPreview, "document-print-preview"); -QT_THEME_ICON(DocumentProperties, "document-properties"); -QT_THEME_ICON(DocumentRevert, "document-revert"); -QT_THEME_ICON(DocumentSave, "document-save"); -QT_THEME_ICON(DocumentSaveAs, "document-save-as"); -QT_THEME_ICON(DocumentSend, "document-send"); -QT_THEME_ICON(EditClear, "edit-clear"); -QT_THEME_ICON(EditCopy, "edit-copy"); -QT_THEME_ICON(EditCut, "edit-cut"); -QT_THEME_ICON(EditDelete, "edit-delete"); -QT_THEME_ICON(EditFind, "edit-find"); -QT_THEME_ICON(EditFindReplace, "edit-find-replace"); -QT_THEME_ICON(EditPaste, "edit-paste"); -QT_THEME_ICON(EditRedo, "edit-redo"); -QT_THEME_ICON(EditSelectAll, "edit-select-all"); -QT_THEME_ICON(EditUndo, "edit-undo"); -QT_THEME_ICON(FolderNew, "folder-new"); -QT_THEME_ICON(FormatIndentLess, "format-indent-less"); -QT_THEME_ICON(FormatIndentMore, "format-indent-more"); -QT_THEME_ICON(FormatJustifyCenter, "format-justify-center"); -QT_THEME_ICON(FormatJustifyFill, "format-justify-fill"); -QT_THEME_ICON(FormatJustifyLeft, "format-justify-left"); -QT_THEME_ICON(FormatJustifyRight, "format-justify-right"); -QT_THEME_ICON(FormatTextDirectionLtr, "format-text-direction-ltr"); -QT_THEME_ICON(FormatTextDirectionRtl, "format-text-direction-rtl"); -QT_THEME_ICON(FormatTextBold, "format-text-bold"); -QT_THEME_ICON(FormatTextItalic, "format-text-italic"); -QT_THEME_ICON(FormatTextUnderline, "format-text-underline"); -QT_THEME_ICON(FormatTextStrikethrough, "format-text-strikethrough"); -QT_THEME_ICON(GoBottom, "go-bottom"); -QT_THEME_ICON(GoDown, "go-down"); -QT_THEME_ICON(GoFirst, "go-first"); -QT_THEME_ICON(GoHome, "go-home"); -QT_THEME_ICON(GoJump, "go-jump"); -QT_THEME_ICON(GoLast, "go-last"); -QT_THEME_ICON(GoNext, "go-next"); -QT_THEME_ICON(GoPrevious, "go-previous"); -QT_THEME_ICON(GoTop, "go-top"); -QT_THEME_ICON(GoUp, "go-up"); -QT_THEME_ICON(HelpAbout, "help-about"); -QT_THEME_ICON(HelpContents, "help-contents"); -QT_THEME_ICON(HelpFaq, "help-faq"); -QT_THEME_ICON(InsertImage, "insert-image"); -QT_THEME_ICON(InsertLink, "insert-link"); -QT_THEME_ICON(InsertObject, "insert-object"); -QT_THEME_ICON(InsertText, "insert-text"); -QT_THEME_ICON(ListAdd, "list-add"); -QT_THEME_ICON(ListRemove, "list-remove"); -QT_THEME_ICON(MailForward, "mail-forward"); -QT_THEME_ICON(MailMarkImportant, "mail-mark-important"); -QT_THEME_ICON(MailMarkJunk, "mail-mark-junk"); -QT_THEME_ICON(MailMarkNotjunk, "mail-mark-notjunk"); -QT_THEME_ICON(MailMarkRead, "mail-mark-read"); -QT_THEME_ICON(MailMarkUnread, "mail-mark-unread"); -QT_THEME_ICON(MailMessageNew, "mail-message-new"); -QT_THEME_ICON(MailReplyAll, "mail-reply-all"); -QT_THEME_ICON(MailReplySender, "mail-reply-sender"); -QT_THEME_ICON(MailSend, "mail-send"); -QT_THEME_ICON(MailSendReceive, "mail-send-receive"); -QT_THEME_ICON(MediaEject, "media-eject"); -QT_THEME_ICON(MediaPlaybackPause, "media-playback-pause"); -QT_THEME_ICON(MediaPlaybackStart, "media-playback-start"); -QT_THEME_ICON(MediaPlaybackStop, "media-playback-stop"); -QT_THEME_ICON(MediaRecord, "media-record"); -QT_THEME_ICON(MediaSeekBackward, "media-seek-backward"); -QT_THEME_ICON(MediaSeekForward, "media-seek-forward"); -QT_THEME_ICON(MediaSkipBackward, "media-skip-backward"); -QT_THEME_ICON(MediaSkipForward, "media-skip-forward"); -QT_THEME_ICON(ObjectFlipHorizontal, "object-flip-horizontal"); -QT_THEME_ICON(ObjectFlipVertical, "object-flip-vertical"); -QT_THEME_ICON(ObjectRotateLeft, "object-rotate-left"); -QT_THEME_ICON(ObjectRotateRight, "object-rotate-right"); -QT_THEME_ICON(ProcessStop, "process-stop"); -QT_THEME_ICON(SystemLockScreen, "system-lock-screen"); -QT_THEME_ICON(SystemLogOut, "system-log-out"); -QT_THEME_ICON(SystemRun, "system-run"); -QT_THEME_ICON(SystemSearch, "system-search"); -QT_THEME_ICON(SystemReboot, "system-reboot"); -QT_THEME_ICON(SystemShutdown, "system-shutdown"); -QT_THEME_ICON(ToolsCheckSpelling, "tools-check-spelling"); -QT_THEME_ICON(ViewFullscreen, "view-fullscreen"); -QT_THEME_ICON(ViewRefresh, "view-refresh"); -QT_THEME_ICON(ViewRestore, "view-restore"); -QT_THEME_ICON(ViewSortAscending, "view-sort-ascending"); -QT_THEME_ICON(ViewSortDescending, "view-sort-descending"); -QT_THEME_ICON(WindowClose, "window-close"); -QT_THEME_ICON(WindowNew, "window-new"); -QT_THEME_ICON(ZoomFitBest, "zoom-fit-best"); -QT_THEME_ICON(ZoomIn, "zoom-in"); -QT_THEME_ICON(ZoomOriginal, "zoom-original"); -QT_THEME_ICON(ZoomOut, "zoom-out"); - -QT_THEME_ICON(ProcessWorking, "process-working"); - -QT_THEME_ICON(AccessoriesCalculator, "accessories-calculator"); -QT_THEME_ICON(AccessoriesCharacterMap, "accessories-character-map"); -QT_THEME_ICON(AccessoriesDictionary, "accessories-dictionary"); -QT_THEME_ICON(AccessoriesTextEditor, "accessories-text-editor"); -QT_THEME_ICON(HelpBrowser, "help-browser"); -QT_THEME_ICON(MultimediaVolumeControl, "multimedia-volume-control"); -QT_THEME_ICON(PreferencesDesktopAccessibility, "preferences-desktop-accessibility"); -QT_THEME_ICON(PreferencesDesktopFont, "preferences-desktop-font"); -QT_THEME_ICON(PreferencesDesktopKeyboard, "preferences-desktop-keyboard"); -QT_THEME_ICON(PreferencesDesktopLocale, "preferences-desktop-locale"); -QT_THEME_ICON(PreferencesDesktopMultimedia, "preferences-desktop-multimedia"); -QT_THEME_ICON(PreferencesDesktopScreensaver, "preferences-desktop-screensaver"); -QT_THEME_ICON(PreferencesDesktopTheme, "preferences-desktop-theme"); -QT_THEME_ICON(PreferencesDesktopWallpaper, "preferences-desktop-wallpaper"); -QT_THEME_ICON(SystemFileManager, "system-file-manager"); -QT_THEME_ICON(SystemSoftwareInstall, "system-software-install"); -QT_THEME_ICON(SystemSoftwareUpdate, "system-software-update"); -QT_THEME_ICON(UtilitiesSystemMonitor, "utilities-system-monitor"); -QT_THEME_ICON(UtilitiesTerminal, "utilities-terminal"); - -QT_THEME_ICON(ApplicationsAccessories, "applications-accessories"); -QT_THEME_ICON(ApplicationsDevelopment, "applications-development"); -QT_THEME_ICON(ApplicationsEngineering, "applications-engineering"); -QT_THEME_ICON(ApplicationsGames, "applications-games"); -QT_THEME_ICON(ApplicationsGraphics, "applications-graphics"); -QT_THEME_ICON(ApplicationsInternet, "applications-internet"); -QT_THEME_ICON(ApplicationsMultimedia, "applications-multimedia"); -QT_THEME_ICON(ApplicationsOffice, "applications-office"); -QT_THEME_ICON(ApplicationsOther, "applications-other"); -QT_THEME_ICON(ApplicationsScience, "applications-science"); -QT_THEME_ICON(ApplicationsSystem, "applications-system"); -QT_THEME_ICON(ApplicationsUtilities, "applications-utilities"); -QT_THEME_ICON(PreferencesDesktop, "preferences-desktop"); -QT_THEME_ICON(PreferencesDesktopPeripherals, "preferences-desktop-peripherals"); -QT_THEME_ICON(PreferencesDesktopPersonal, "preferences-desktop-personal"); -QT_THEME_ICON(PreferencesOther, "preferences-other"); -QT_THEME_ICON(PreferencesSystem, "preferences-system"); -QT_THEME_ICON(PreferencesSystemNetwork, "preferences-system-network"); -QT_THEME_ICON(SystemHelp, "system-help"); - -QT_THEME_ICON(AudioCard, "audio-card"); -QT_THEME_ICON(AudioInputMicrophone, "audio-input-microphone"); -QT_THEME_ICON(Battery, "battery"); -QT_THEME_ICON(CameraPhoto, "camera-photo"); -QT_THEME_ICON(CameraVideo, "camera-video"); -QT_THEME_ICON(CameraWeb, "camera-web"); -QT_THEME_ICON(Computer, "computer"); -QT_THEME_ICON(DriveHarddisk, "drive-harddisk"); -QT_THEME_ICON(DriveOptical, "drive-optical"); -QT_THEME_ICON(DriveRemovableMedia, "drive-removable-media"); -QT_THEME_ICON(InputGaming, "input-gaming"); -QT_THEME_ICON(InputKeyboard, "input-keyboard"); -QT_THEME_ICON(InputMouse, "input-mouse"); -QT_THEME_ICON(InputTablet, "input-tablet"); -QT_THEME_ICON(MediaFlash, "media-flash"); -QT_THEME_ICON(MediaFloppy, "media-floppy"); -QT_THEME_ICON(MediaOptical, "media-optical"); -QT_THEME_ICON(MediaTape, "media-tape"); -QT_THEME_ICON(Modem, "modem"); -QT_THEME_ICON(MultimediaPlayer, "multimedia-player"); -QT_THEME_ICON(NetworkWired, "network-wired"); -QT_THEME_ICON(NetworkWireless, "network-wireless"); -QT_THEME_ICON(Pda, "pda"); -QT_THEME_ICON(Phone, "phone"); -QT_THEME_ICON(Printer, "printer"); -QT_THEME_ICON(Scanner, "scanner"); -QT_THEME_ICON(VideoDisplay, "video-display"); - -QT_THEME_ICON(EmblemDefault, "emblem-default"); -QT_THEME_ICON(EmblemDocuments, "emblem-documents"); -QT_THEME_ICON(EmblemDownloads, "emblem-downloads"); -QT_THEME_ICON(EmblemFavorite, "emblem-favorite"); -QT_THEME_ICON(EmblemImportant, "emblem-important"); -QT_THEME_ICON(EmblemMail, "emblem-mail"); -QT_THEME_ICON(EmblemPhotos, "emblem-photos"); -QT_THEME_ICON(EmblemReadonly, "emblem-readonly"); -QT_THEME_ICON(EmblemShared, "emblem-shared"); -QT_THEME_ICON(EmblemSymbolicLink, "emblem-symbolic-link"); -QT_THEME_ICON(EmblemSynchronized, "emblem-synchronized"); -QT_THEME_ICON(EmblemSystem, "emblem-system"); -QT_THEME_ICON(EmblemUnreadable, "emblem-unreadable"); - -QT_THEME_ICON(AppointmentMissed, "appointment-missed"); -QT_THEME_ICON(AppointmentSoon, "appointment-soon"); -QT_THEME_ICON(AudioVolumeHigh, "audio-volume-high"); -QT_THEME_ICON(AudioVolumeLow, "audio-volume-low"); -QT_THEME_ICON(AudioVolumeMedium, "audio-volume-medium"); -QT_THEME_ICON(AudioVolumeMuted, "audio-volume-muted"); -QT_THEME_ICON(BatteryCaution, "battery-caution"); -QT_THEME_ICON(BatteryLow, "battery-low"); -QT_THEME_ICON(DialogError, "dialog-error"); -QT_THEME_ICON(DialogInformation, "dialog-information"); -QT_THEME_ICON(DialogPassword, "dialog-password"); -QT_THEME_ICON(DialogQuestion, "dialog-question"); -QT_THEME_ICON(DialogWarning, "dialog-warning"); -QT_THEME_ICON(FolderDragAccept, "folder-drag-accept"); -QT_THEME_ICON(FolderOpen, "folder-open"); -QT_THEME_ICON(FolderVisiting, "folder-visiting"); -QT_THEME_ICON(ImageLoading, "image-loading"); -QT_THEME_ICON(ImageMissing, "image-missing"); -QT_THEME_ICON(MailAttachment, "mail-attachment"); -QT_THEME_ICON(MailUnread, "mail-unread"); -QT_THEME_ICON(MailRead, "mail-read"); -QT_THEME_ICON(MailReplied, "mail-replied"); -QT_THEME_ICON(MailSigned, "mail-signed"); -QT_THEME_ICON(MailSignedVerified, "mail-signed-verified"); -QT_THEME_ICON(MediaPlaylistRepeat, "media-playlist-repeat"); -QT_THEME_ICON(MediaPlaylistShuffle, "media-playlist-shuffle"); -QT_THEME_ICON(NetworkError, "network-error"); -QT_THEME_ICON(NetworkIdle, "network-idle"); -QT_THEME_ICON(NetworkOffline, "network-offline"); -QT_THEME_ICON(NetworkReceive, "network-receive"); -QT_THEME_ICON(NetworkTransmit, "network-transmit"); -QT_THEME_ICON(NetworkTransmitReceive, "network-transmit-receive"); -QT_THEME_ICON(PrinterError, "printer-error"); -QT_THEME_ICON(PrinterPrinting, "printer-printing"); -QT_THEME_ICON(SecurityHigh, "security-high"); -QT_THEME_ICON(SecurityMedium, "security-medium"); -QT_THEME_ICON(SecurityLow, "security-low"); -QT_THEME_ICON(SoftwareUpdateAvailable, "software-update-available"); -QT_THEME_ICON(SoftwareUpdateUrgent, "software-update-urgent"); -QT_THEME_ICON(SyncError, "sync-error"); -QT_THEME_ICON(SyncSynchronizing, "sync-synchronizing"); -QT_THEME_ICON(TaskDue, "task-due"); -QT_THEME_ICON(TaskPastDue, "task-past-due"); -QT_THEME_ICON(UserAvailable, "user-available"); -QT_THEME_ICON(UserAway, "user-away"); -QT_THEME_ICON(UserIdle, "user-idle"); -QT_THEME_ICON(UserOffline, "user-offline"); -QT_THEME_ICON(UserTrashFull, "user-trash-full"); -QT_THEME_ICON(WeatherClear, "weather-clear"); -QT_THEME_ICON(WeatherClearNight, "weather-clear-night"); -QT_THEME_ICON(WeatherFewClouds, "weather-few-clouds"); -QT_THEME_ICON(WeatherFewCloudsNight, "weather-few-clouds-night"); -QT_THEME_ICON(WeatherFog, "weather-fog"); -QT_THEME_ICON(WeatherOvercast, "weather-overcast"); -QT_THEME_ICON(WeatherSevereAlert, "weather-severe-alert"); -QT_THEME_ICON(WeatherShowers, "weather-showers"); -QT_THEME_ICON(WeatherShowersScattered, "weather-showers-scattered"); -QT_THEME_ICON(WeatherSnow, "weather-snow"); -QT_THEME_ICON(WeatherStorm, "weather-storm"); - -#undef QT_THEME_ICON - -#endif // QICONCONSTANTS_IMPL_H diff --git a/src/gui/platform/darwin/qappleiconengine.mm b/src/gui/platform/darwin/qappleiconengine.mm index 9ad1615fd9e..154d3b79bb4 100644 --- a/src/gui/platform/darwin/qappleiconengine.mm +++ b/src/gui/platform/darwin/qappleiconengine.mm @@ -24,20 +24,20 @@ namespace { auto *loadImage(const QString &iconName) { static constexpr std::pair iconMap[] = { - {QIcon::ThemeIcon::AddressBookNew, @"folder.circle"}, - {QIcon::ThemeIcon::ApplicationExit, @"xmark.circle"}, - {QIcon::ThemeIcon::AppointmentNew, @"hourglass.badge.plus"}, - {QIcon::ThemeIcon::CallStart, @"phone.arrow.up.right"}, - {QIcon::ThemeIcon::CallStop, @"phone.arrow.down.left"}, - {QIcon::ThemeIcon::EditClear, @"clear"}, - {QIcon::ThemeIcon::EditCopy, @"doc.on.doc"}, - {QIcon::ThemeIcon::EditCut, @"scissors"}, - {QIcon::ThemeIcon::EditDelete, @"delete.left"}, - {QIcon::ThemeIcon::EditFind, @"magnifyingglass"}, - {QIcon::ThemeIcon::EditFindReplace, @"arrow.up.left.and.down.right.magnifyingglass"}, - {QIcon::ThemeIcon::EditPaste, @"clipboard"}, - {QIcon::ThemeIcon::EditRedo, @"arrowshape.turn.up.right"}, - {QIcon::ThemeIcon::EditUndo, @"arrowshape.turn.up.left"}, + {"address-book-new"_L1, @"folder.circle"}, + {"application-exit"_L1, @"xmark.circle"}, + {"appointment-new"_L1, @"hourglass.badge.plus"}, + {"call-start"_L1, @"phone.arrow.up.right"}, + {"call-stop"_L1, @"phone.arrow.down.left"}, + {"edit-clear"_L1, @"clear"}, + {"edit-copy"_L1, @"doc.on.doc"}, + {"edit-cut"_L1, @"scissors"}, + {"edit-delete"_L1, @"delete.left"}, + {"edit-find"_L1, @"magnifyingglass"}, + {"edit-find-replace"_L1, @"arrow.up.left.and.down.right.magnifyingglass"}, + {"edit-paste"_L1, @"clipboard"}, + {"edit-redo"_L1, @"arrowshape.turn.up.right"}, + {"edit-undo"_L1, @"arrowshape.turn.up.left"}, }; const auto it = std::find_if(std::begin(iconMap), std::end(iconMap), [iconName](const auto &c){ return c.first == iconName; diff --git a/src/plugins/platforms/android/qandroidplatformiconengine.cpp b/src/plugins/platforms/android/qandroidplatformiconengine.cpp index c66a6bd2117..61dfa26cf0c 100644 --- a/src/plugins/platforms/android/qandroidplatformiconengine.cpp +++ b/src/plugins/platforms/android/qandroidplatformiconengine.cpp @@ -225,18 +225,18 @@ QString QAndroidPlatformIconEngine::glyphs() const return {}; static constexpr std::pair glyphMap[] = { - {QIcon::ThemeIcon::EditClear, u"\ue872"}, - {QIcon::ThemeIcon::EditCopy, u"\ue14d"}, - {QIcon::ThemeIcon::EditCut, u"\ue14e"}, - {QIcon::ThemeIcon::EditDelete, u"\ue14a"}, - {QIcon::ThemeIcon::EditFind, u"\ue8b6"}, - {QIcon::ThemeIcon::EditFindReplace, u"\ue881"}, - {QIcon::ThemeIcon::EditPaste, u"\ue14f"}, - {QIcon::ThemeIcon::EditRedo, u"\ue15a"}, - {QIcon::ThemeIcon::EditSelectAll, u"\ue162"}, - {QIcon::ThemeIcon::EditUndo, u"\ue166"}, - {QIcon::ThemeIcon::Printer, u"\ue8ad"}, - {QLatin1StringView("banana"), u"🍌"}, + {"edit-clear"_L1, u"\ue872"}, + {"edit-copy"_L1, u"\ue14d"}, + {"edit-cut"_L1, u"\ue14e"}, + {"edit-delete"_L1, u"\ue14a"}, + {"edit-find"_L1, u"\ue8b6"}, + {"edit-find-replace"_L1, u"\ue881"}, + {"edit-paste"_L1, u"\ue14f"}, + {"edit-redo"_L1, u"\ue15a"}, + {"edit-select-all"_L1, u"\ue162"}, + {"edit-undo"_L1, u"\ue166"}, + {"printer"_L1, u"\ue8ad"}, + {"banana"_L1, u"🍌"}, }; const auto it = std::find_if(std::begin(glyphMap), std::end(glyphMap), [this](const auto &c){ diff --git a/src/plugins/platforms/windows/qwindowsiconengine.cpp b/src/plugins/platforms/windows/qwindowsiconengine.cpp index e371af706b7..abd36049e97 100644 --- a/src/plugins/platforms/windows/qwindowsiconengine.cpp +++ b/src/plugins/platforms/windows/qwindowsiconengine.cpp @@ -18,17 +18,17 @@ QString QWindowsIconEngine::glyphs() const return {}; static constexpr std::pair glyphMap[] = { - {QIcon::ThemeIcon::EditClear, u"\ue894"}, - {QIcon::ThemeIcon::EditCopy, u"\ue8c8"}, - {QIcon::ThemeIcon::EditCut, u"\ue8c6"}, - {QIcon::ThemeIcon::EditDelete, u"\ue74d"}, - {QIcon::ThemeIcon::EditFind, u"\ue721"}, - {QIcon::ThemeIcon::EditPaste, u"\ue77f"}, - {QIcon::ThemeIcon::EditRedo, u"\ue7a6"}, - {QIcon::ThemeIcon::EditSelectAll, u"\ue8b3"}, - {QIcon::ThemeIcon::EditUndo, u"\ue7a7"}, - {QIcon::ThemeIcon::Printer, u"\ue749"}, - {QLatin1StringView("banana"), u"🍌"}, + {"edit-clear"_L1, u"\ue894"}, + {"edit-copy"_L1, u"\ue8c8"}, + {"edit-cut"_L1, u"\ue8c6"}, + {"edit-delete"_L1, u"\ue74d"}, + {"edit-find"_L1, u"\ue721"}, + {"edit-paste"_L1, u"\ue77f"}, + {"edit-redo"_L1, u"\ue7a6"}, + {"edit-select-all"_L1, u"\ue8b3"}, + {"edit-undo"_L1, u"\ue7a7"}, + {"printer"_L1, u"\ue749"}, + {"banana"_L1, u"🍌"}, }; const auto it = std::find_if(std::begin(glyphMap), std::end(glyphMap), [this](const auto &c){