mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Add hierarchy of GIF pausing inside a window.
GIFs get paused if some other layer is displayed above. Media preview > Box or layer > Saved GIFs panel > Inline bot results. If any of those is displayed, GIFs inside message history pause too.
This commit is contained in:
@@ -26,6 +26,16 @@ class MediaView;
|
||||
|
||||
namespace Window {
|
||||
|
||||
enum class GifPauseReason {
|
||||
Any = 0,
|
||||
InlineResults = (1 << 0),
|
||||
SavedGifs = (1 << 1),
|
||||
Layer = (1 << 2),
|
||||
MediaPreview = (1 << 3),
|
||||
};
|
||||
Q_DECLARE_FLAGS(GifPauseReasons, GifPauseReason);
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(GifPauseReasons);
|
||||
|
||||
class TitleWidget;
|
||||
|
||||
class MainWindow : public QWidget, protected base::Subscriber {
|
||||
@@ -84,6 +94,13 @@ public:
|
||||
}
|
||||
virtual PeerData *ui_getPeerForMouseAction();
|
||||
|
||||
void enableGifPauseReason(GifPauseReason reason);
|
||||
void disableGifPauseReason(GifPauseReason reason);
|
||||
base::Observable<void> &gifPauseLevelChanged() {
|
||||
return _gifPauseLevelChanged;
|
||||
}
|
||||
bool isGifPausedAtLeastFor(GifPauseReason reason) const;
|
||||
|
||||
public slots:
|
||||
bool minimizeToTray();
|
||||
void updateGlobalMenu() {
|
||||
@@ -169,6 +186,9 @@ private:
|
||||
|
||||
object_ptr<MediaView> _mediaView = { nullptr };
|
||||
|
||||
GifPauseReasons _gifPauseReasons = { 0 };
|
||||
base::Observable<void> _gifPauseLevelChanged;
|
||||
|
||||
};
|
||||
|
||||
} // namespace Window
|
||||
|
Reference in New Issue
Block a user