summaryrefslogtreecommitdiffabout
path: root/pwmanager/pwmanager/pwm.cpp
Side-by-side diff
Diffstat (limited to 'pwmanager/pwmanager/pwm.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/pwmanager/pwm.cpp13
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
@@ -486,13 +486,24 @@ void PwM::initMetrics()
else
resize(DEFAULT_SIZE);
}
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 );
}
void PwM::hideEvent(QHideEvent *)
{
if (isMinimized()) {
if (init->tray()) {