UI: Fix scrollbar enablement in Scene Grid Mode
The UI layout math used to determine if scrollbars should be displayed in the Scenes Dock was off by one pixel. This caused the scrollbar to disappear when performing actions while scrolled to the bottom, such as dragging items or resizing the dock.
This commit is contained in:
parent
fd0c4b7d09
commit
5b0ae8c70d
@ -70,7 +70,8 @@ void SceneTree::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
if (gridMode) {
|
||||
int scrollWid = verticalScrollBar()->sizeHint().width();
|
||||
int h = visualItemRect(item(count() - 1)).bottom();
|
||||
const QRect lastItem = visualItemRect(item(count() - 1));
|
||||
const int h = lastItem.y() + lastItem.height();
|
||||
|
||||
if (h < height()) {
|
||||
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
@ -113,7 +114,8 @@ void SceneTree::dropEvent(QDropEvent *event)
|
||||
|
||||
if (gridMode) {
|
||||
int scrollWid = verticalScrollBar()->sizeHint().width();
|
||||
int h = visualItemRect(item(count() - 1)).bottom();
|
||||
const QRect lastItem = visualItemRect(item(count() - 1));
|
||||
const int h = lastItem.y() + lastItem.height();
|
||||
|
||||
if (h < height()) {
|
||||
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
@ -154,7 +156,8 @@ void SceneTree::dropEvent(QDropEvent *event)
|
||||
void SceneTree::RepositionGrid(QDragMoveEvent *event)
|
||||
{
|
||||
int scrollWid = verticalScrollBar()->sizeHint().width();
|
||||
int h = visualItemRect(item(count() - 1)).bottom();
|
||||
const QRect lastItem = visualItemRect(item(count() - 1));
|
||||
const int h = lastItem.y() + lastItem.height();
|
||||
|
||||
if (h < height()) {
|
||||
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
|
Loading…
x
Reference in New Issue
Block a user