summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorWaldo Bastian <[email protected]>2014-09-16 03:23:29 +0200
committerSlávek Banko <[email protected]>2014-09-16 03:41:49 +0200
commit9a892fcab05603cbb716191361bc98df0a00d890 (patch)
treef7a1a323cbcedaa3e40a7289903ec5d3de596d25 /src/widgets
parent0cce3b0ec191dd8dcb813e6b97d903b7288f4cb1 (diff)
downloadtqt3-9a892fcab05603cbb716191361bc98df0a00d890.tar.gz
tqt3-9a892fcab05603cbb716191361bc98df0a00d890.zip
Fix zoom in TQTextEdit
TQTextEdit::zoomIn / TQTextEdit::zoomOut does not work if the original font had its size specified in pixels instead of points. pointSize() returns 0 in such case.
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/qtextedit.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/widgets/qtextedit.cpp b/src/widgets/qtextedit.cpp
index 9507d4f08..67703f342 100644
--- a/src/widgets/qtextedit.cpp
+++ b/src/widgets/qtextedit.cpp
@@ -5774,7 +5774,12 @@ void TQTextEdit::setFont( const TQFont &f )
void TQTextEdit::zoomIn( int range )
{
TQFont f( TQScrollView::font() );
- f.setPointSize( TQFontInfo(f).pointSize() + range );
+ TQFontInfo fi(f);
+ if (fi.pointSize() <= 0) {
+ f.setPixelSize( fi.pixelSize() + range );
+ } else {
+ f.setPointSize( fi.pointSize() + range );
+ }
setFont( f );
}
@@ -5789,7 +5794,12 @@ void TQTextEdit::zoomIn( int range )
void TQTextEdit::zoomOut( int range )
{
TQFont f( TQScrollView::font() );
- f.setPointSize( TQMAX( 1, TQFontInfo(f).pointSize() - range ) );
+ TQFontInfo fi(f);
+ if (fi.pointSize() <= 0) {
+ f.setPixelSize( TQMAX( 1, fi.pixelSize() - range ) );
+ } else {
+ f.setPointSize( TQMAX( 1, fi.pointSize() - range ) );
+ }
setFont( f );
}