summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim E. Real <termtech@rogers.com>2010-12-18 22:52:25 +0000
committerTim E. Real <termtech@rogers.com>2010-12-18 22:52:25 +0000
commitdd007ef74b1400738a8c3da81df55cac339a776f (patch)
treee9802d0c6e32e2a485bc965108d168b4c2f55ba9
parentdb7ebbf385be9507fe0a921365d7e5e00e7f9f41 (diff)
Add -D debug info for bigtime fonts, size.
-rw-r--r--muse2/muse/widgets/bigtime.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/muse2/muse/widgets/bigtime.cpp b/muse2/muse/widgets/bigtime.cpp
index f3aa75a8..d856f969 100644
--- a/muse2/muse/widgets/bigtime.cpp
+++ b/muse2/muse/widgets/bigtime.cpp
@@ -313,19 +313,22 @@ void BigTime::resizeEvent(QResizeEvent *ev)
int fs = f.pixelSize();
int hspace = 20;
//int tw = fm.width(QString("00:00:00:00"));
- int tw = fm.width(QString("000:00:00:00"));
+ int tw = fm.width(QString("000:00:00:00"));
- fs = ((ev->size().width() - hspace*2)*fs) / tw;
-// printf("resize BigTime %d -> %d, w %d\n", fs, nfs, ev->size().width());
-
+ int nfs = ((ev->size().width() - hspace*2)*fs) / tw;
+
// set min/max
- if (fs < 10)
- fs = 10;
+ if (nfs < 10)
+ nfs = 10;
else if (fs > 256)
- fs = 256;
- f.setPixelSize(fs);
+ nfs = 256;
+
+ if(debugMsg)
+ printf("resize BigTime: Font name:%s CurSize:%d NewSize:%d, NewWidth:%d\n",
+ f.family().toLatin1().constData(), fs, nfs, ev->size().width());
+
+ f.setPixelSize(nfs);
-
dwin->setFont(f);
int digitWidth = dwin->fontMetrics().width(QString("0"));
int vspace = (ev->size().height() - (fs*2)) / 3;