mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 14:45:14 +00:00
Pause story while viewing the viewers list.
This commit is contained in:
@@ -476,7 +476,8 @@ void Controller::updatePlayingAllowed() {
|
|||||||
&& _windowActive
|
&& _windowActive
|
||||||
&& !_paused
|
&& !_paused
|
||||||
&& !_replyActive
|
&& !_replyActive
|
||||||
&& !_layerShown);
|
&& !_layerShown
|
||||||
|
&& !_menuShown);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Controller::setPlayingAllowed(bool allowed) {
|
void Controller::setPlayingAllowed(bool allowed) {
|
||||||
@@ -656,6 +657,13 @@ void Controller::togglePaused(bool paused) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Controller::setMenuShown(bool shown) {
|
||||||
|
if (_menuShown != shown) {
|
||||||
|
_menuShown = shown;
|
||||||
|
updatePlayingAllowed();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool Controller::canDownload() const {
|
bool Controller::canDownload() const {
|
||||||
return _list && _list->user->isSelf();
|
return _list && _list->user->isSelf();
|
||||||
}
|
}
|
||||||
|
@@ -113,6 +113,7 @@ public:
|
|||||||
[[nodiscard]] bool jumpFor(int delta);
|
[[nodiscard]] bool jumpFor(int delta);
|
||||||
[[nodiscard]] bool paused() const;
|
[[nodiscard]] bool paused() const;
|
||||||
void togglePaused(bool paused);
|
void togglePaused(bool paused);
|
||||||
|
void setMenuShown(bool shown);
|
||||||
|
|
||||||
[[nodiscard]] bool canDownload() const;
|
[[nodiscard]] bool canDownload() const;
|
||||||
|
|
||||||
@@ -174,6 +175,7 @@ private:
|
|||||||
bool _replyFocused = false;
|
bool _replyFocused = false;
|
||||||
bool _replyActive = false;
|
bool _replyActive = false;
|
||||||
bool _layerShown = false;
|
bool _layerShown = false;
|
||||||
|
bool _menuShown = false;
|
||||||
bool _paused = false;
|
bool _paused = false;
|
||||||
|
|
||||||
FullStoryId _shown;
|
FullStoryId _shown;
|
||||||
|
@@ -286,7 +286,9 @@ void RecentViews::showMenu() {
|
|||||||
rebuildMenuTail();
|
rebuildMenuTail();
|
||||||
}, _menuShortLifetime);
|
}, _menuShortLifetime);
|
||||||
|
|
||||||
|
_controller->setMenuShown(true);
|
||||||
_menu->setDestroyedCallback(crl::guard(_widget.get(), [=] {
|
_menu->setDestroyedCallback(crl::guard(_widget.get(), [=] {
|
||||||
|
_controller->setMenuShown(false);
|
||||||
_menuShortLifetime.destroy();
|
_menuShortLifetime.destroy();
|
||||||
_menuEntries.clear();
|
_menuEntries.clear();
|
||||||
_menuEntriesCount = 0;
|
_menuEntriesCount = 0;
|
||||||
|
Reference in New Issue
Block a user