diff --git a/Telegram/SourceFiles/core/utils.h b/Telegram/SourceFiles/core/utils.h index fc35bd1b54..3c46326dd2 100644 --- a/Telegram/SourceFiles/core/utils.h +++ b/Telegram/SourceFiles/core/utils.h @@ -570,12 +570,12 @@ enum ForwardWhatMessages { }; enum ShowLayerOption { - CloseOtherLayers = 0x00, - KeepOtherLayers = 0x01, - ShowAfterOtherLayers = 0x03, + CloseOtherLayers = (1 << 0), + KeepOtherLayers = (1 << 1), + ShowAfterOtherLayers = (1 << 2), - AnimatedShowLayer = 0x00, - ForceFastShowLayer = 0x04, + AnimatedShowLayer = (1 << 3), + ForceFastShowLayer = (1 << 4), }; using ShowLayerOptions = base::flags; inline constexpr auto is_flag_type(ShowLayerOption) { return true; }; diff --git a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.h b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.h index 654eaef098..31daf10c5c 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.h +++ b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.h @@ -175,11 +175,11 @@ private: void itemRemoved(HistoryItem *item); enum class UpdateRowSection { - Default = 0x01, - Filtered = 0x02, - PeerSearch = 0x04, - MessageSearch = 0x08, - All = 0x0F, + Default = (1 << 0), + Filtered = (1 << 1), + PeerSearch = (1 << 2), + MessageSearch = (1 << 3), + All = Default | Filtered | PeerSearch | MessageSearch, }; using UpdateRowSections = base::flags; friend inline constexpr auto is_flag_type(UpdateRowSection) { return true; }; diff --git a/Telegram/SourceFiles/history/history_item.h b/Telegram/SourceFiles/history/history_item.h index 6bfffb72d6..b7e20ba513 100644 --- a/Telegram/SourceFiles/history/history_item.h +++ b/Telegram/SourceFiles/history/history_item.h @@ -172,8 +172,8 @@ struct HistoryMessageReply : public RuntimeComponent { void itemRemoved(HistoryMessage *holder, HistoryItem *removed); enum class PaintFlag { - InBubble = 0x01, - Selected = 0x02, + InBubble = (1 << 0), + Selected = (1 << 1), }; using PaintFlags = base::flags; friend inline constexpr auto is_flag_type(PaintFlag) { return true; }; diff --git a/Telegram/SourceFiles/history/history_widget.h b/Telegram/SourceFiles/history/history_widget.h index 5744abfb2e..051768ae16 100644 --- a/Telegram/SourceFiles/history/history_widget.h +++ b/Telegram/SourceFiles/history/history_widget.h @@ -691,8 +691,8 @@ private: void countHistoryShowFrom(); enum class TextUpdateEvent { - SaveDraft = 0x01, - SendTyping = 0x02, + SaveDraft = (1 << 0), + SendTyping = (1 << 1), }; using TextUpdateEvents = base::flags; friend inline constexpr auto is_flag_type(TextUpdateEvent) { return true; }; diff --git a/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.h b/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.h index a1c4ecb665..db578e338d 100644 --- a/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.h +++ b/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.h @@ -82,8 +82,8 @@ private: QSize countFrameSize() const; enum class StateFlag { - Over = 0x01, - DeleteOver = 0x02, + Over = (1 << 0), + DeleteOver = (1 << 1), }; using StateFlags = base::flags; friend inline constexpr auto is_flag_type(StateFlag) { return true; }; diff --git a/Telegram/SourceFiles/observer_peer.h b/Telegram/SourceFiles/observer_peer.h index 4a72a48e05..ec3f1cc461 100644 --- a/Telegram/SourceFiles/observer_peer.h +++ b/Telegram/SourceFiles/observer_peer.h @@ -35,45 +35,45 @@ struct PeerUpdate { PeerData *peer; enum class Flag : uint32 { - None = 0x00000000U, + None = 0, // Common flags - NameChanged = 0x00000001U, - UsernameChanged = 0x00000002U, - PhotoChanged = 0x00000004U, - AboutChanged = 0x00000008U, - NotificationsEnabled = 0x00000010U, - SharedMediaChanged = 0x00000020U, - MigrationChanged = 0x00000040U, - PinnedChanged = 0x00000080U, - RestrictionReasonChanged = 0x00000100U, + NameChanged = (1 << 0), + UsernameChanged = (1 << 1), + PhotoChanged = (1 << 2), + AboutChanged = (1 << 3), + NotificationsEnabled = (1 << 4), + SharedMediaChanged = (1 << 5), + MigrationChanged = (1 << 6), + PinnedChanged = (1 << 7), + RestrictionReasonChanged = (1 << 8), // For chats and channels - InviteLinkChanged = 0x00000200U, - MembersChanged = 0x00000400U, - AdminsChanged = 0x00000800U, - BannedUsersChanged = 0x00001000U, - UnreadMentionsChanged = 0x00002000U, + InviteLinkChanged = (1 << 9), + MembersChanged = (1 << 10), + AdminsChanged = (1 << 11), + BannedUsersChanged = (1 << 12), + UnreadMentionsChanged = (1 << 13), // For users - UserCanShareContact = 0x00010000U, - UserIsContact = 0x00020000U, - UserPhoneChanged = 0x00040000U, - UserIsBlocked = 0x00080000U, - BotCommandsChanged = 0x00100000U, - UserOnlineChanged = 0x00200000U, - BotCanAddToGroups = 0x00400000U, - UserCommonChatsChanged = 0x00800000U, - UserHasCalls = 0x01000000U, + UserCanShareContact = (1 << 16), + UserIsContact = (1 << 17), + UserPhoneChanged = (1 << 18), + UserIsBlocked = (1 << 19), + BotCommandsChanged = (1 << 20), + UserOnlineChanged = (1 << 21), + BotCanAddToGroups = (1 << 22), + UserCommonChatsChanged = (1 << 23), + UserHasCalls = (1 << 24), // For chats - ChatCanEdit = 0x00010000U, + ChatCanEdit = (1 << 16), // For channels - ChannelAmIn = 0x00010000U, - ChannelRightsChanged = 0x00020000U, - ChannelStickersChanged = 0x00040000U, - ChannelPinnedChanged = 0x00080000U, + ChannelAmIn = (1 << 16), + ChannelRightsChanged = (1 << 17), + ChannelStickersChanged = (1 << 18), + ChannelPinnedChanged = (1 << 19), }; using Flags = base::flags; friend inline constexpr auto is_flag_type(Flag) { return true; } diff --git a/Telegram/SourceFiles/platform/win/main_window_win.h b/Telegram/SourceFiles/platform/win/main_window_win.h index 510c41cde5..8951eb7401 100644 --- a/Telegram/SourceFiles/platform/win/main_window_win.h +++ b/Telegram/SourceFiles/platform/win/main_window_win.h @@ -55,11 +55,11 @@ public: // Custom shadows. enum class ShadowsChange { - Moved = 0x01, - Resized = 0x02, - Shown = 0x04, - Hidden = 0x08, - Activate = 0x10, + Moved = (1 << 0), + Resized = (1 << 1), + Shown = (1 << 2), + Hidden = (1 << 3), + Activate = (1 << 4), }; using ShadowsChanges = base::flags; friend inline constexpr auto is_flag_type(ShadowsChange) { return true; }; diff --git a/Telegram/SourceFiles/storage/localstorage.cpp b/Telegram/SourceFiles/storage/localstorage.cpp index 4ec0934087..d11e7a9d5f 100644 --- a/Telegram/SourceFiles/storage/localstorage.cpp +++ b/Telegram/SourceFiles/storage/localstorage.cpp @@ -76,8 +76,8 @@ bool _userWorking() { } enum class FileOption { - User = 0x01, - Safe = 0x02, + User = (1 << 0), + Safe = (1 << 1), }; using FileOptions = base::flags; inline constexpr auto is_flag_type(FileOption) { return true; }; diff --git a/Telegram/SourceFiles/ui/abstract_button.h b/Telegram/SourceFiles/ui/abstract_button.h index e8a21379f3..7affcbaa38 100644 --- a/Telegram/SourceFiles/ui/abstract_button.h +++ b/Telegram/SourceFiles/ui/abstract_button.h @@ -76,10 +76,10 @@ signals: protected: enum class StateFlag { - None = 0x00, - Over = 0x01, - Down = 0x02, - Disabled = 0x04, + None = 0, + Over = (1 << 0), + Down = (1 << 1), + Disabled = (1 << 2), }; using State = base::flags; diff --git a/Telegram/SourceFiles/ui/images.h b/Telegram/SourceFiles/ui/images.h index 8ae456dbe1..c9246c32e4 100644 --- a/Telegram/SourceFiles/ui/images.h +++ b/Telegram/SourceFiles/ui/images.h @@ -188,18 +188,18 @@ QImage prepareColored(style::color add, QImage image); QImage prepareOpaque(QImage image); enum class Option { - None = 0x000, - Smooth = 0x001, - Blurred = 0x002, - Circled = 0x004, - RoundedLarge = 0x008, - RoundedSmall = 0x010, - RoundedTopLeft = 0x020, - RoundedTopRight = 0x040, - RoundedBottomLeft = 0x080, - RoundedBottomRight = 0x100, - Colored = 0x200, - TransparentBackground = 0x400, + None = 0, + Smooth = (1 << 0), + Blurred = (1 << 1), + Circled = (1 << 2), + RoundedLarge = (1 << 3), + RoundedSmall = (1 << 4), + RoundedTopLeft = (1 << 5), + RoundedTopRight = (1 << 6), + RoundedBottomLeft = (1 << 7), + RoundedBottomRight = (1 << 8), + Colored = (1 << 9), + TransparentBackground = (1 << 10), }; using Options = base::flags