mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 19:19:56 +00:00
Merge remote-tracking branch 'cc9cii/scrollbar-fix'
This commit is contained in:
commit
8d22d26669
2 changed files with 17 additions and 6 deletions
|
@ -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.
|
||||
// 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);
|
||||
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);
|
||||
|
@ -614,6 +612,17 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin
|
|||
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()
|
||||
{
|
||||
mViewManager.addView (mDocument);
|
||||
|
|
|
@ -233,6 +233,8 @@ namespace CSVDoc
|
|||
void stop();
|
||||
|
||||
void closeRequest (SubView *subView);
|
||||
|
||||
void moveScrollBarToEnd(int min, int max);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue