|
| 1 | +"""Icon map that overrides standard icons.""" |
| 2 | +from qdarktheme.qtpy.QtWidgets import QStyle |
| 3 | + |
| 4 | +NEW_STANDARD_ICON_MAP = { |
| 5 | + QStyle.StandardPixmap.SP_ArrowBack: {"id": "arrow_upward", "rotate": 270}, |
| 6 | + QStyle.StandardPixmap.SP_ArrowDown: {"id": "arrow_upward", "rotate": 180}, |
| 7 | + QStyle.StandardPixmap.SP_ArrowForward: {"id": "arrow_upward", "rotate": 90}, |
| 8 | + QStyle.StandardPixmap.SP_ArrowLeft: {"id": "arrow_upward", "rotate": 270}, |
| 9 | + QStyle.StandardPixmap.SP_ArrowRight: {"id": "arrow_upward", "rotate": 90}, |
| 10 | + QStyle.StandardPixmap.SP_ArrowUp: {"id": "arrow_upward"}, |
| 11 | + QStyle.StandardPixmap.SP_BrowserReload: {"id": "refresh"}, |
| 12 | + QStyle.StandardPixmap.SP_BrowserStop: {"id": "close"}, |
| 13 | + QStyle.StandardPixmap.SP_CommandLink: {"id": "east"}, |
| 14 | + QStyle.StandardPixmap.SP_DialogApplyButton: {"id": "check_circle"}, |
| 15 | + QStyle.StandardPixmap.SP_DialogCancelButton: {"id": "cancel"}, |
| 16 | + QStyle.StandardPixmap.SP_DialogCloseButton: {"id": "close"}, |
| 17 | + QStyle.StandardPixmap.SP_DialogDiscardButton: {"id": "delete"}, |
| 18 | + QStyle.StandardPixmap.SP_DialogHelpButton: {"id": "help"}, |
| 19 | + QStyle.StandardPixmap.SP_DialogNoButton: {"id": "not_interested"}, |
| 20 | + QStyle.StandardPixmap.SP_DialogOkButton: {"id": "check"}, |
| 21 | + QStyle.StandardPixmap.SP_DialogOpenButton: {"id": "launch"}, |
| 22 | + QStyle.StandardPixmap.SP_DialogResetButton: {"id": "cleaning_services"}, |
| 23 | + QStyle.StandardPixmap.SP_DialogSaveButton: {"id": "save"}, |
| 24 | + QStyle.StandardPixmap.SP_DialogYesButton: {"id": "circle"}, |
| 25 | + QStyle.StandardPixmap.SP_DirHomeIcon: {"id": "home"}, |
| 26 | + QStyle.StandardPixmap.SP_DockWidgetCloseButton: {"id": "close"}, |
| 27 | + QStyle.StandardPixmap.SP_FileDialogBack: {"id": "arrow_upward", "rotate": 270}, |
| 28 | + QStyle.StandardPixmap.SP_FileDialogContentsView: {"id": "search"}, |
| 29 | + QStyle.StandardPixmap.SP_FileDialogDetailedView: {"id": "list"}, |
| 30 | + QStyle.StandardPixmap.SP_FileDialogEnd: {"id": "drive_file_move_rtl"}, |
| 31 | + QStyle.StandardPixmap.SP_FileDialogInfoView: {"id": "info"}, |
| 32 | + QStyle.StandardPixmap.SP_FileDialogListView: {"id": "grid_view"}, |
| 33 | + QStyle.StandardPixmap.SP_FileDialogNewFolder: {"id": "create_new_folder"}, |
| 34 | + QStyle.StandardPixmap.SP_FileDialogStart: {"id": "drive_file_move"}, |
| 35 | + QStyle.StandardPixmap.SP_FileDialogToParent: {"id": "arrow_upward"}, |
| 36 | + QStyle.StandardPixmap.SP_MediaPause: {"id": "pause"}, |
| 37 | + QStyle.StandardPixmap.SP_MediaPlay: {"id": "play_arrow"}, |
| 38 | + QStyle.StandardPixmap.SP_MediaSeekBackward: {"id": "fast_rewind"}, |
| 39 | + QStyle.StandardPixmap.SP_MediaSeekForward: {"id": "fast_forward"}, |
| 40 | + QStyle.StandardPixmap.SP_MediaSkipBackward: {"id": "skip_previous"}, |
| 41 | + QStyle.StandardPixmap.SP_MediaSkipForward: {"id": "skip_next"}, |
| 42 | + QStyle.StandardPixmap.SP_MediaStop: {"id": "stop"}, |
| 43 | + QStyle.StandardPixmap.SP_MediaVolume: {"id": "volume_up"}, |
| 44 | + QStyle.StandardPixmap.SP_MediaVolumeMuted: {"id": "volume_mute"}, |
| 45 | + QStyle.StandardPixmap.SP_MessageBoxQuestion: {"id": "help", "os": ["Darwin", "Linux"]}, |
| 46 | + QStyle.StandardPixmap.SP_TitleBarCloseButton: {"id": "close"}, |
| 47 | + QStyle.StandardPixmap.SP_TitleBarContextHelpButton: {"id": "question_mark"}, |
| 48 | + QStyle.StandardPixmap.SP_TitleBarMaxButton: {"id": "fullscreen"}, |
| 49 | + QStyle.StandardPixmap.SP_TitleBarMinButton: {"id": "minimize"}, |
| 50 | + QStyle.StandardPixmap.SP_TitleBarNormalButton: {"id": "flip_to_front"}, |
| 51 | + QStyle.StandardPixmap.SP_TitleBarShadeButton: {"id": "chevron_right", "rotate": "270"}, |
| 52 | + QStyle.StandardPixmap.SP_TitleBarUnshadeButton: {"id": "chevron_right", "rotate": "90"}, |
| 53 | + QStyle.StandardPixmap.SP_ToolBarHorizontalExtensionButton: {"id": "double_arrow"}, |
| 54 | + QStyle.StandardPixmap.SP_ToolBarVerticalExtensionButton: {"id": "double_arrow", "rotate": 90}, |
| 55 | + QStyle.StandardPixmap.SP_TrashIcon: {"id": "delete", "os": ["Windows"]}, |
| 56 | + QStyle.StandardPixmap.SP_VistaShield: {"id": "security", "os": ["Darwin", "Linux"]}, |
| 57 | +} |
| 58 | + |
| 59 | +if hasattr(QStyle.StandardPixmap, "SP_DialogAbortButton"): |
| 60 | + NEW_STANDARD_ICON_MAP[QStyle.StandardPixmap.SP_DialogAbortButton] = {"id": "not_interested"} # type: ignore # noqa: E501 |
| 61 | + |
| 62 | +if hasattr(QStyle.StandardPixmap, "SP_DialogIgnoreButton"): |
| 63 | + NEW_STANDARD_ICON_MAP[QStyle.StandardPixmap.SP_DialogIgnoreButton] = {"id": "visibility_off"} # type: ignore # noqa: E501 |
| 64 | + |
| 65 | +if hasattr(QStyle.StandardPixmap, "SP_DialogNoToAllButton"): |
| 66 | + NEW_STANDARD_ICON_MAP[QStyle.StandardPixmap.SP_DialogNoToAllButton] = {"id": "close"} # type: ignore # noqa: E501 |
| 67 | + |
| 68 | +if hasattr(QStyle.StandardPixmap, "SP_DialogRetryButton"): |
| 69 | + NEW_STANDARD_ICON_MAP[QStyle.StandardPixmap.SP_DialogRetryButton] = {"id": "refresh"} # type: ignore # noqa: E501 |
| 70 | + |
| 71 | +if hasattr(QStyle.StandardPixmap, "SP_DialogSaveAllButton"): |
| 72 | + NEW_STANDARD_ICON_MAP[QStyle.StandardPixmap.SP_DialogSaveAllButton] = {"id": "save"} # type: ignore # noqa: E501 |
| 73 | + |
| 74 | +if hasattr(QStyle.StandardPixmap, "SP_DialogYesToAllButton"): |
| 75 | + NEW_STANDARD_ICON_MAP[QStyle.StandardPixmap.SP_DialogYesToAllButton] = {"id": "done_all"} # type: ignore # noqa: E501 |
| 76 | + |
| 77 | +if hasattr(QStyle.StandardPixmap, "SP_LineEditClearButton"): |
| 78 | + NEW_STANDARD_ICON_MAP[QStyle.StandardPixmap.SP_LineEditClearButton] = {"id": "close"} # type: ignore # noqa: E501 |
| 79 | + |
| 80 | +if hasattr(QStyle.StandardPixmap, "SP_TabCloseButton"): |
| 81 | + NEW_STANDARD_ICON_MAP[QStyle.StandardPixmap.SP_TabCloseButton] = {"id": "close"} # type: ignore # noqa: E501 |
0 commit comments