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:
@@ -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);
|
||||
}
|
||||
|
@@ -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
|
||||
|
||||
};
|
||||
|
Reference in New Issue
Block a user