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

Moved position info from ItemBases to AbstractLayoutItem.

This commit is contained in:
23rd
2021-07-26 01:37:06 +03:00
parent 2256482ae0
commit c82006c6f8
7 changed files with 15 additions and 25 deletions

View File

@@ -30,6 +30,13 @@ int AbstractLayoutItem::height() const {
return _height;
}
void AbstractLayoutItem::setPosition(int position) {
_position = position;
}
int AbstractLayoutItem::position() const {
return _position;
}
bool AbstractLayoutItem::hasPoint(QPoint point) const {
return QRect(0, 0, width(), height()).contains(point);
}

View File

@@ -27,6 +27,9 @@ public:
[[nodiscard]] int width() const;
[[nodiscard]] int height() const;
virtual void setPosition(int position);
[[nodiscard]] int position() const;
[[nodiscard]] bool hasPoint(QPoint point) const;
virtual ~AbstractLayoutItem();
@@ -36,5 +39,6 @@ protected:
int _height = 0;
int _maxw = 0;
int _minh = 0;
int _position = 0; // < 0 means removed from layout
};