1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 21:49:55 +00:00

Merge remote-tracking branch 'cc9cii/scrollbar-fix'

This commit is contained in:
Marc Zinnschlag 2015-06-10 18:51:14 +02:00
commit 8d22d26669
2 changed files with 17 additions and 6 deletions

View file

@ -515,6 +515,10 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin
} }
} }
if (mScroll)
QObject::connect(mScroll->horizontalScrollBar(),
SIGNAL(rangeChanged(int,int)), this, SLOT(moveScrollBarToEnd(int,int)));
// User setting for limiting the number of sub views per top level view. // User setting for limiting the number of sub views per top level view.
// Automatically open a new top level view if this number is exceeded // Automatically open a new top level view if this number is exceeded
// //
@ -586,12 +590,6 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin
mSubViewWindow.setMinimumWidth(mSubViewWindow.width()+minWidth); mSubViewWindow.setMinimumWidth(mSubViewWindow.width()+minWidth);
move(0, y()); move(0, y());
} }
// Make the new subview visible, setFocus() or raise() don't seem to work
// On Ubuntu the scrollbar does not go right to the end, even if using
// mScroll->horizontalScrollBar()->setValue(mScroll->horizontalScrollBar()->maximum());
if (mSubViewWindow.width() > rect.width())
mScroll->horizontalScrollBar()->setValue(mSubViewWindow.width());
} }
mSubViewWindow.addDockWidget (Qt::TopDockWidgetArea, view); mSubViewWindow.addDockWidget (Qt::TopDockWidgetArea, view);
@ -614,6 +612,17 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin
view->useHint (hint); view->useHint (hint);
} }
void CSVDoc::View::moveScrollBarToEnd(int min, int max)
{
if (mScroll)
{
mScroll->horizontalScrollBar()->setValue(max);
QObject::disconnect(mScroll->horizontalScrollBar(),
SIGNAL(rangeChanged(int,int)), this, SLOT(moveScrollBarToEnd(int,int)));
}
}
void CSVDoc::View::newView() void CSVDoc::View::newView()
{ {
mViewManager.addView (mDocument); mViewManager.addView (mDocument);

View file

@ -233,6 +233,8 @@ namespace CSVDoc
void stop(); void stop();
void closeRequest (SubView *subView); void closeRequest (SubView *subView);
void moveScrollBarToEnd(int min, int max);
}; };
} }