fix: 任务栏插件不支持在触摸屏滚动显示

修复控制中心的任务栏插件在触摸屏上不能滚动显示的问题。

Log: 修复控制中心任务栏设置不能在触摸屏上滚动显示的问题。
Bug: https://pms.uniontech.com/zentao/bug-view-112173.html
Influence: 任务栏插件在触摸屏上滚动显示的场景。
Change-Id: I375262f818c018e0f047da91a767faddf78e1ca0
This commit is contained in:
殷杰 2022-01-25 12:22:31 +08:00 committed by yinjie
parent e8202c9dec
commit da39234fb4

View File

@ -361,6 +361,13 @@ void ModuleWidget::initUI()
}
}
// 支持在触摸屏上滚动
QScroller::grabGesture(this->window(), QScroller::LeftMouseButtonGesture);
QScroller *scroller = QScroller::scroller(this->window());
QScrollerProperties sp;
sp.setScrollMetric(QScrollerProperties::VerticalOvershootPolicy, QScrollerProperties::OvershootAlwaysOff);
scroller->setScrollerProperties(sp);
// 保持内容正常铺满
layout->addStretch();