summaryrefslogtreecommitdiffabout
path: root/korganizer/kowhatsnextview.cpp
Unidiff
Diffstat (limited to 'korganizer/kowhatsnextview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kowhatsnextview.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp
index 8473db9..65d8ac3 100644
--- a/korganizer/kowhatsnextview.cpp
+++ b/korganizer/kowhatsnextview.cpp
@@ -63,51 +63,49 @@ void WhatsNextTextBrowser::printMe()
63{ 63{
64#ifdef DESKTOP_VERSION 64#ifdef DESKTOP_VERSION
65 KOPrintPrefs pp ( this ); 65 KOPrintPrefs pp ( this );
66 if (!pp.exec() ) 66 if (!pp.exec() )
67 return; 67 return;
68 int scaleval = pp.printMode() ; 68 int scaleval = pp.printMode() ;
69 69
70 QPrinter printer; 70 QPrinter printer;
71 if (!printer.setup() ) 71 if (!printer.setup() )
72 return; 72 return;
73 QPainter p; 73 QPainter p;
74 p.begin ( &printer ); 74 p.begin ( &printer );
75 QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); 75 QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer );
76 float dx, dy; 76 float dx, dy;
77 int wid = (m.width() * 9)/10; 77 int wid = (m.width() * 9)/10;
78 dx = (float) wid/(float)contentsWidth (); 78 dx = (float) wid/(float)contentsWidth ();
79 dy = (float)(m.height()) / (float)contentsHeight (); 79 dy = (float)(m.height()) / (float)contentsHeight ();
80 float scale; 80 float scale;
81 // scale to fit the width or height of the paper 81 // scale to fit the width or height of the paper
82 if ( dx < dy ) 82 if ( dx < dy )
83 scale = dx; 83 scale = dx;
84 else 84 else
85 scale = dy; 85 scale = dy;
86 p.translate( m.width()/10,0 ); 86 p.translate( m.width()/10,0 );
87 qDebug("Scale: %f ", scale );
88 if ( scaleval == 2 || scaleval == 1 && scale < 1.0 ) { 87 if ( scaleval == 2 || scaleval == 1 && scale < 1.0 ) {
89 qDebug("SCALE ");
90 p.scale( scale, scale ); 88 p.scale( scale, scale );
91 } 89 }
92 drawContents ( &p, 0,0, contentsWidth (), contentsHeight () ); 90 drawContents ( &p, 0,0, contentsWidth (), contentsHeight () );
93 p.end(); 91 p.end();
94#endif 92#endif
95} 93}
96 94
97KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent, 95KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent,
98 const char *name) 96 const char *name)
99 : KOrg::BaseView(calendar, parent, name) 97 : KOrg::BaseView(calendar, parent, name)
100{ 98{
101 // mDateLabel = 99 // mDateLabel =
102 // new QLabel(KGlobal::locale()->formatDate(QDate::currentDate()),this); 100 // new QLabel(KGlobal::locale()->formatDate(QDate::currentDate()),this);
103 // mDateLabel->setMargin(2); 101 // mDateLabel->setMargin(2);
104 // mDateLabel->setAlignment(AlignCenter); 102 // mDateLabel->setAlignment(AlignCenter);
105 setFont( KOPrefs::instance()->mWhatsNextFont ); 103 setFont( KOPrefs::instance()->mWhatsNextFont );
106 mView = new WhatsNextTextBrowser(this); 104 mView = new WhatsNextTextBrowser(this);
107 connect(mView,SIGNAL(showIncidence(const QString &)),SLOT(showIncidence(const QString &))); 105 connect(mView,SIGNAL(showIncidence(const QString &)),SLOT(showIncidence(const QString &)));
108 QStyleSheet* stsh = mView->styleSheet(); 106 QStyleSheet* stsh = mView->styleSheet();
109 QStyleSheetItem * style ; 107 QStyleSheetItem * style ;
110 style = stsh->item ("h2" ); 108 style = stsh->item ("h2" );
111 if ( style ) { 109 if ( style ) {
112 style->setMargin(QStyleSheetItem::MarginAll,0); 110 style->setMargin(QStyleSheetItem::MarginAll,0);
113 } 111 }