mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix auto-delete button when switching between chats.
This commit is contained in:
parent
4896509ddf
commit
5b6503bfed
3 changed files with 8 additions and 2 deletions
|
@ -5417,7 +5417,7 @@ void HistoryWidget::checkMessagesTTL() {
|
||||||
updateControlsGeometry();
|
updateControlsGeometry();
|
||||||
updateControlsVisibility();
|
updateControlsVisibility();
|
||||||
}
|
}
|
||||||
} else if (!_ttlInfo) {
|
} else if (!_ttlInfo || _ttlInfo->peer() != _peer) {
|
||||||
_ttlInfo = std::make_unique<HistoryView::Controls::TTLButton>(
|
_ttlInfo = std::make_unique<HistoryView::Controls::TTLButton>(
|
||||||
this,
|
this,
|
||||||
_peer);
|
_peer);
|
||||||
|
|
|
@ -92,7 +92,8 @@ void AutoDeleteSettingsBox(
|
||||||
}
|
}
|
||||||
|
|
||||||
TTLButton::TTLButton(not_null<QWidget*> parent, not_null<PeerData*> peer)
|
TTLButton::TTLButton(not_null<QWidget*> parent, not_null<PeerData*> peer)
|
||||||
: _button(parent, st::historyMessagesTTL) {
|
: _peer(peer)
|
||||||
|
, _button(parent, st::historyMessagesTTL) {
|
||||||
_button.setClickedCallback([=] {
|
_button.setClickedCallback([=] {
|
||||||
const auto canEdit = peer->isUser()
|
const auto canEdit = peer->isUser()
|
||||||
|| (peer->isChat()
|
|| (peer->isChat()
|
||||||
|
|
|
@ -23,6 +23,10 @@ class TTLButton final {
|
||||||
public:
|
public:
|
||||||
TTLButton(not_null<QWidget*> parent, not_null<PeerData*> peer);
|
TTLButton(not_null<QWidget*> parent, not_null<PeerData*> peer);
|
||||||
|
|
||||||
|
[[nodiscard]] not_null<PeerData*> peer() const {
|
||||||
|
return _peer;
|
||||||
|
}
|
||||||
|
|
||||||
void show();
|
void show();
|
||||||
void hide();
|
void hide();
|
||||||
void move(int x, int y);
|
void move(int x, int y);
|
||||||
|
@ -30,6 +34,7 @@ public:
|
||||||
[[nodiscard]] int width() const;
|
[[nodiscard]] int width() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
const not_null<PeerData*> _peer;
|
||||||
Ui::IconButton _button;
|
Ui::IconButton _button;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue