diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2024-01-16 09:31:02 +0100 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2024-01-26 14:51:35 +0100 |
commit | 3042d40be79f28eaa1828474bc8109d0dbe152b8 (patch) | |
tree | 135a0fde94a84faec1e17d979ee3c1d9634a9db4 /src/gui/image/qicon.h | |
parent | 3a4397af2e5076a3425e92d8bbeae37b4267c389 (diff) |
Simplify new QIcon ThemeIcon constants and API
Originally we thought that exposing the string literal through the API
would be useful for people that want to know what icon they will get
when using a specific constant. But since the mapping from platform
independent icon name to platform specific icon name is anyway hidden
in the engine implementation, this is no longer useful.
Based on header review comments, simplify this by making the ThemeIcon
list of constants a scoped enum.
If it's really useful for e.g. designers to know which exact icon they
get on a specific platform, then we could, in a future release, add a
static QIcon::themeIconName API that returns the platform specific icon
string for a ThemeIcon constant.
Pick-to: 6.7
Change-Id: I231eb98fefb4ac82d38209b4e1257bb3caadeb08
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/gui/image/qicon.h')
-rw-r--r-- | src/gui/image/qicon.h | 255 |
1 files changed, 253 insertions, 2 deletions
diff --git a/src/gui/image/qicon.h b/src/gui/image/qicon.h index ee421bf732..1a5c47731f 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 <QtGui/qiconconstants_impl.h> + 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); |