Fix the minimum size of help text windows to the content size

This could make  help text windows bigger than the  screen, if we want
to  go there  then  using  a QLabel  sub-class  will  need to  change,
probably  by using  a  read-only QTextEdit  instead  as that  provides
scroll bars. Maybe  consider a multi-column table for  the contents as
an alternative to scroll bars.
This commit is contained in:
Bill Somerville 2020-05-15 14:37:14 +01:00
parent c97a127c68
commit c9977e2a9c
No known key found for this signature in database
GPG Key ID: D864B06D1E81618F
1 changed files with 2 additions and 1 deletions

View File

@ -22,10 +22,11 @@ HelpTextWindow::HelpTextWindow (QString const& title, QString const& file_name,
, tr ("Error: %1").arg (source.errorString ()));
return;
}
setText (QTextStream {&source}.readAll ());
setWindowTitle(QApplication::applicationName () + " - " + title);
setMargin (10);
setBackgroundRole (QPalette::Base);
setAutoFillBackground (true);
setStyleSheet (font_as_stylesheet (font));
setText (QTextStream {&source}.readAll ());
setMinimumSize (sizeHint ());
}