center edit widget for find. This gives a better user experience.

This commit is contained in:
suter_a 2024-12-02 17:06:02 +01:00
parent 3004823f36
commit 4c38ff131f
2 changed files with 6 additions and 1 deletions

View File

@ -1000,6 +1000,7 @@ void PTextEdit::load( const QString &f, const int index )
// create a new text edit object
PSubTextEdit *edit = new PSubTextEdit( fAdmin.get() );
edit->setFont(QFont(fAdmin->getFontName(), fAdmin->getFontSize()));
edit->setCenterOnScroll(true);
// place the text edit object at the appropriate tab position
if (index == -1)
@ -1184,6 +1185,7 @@ void PTextEdit::fileNew()
{
PSubTextEdit *edit = new PSubTextEdit( fAdmin.get() );
edit->setFont(QFont(fAdmin->getFontName(), fAdmin->getFontSize()));
edit->setCenterOnScroll(true);
doConnections( edit );
fTabWidget->addTab( edit, tr( "noname" ) );
fTabWidget->setCurrentIndex(fTabWidget->indexOf(edit));

View File

@ -1007,6 +1007,7 @@ void PTextEdit::load( const QString &f, const int index )
// create a new text edit object
PSubTextEdit *edit = new PSubTextEdit( fAdmin.get() );
edit->setFont(QFont(fAdmin->getFontName(), fAdmin->getFontSize()));
edit->setCenterOnScroll(true);
// place the text edit object at the appropriate tab position
if (index == -1)
@ -1191,6 +1192,8 @@ void PTextEdit::fileNew()
{
PSubTextEdit *edit = new PSubTextEdit( fAdmin.get() );
edit->setFont(QFont(fAdmin->getFontName(), fAdmin->getFontSize()));
edit->setCenterOnScroll(true);
doConnections( edit );
fTabWidget->addTab( edit, tr( "noname" ) );
fTabWidget->setCurrentIndex(fTabWidget->indexOf(edit));