mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix build with Qt 6.
This commit is contained in:
parent
a7c93a9421
commit
26827a5043
1 changed files with 9 additions and 1 deletions
|
@ -30,6 +30,14 @@ constexpr auto kEmojiCacheIndex = 1;
|
||||||
constexpr auto kMaskCacheIndex = 2;
|
constexpr auto kMaskCacheIndex = 2;
|
||||||
constexpr auto kCacheColumsCount = 3;
|
constexpr auto kCacheColumsCount = 3;
|
||||||
|
|
||||||
|
[[nodiscard]] QPoint LocalPosition(not_null<QWheelEvent*> e) {
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
return e->position().toPoint();
|
||||||
|
#else // Qt >= 6.0
|
||||||
|
return e->pos();
|
||||||
|
#endif // Qt >= 6.0
|
||||||
|
}
|
||||||
|
|
||||||
[[nodiscard]] QSize CountMaxSizeWithMargins(style::margins margins) {
|
[[nodiscard]] QSize CountMaxSizeWithMargins(style::margins margins) {
|
||||||
const auto extended = QRect(
|
const auto extended = QRect(
|
||||||
QPoint(),
|
QPoint(),
|
||||||
|
@ -102,7 +110,7 @@ bool Button::consumeWheelEvent(not_null<QWheelEvent*> e) {
|
||||||
const auto scrollMax = (_expandedInnerHeight - _expandedHeight);
|
const auto scrollMax = (_expandedInnerHeight - _expandedHeight);
|
||||||
if (_state != State::Inside
|
if (_state != State::Inside
|
||||||
|| scrollMax <= 0
|
|| scrollMax <= 0
|
||||||
|| !_geometry.contains(e->pos())) {
|
|| !_geometry.contains(LocalPosition(e))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const auto delta = e->angleDelta();
|
const auto delta = e->angleDelta();
|
||||||
|
|
Loading…
Add table
Reference in a new issue