[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/kspread
From:       Stefan Nikolaus <stefan.nikolaus () kdemail ! net>
Date:       2007-01-15 15:21:08
Message-ID: 1168874468.225355.18012.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 623816 by nikolaus:

Painting	Something to play with: Don't try to renormalize the font size.
		.. which may cause problems on printing.
		IMO, it sucks, but I'm interested in the complaints. ;-)


 M  +2 -6      Border.cpp  
 M  +1 -2      CellView.cpp  
 M  +3 -3      Doc.cpp  
 M  +3 -2      View.cpp  


--- trunk/koffice/kspread/Border.cpp #623815:623816
@@ -553,8 +553,6 @@
 
   // fonts
   QFont normalFont( painter.font() );
-  // FIXME Stefan: Find a better way to scale the font. X- and Y-resolution may vary!
-  normalFont.setPointSizeF( normalFont.pointSizeF() / m_pCanvas->d->view->doc()->resolutionY() );
   QFont boldFont( normalFont );
   boldFont.setBold( true );
 
@@ -1263,8 +1261,6 @@
 
   // fonts
   QFont normalFont( painter.font() );
-  // FIXME Stefan: Find a better way to scale the font. X- and Y-resolution may vary!
-  normalFont.setPointSizeF( normalFont.pointSizeF() / m_pCanvas->d->view->doc()->resolutionY() );
   QFont boldFont( normalFont );
   boldFont.setBold( true );
 
@@ -1297,7 +1293,7 @@
     xPos = xPos - m_pCanvas->xOffset();
   }
 
-  double height = painter.font().pointSizeF() + 5;
+  double height = painter.fontMetrics().height();
 
   if ( sheet->layoutDirection()==Sheet::RightToLeft )
   {
@@ -1482,7 +1478,7 @@
         painter.setBrush( backgroundBrush );
     }
     double width = YBORDER_WIDTH;
-    double height = painter.font().pointSizeF() + 5;
+    double height = painter.fontMetrics().height();
     painter.drawRect( QRectF( 0, 0, width, height ) );
 }
 
--- trunk/koffice/kspread/CellView.cpp #623815:623816
@@ -1744,8 +1744,7 @@
 {
     QFont tmpFont( d->style.font() );
     // Scale the font size according to the current zoom.
-    // FIXME Stefan: Find a better way to scale the font. X- and Y-resolution may vary!
-    tmpFont.setPointSizeF( tmpFont.pointSizeF() / cell->doc()->resolutionY() );
+//     tmpFont.setPointSizeF( tmpFont.pointSizeF() / cell->doc()->resolutionY() );
     return tmpFont;
 }
 
--- trunk/koffice/kspread/Doc.cpp #623815:623816
@@ -206,9 +206,9 @@
   d->configLoadFromFile = false;
   d->captureAllArrowKeys = true;
 
-  QFont font( KoGlobal::defaultFont() );
-  RowFormat::setGlobalRowHeight( font.pointSizeF() + 3 );
-  ColumnFormat::setGlobalColWidth( ( font.pointSizeF() + 3 ) * 5 );
+  QFontMetricsF fontMetrics( KoGlobal::defaultFont() );
+  RowFormat::setGlobalRowHeight( fontMetrics.height() );
+  ColumnFormat::setGlobalColWidth( fontMetrics.height() * 5 );
 
   d->delayCalculation = false;
 
--- trunk/koffice/kspread/View.cpp #623815:623816
@@ -5370,9 +5370,10 @@
 
   d->canvas->updatePosWidget();
 
-  d->hBorderWidget->setMinimumHeight( doc()->zoomItY( KoGlobal::defaultFont().pointSizeF() + 5 ) );
+  QFontMetricsF fontMetrics( KoGlobal::defaultFont() );
+  d->hBorderWidget->setMinimumHeight( doc()->zoomItY( fontMetrics.height() ) );
   d->vBorderWidget->setMinimumWidth( doc()->zoomItX( YBORDER_WIDTH ) );
-  d->selectAllButton->setMinimumHeight( doc()->zoomItY( KoGlobal::defaultFont().pointSizeF() + 5 ) );
+  d->selectAllButton->setMinimumHeight( doc()->zoomItY( fontMetrics.height() ) );
   d->selectAllButton->setMinimumWidth( doc()->zoomItX( YBORDER_WIDTH ) );
 
   Sheet::LayoutDirection sheetDir = sheet->layoutDirection();
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic