center edit widget for find. This gives a better user experience.
This commit is contained in:
parent
3004823f36
commit
4c38ff131f
@ -1000,6 +1000,7 @@ void PTextEdit::load( const QString &f, const int index )
|
|||||||
// create a new text edit object
|
// create a new text edit object
|
||||||
PSubTextEdit *edit = new PSubTextEdit( fAdmin.get() );
|
PSubTextEdit *edit = new PSubTextEdit( fAdmin.get() );
|
||||||
edit->setFont(QFont(fAdmin->getFontName(), fAdmin->getFontSize()));
|
edit->setFont(QFont(fAdmin->getFontName(), fAdmin->getFontSize()));
|
||||||
|
edit->setCenterOnScroll(true);
|
||||||
|
|
||||||
// place the text edit object at the appropriate tab position
|
// place the text edit object at the appropriate tab position
|
||||||
if (index == -1)
|
if (index == -1)
|
||||||
@ -1042,7 +1043,7 @@ PSubTextEdit *PTextEdit::currentEditor() const
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
if ( fTabWidget->currentWidget() ) {
|
if ( fTabWidget->currentWidget() ) {
|
||||||
if (fTabWidget->currentWidget()->inherits( "PSubTextEdit" )) {
|
if (fTabWidget->currentWidget()->inherits( "PSubTextEdit" )) {
|
||||||
return dynamic_cast<PSubTextEdit*>(fTabWidget->currentWidget());
|
return dynamic_cast<PSubTextEdit*>(fTabWidget->currentWidget());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1184,6 +1185,7 @@ void PTextEdit::fileNew()
|
|||||||
{
|
{
|
||||||
PSubTextEdit *edit = new PSubTextEdit( fAdmin.get() );
|
PSubTextEdit *edit = new PSubTextEdit( fAdmin.get() );
|
||||||
edit->setFont(QFont(fAdmin->getFontName(), fAdmin->getFontSize()));
|
edit->setFont(QFont(fAdmin->getFontName(), fAdmin->getFontSize()));
|
||||||
|
edit->setCenterOnScroll(true);
|
||||||
doConnections( edit );
|
doConnections( edit );
|
||||||
fTabWidget->addTab( edit, tr( "noname" ) );
|
fTabWidget->addTab( edit, tr( "noname" ) );
|
||||||
fTabWidget->setCurrentIndex(fTabWidget->indexOf(edit));
|
fTabWidget->setCurrentIndex(fTabWidget->indexOf(edit));
|
||||||
|
@ -1007,6 +1007,7 @@ void PTextEdit::load( const QString &f, const int index )
|
|||||||
// create a new text edit object
|
// create a new text edit object
|
||||||
PSubTextEdit *edit = new PSubTextEdit( fAdmin.get() );
|
PSubTextEdit *edit = new PSubTextEdit( fAdmin.get() );
|
||||||
edit->setFont(QFont(fAdmin->getFontName(), fAdmin->getFontSize()));
|
edit->setFont(QFont(fAdmin->getFontName(), fAdmin->getFontSize()));
|
||||||
|
edit->setCenterOnScroll(true);
|
||||||
|
|
||||||
// place the text edit object at the appropriate tab position
|
// place the text edit object at the appropriate tab position
|
||||||
if (index == -1)
|
if (index == -1)
|
||||||
@ -1191,6 +1192,8 @@ void PTextEdit::fileNew()
|
|||||||
{
|
{
|
||||||
PSubTextEdit *edit = new PSubTextEdit( fAdmin.get() );
|
PSubTextEdit *edit = new PSubTextEdit( fAdmin.get() );
|
||||||
edit->setFont(QFont(fAdmin->getFontName(), fAdmin->getFontSize()));
|
edit->setFont(QFont(fAdmin->getFontName(), fAdmin->getFontSize()));
|
||||||
|
edit->setCenterOnScroll(true);
|
||||||
|
|
||||||
doConnections( edit );
|
doConnections( edit );
|
||||||
fTabWidget->addTab( edit, tr( "noname" ) );
|
fTabWidget->addTab( edit, tr( "noname" ) );
|
||||||
fTabWidget->setCurrentIndex(fTabWidget->indexOf(edit));
|
fTabWidget->setCurrentIndex(fTabWidget->indexOf(edit));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user