2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-10-15 14:08:05 +00:00

Added ability to hide attach controls.

This commit is contained in:
23rd
2021-07-12 17:32:13 +03:00
committed by John Preston
parent 7cf5e6d94f
commit 47a4f4229d
4 changed files with 25 additions and 4 deletions

View File

@@ -29,7 +29,7 @@ void AttachControls::paint(Painter &p, int x, int y) {
st::sendBoxAlbumGroupButtonMediaEdit.paintInCenter(p, leftRect);
QRect rightRect(x + groupHalfWidth, y, groupHalfWidth, groupHeight);
st::sendBoxAlbumGroupButtonMediaDelete.paintInCenter(p, rightRect);
} else {
} else if (_type == Type::EditOnly) {
st::sendBoxAlbumButtonMediaEdit.paintInCenter(p, groupRect);
}
}
@@ -37,13 +37,17 @@ void AttachControls::paint(Painter &p, int x, int y) {
int AttachControls::width() const {
return (_type == Type::Full)
? st::sendBoxAlbumGroupSize.width()
: st::sendBoxAlbumSmallGroupSize.width();
: (_type == Type::EditOnly)
? st::sendBoxAlbumSmallGroupSize.width()
: 0;
}
int AttachControls::height() const {
return (_type == Type::Full)
? st::sendBoxAlbumGroupSize.height()
: st::sendBoxAlbumSmallGroupSize.height();
: (_type == Type::EditOnly)
? st::sendBoxAlbumSmallGroupSize.height()
: 0;
}
AttachControls::Type AttachControls::type() const {