-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 | |||
@@ -484,17 +484,28 @@ void PwM::initMetrics() | |||
484 | if (s.isValid()) | 484 | if (s.isValid()) |
485 | resize(s); | 485 | resize(s); |
486 | else | 486 | else |
487 | resize(DEFAULT_SIZE); | 487 | resize(DEFAULT_SIZE); |
488 | } | 488 | } |
489 | 489 | ||
490 | void PwM::updateCaption() | 490 | void PwM::updateCaption() |
491 | { | 491 | { |
492 | setPlainCaption(curDoc()->getTitle() + " - " PROG_NAME " " PACKAGE_VER); | 492 | QString s = curDoc()->getTitle(); |
493 | int maxlen = 50; | ||
494 | if ( QApplication::desktop()->width() < 640 ) { | ||
495 | if ( QApplication::desktop()->width() < 320 ) | ||
496 | maxlen = 22; | ||
497 | else | ||
498 | maxlen = 35; | ||
499 | } | ||
500 | if ( s.length() > maxlen ) { | ||
501 | s = "..."+s.right(maxlen -3); | ||
502 | } | ||
503 | setPlainCaption( s ); | ||
493 | } | 504 | } |
494 | 505 | ||
495 | void PwM::hideEvent(QHideEvent *) | 506 | void PwM::hideEvent(QHideEvent *) |
496 | { | 507 | { |
497 | if (isMinimized()) { | 508 | if (isMinimized()) { |
498 | if (init->tray()) { | 509 | if (init->tray()) { |
499 | forceMinimizeToTray = true; | 510 | forceMinimizeToTray = true; |
500 | close(); | 511 | close(); |