-rw-r--r-- | pwmanager/pwmanager/pwm.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/pwmanager/pwmanager/pwm.cpp b/pwmanager/pwmanager/pwm.cpp index a751fce..9c8d12d 100644 --- a/pwmanager/pwmanager/pwm.cpp +++ b/pwmanager/pwmanager/pwm.cpp @@ -490,5 +490,16 @@ void PwM::initMetrics() void PwM::updateCaption() { - setPlainCaption(curDoc()->getTitle() + " - " PROG_NAME " " PACKAGE_VER); + QString s = curDoc()->getTitle(); + int maxlen = 50; + if ( QApplication::desktop()->width() < 640 ) { + if ( QApplication::desktop()->width() < 320 ) + maxlen = 22; + else + maxlen = 35; + } + if ( s.length() > maxlen ) { + s = "..."+s.right(maxlen -3); + } + setPlainCaption( s ); } |