From bb61c66b8899089dade4e8f2c2b27b59fb059f12 Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Thu, 10 Nov 2005 11:50:13 +0000 Subject: [PATCH] qt3support-- svn path=/trunk/KDE/kdebase/workspace/; revision=479406 --- clients/keramik/keramik.cpp | 32 ++++++++++++------------- clients/kwmtheme/cli_installer/main.cpp | 2 +- clients/modernsystem/modernsys.cpp | 2 +- clients/plastik/plastik.cpp | 2 +- clients/quartz/quartz.cpp | 2 +- kcmkwin/kwindecoration/preview.cpp | 2 +- workspace.cpp | 4 ++-- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/clients/keramik/keramik.cpp b/clients/keramik/keramik.cpp index 220d2353e2..f0757d58ee 100644 --- a/clients/keramik/keramik.cpp +++ b/clients/keramik/keramik.cpp @@ -194,7 +194,7 @@ KeramikHandler::KeramikHandler() buttonDecos[i]->setMask( *buttonDecos[i] ); // Flip the bitmaps horizontally in right-to-left mode - if ( QApplication::reverseLayout() ) { + if ( QApplication::isRightToLeft() ) { for ( int i = 0; i < Help; i++ ) flip( reinterpret_cast(buttonDecos)[i] ); @@ -374,7 +374,7 @@ void KeramikHandler::createPixmaps() // Prepare the tiles for use // ------------------------------------------------------------------------- - if ( QApplication::reverseLayout() ) { + if ( QApplication::isRightToLeft() ) { // Fix lighting flip( activeTiles[CaptionSmallLeft], activeTiles[CaptionSmallRight] ); @@ -826,14 +826,14 @@ void KeramikButton::drawButton( QPainter *p ) if ( isDown() ) { // Pressed - p->drawPixmap( QPoint(), *pix, QStyle::visualRect( QApplication::reverseLayout() ? Qt::RightToLeft : Qt::LeftToRight, QRect(2*size, 0, size, size), pix->rect() ) ); - p->translate( QApplication::reverseLayout() ? -1 : 1, 1 ); + p->drawPixmap( QPoint(), *pix, QStyle::visualRect( QApplication::isRightToLeft() ? Qt::RightToLeft : Qt::LeftToRight, QRect(2*size, 0, size, size), pix->rect() ) ); + p->translate( QApplication::isRightToLeft() ? -1 : 1, 1 ); } else if ( hover ) // Mouse over - p->drawPixmap( QPoint(), *pix, QStyle::visualRect( QApplication::reverseLayout() ? Qt::RightToLeft : Qt::LeftToRight, QRect(size, 0, size, size), pix->rect() ) ); + p->drawPixmap( QPoint(), *pix, QStyle::visualRect( QApplication::isRightToLeft() ? Qt::RightToLeft : Qt::LeftToRight, QRect(size, 0, size, size), pix->rect() ) ); else // Normal - p->drawPixmap( QPoint(), *pix, QStyle::visualRect( QApplication::reverseLayout() ? Qt::RightToLeft : Qt::LeftToRight, QRect(0, 0, size, size), pix->rect() ) ); + p->drawPixmap( QPoint(), *pix, QStyle::visualRect( QApplication::isRightToLeft() ? Qt::RightToLeft : Qt::LeftToRight, QRect(0, 0, size, size), pix->rect() ) ); // Draw the button deco on the bevel @@ -851,7 +851,7 @@ void KeramikButton::drawButton( QPainter *p ) // The '?' won't be flipped around in the ctor, so we need to // shift it to the right to compensate for the button shadow // being on the left side of the button in RTL mode. - if ( QApplication::reverseLayout() ) + if ( QApplication::isRightToLeft() ) p->translate( 2, 0 ); break; @@ -1134,7 +1134,7 @@ void KeramikClient::updateMask() register int w, y = 0; int nrects; - if ( QApplication::reverseLayout() ) { + if ( QApplication::isRightToLeft() ) { // If the caption bubble is visible and extends above the titlebar if ( largeCaption && captionRect.width() >= 25 ) { @@ -1256,7 +1256,7 @@ void KeramikClient::updateCaptionBuffer() ( clientHandler->showAppIcons() ? 16 + iconSpacing : 0 ); int xpos = QMAX( (captionRect.width() - tw) / 3, 8 ); - QRect tr = QStyle::visualRect( QApplication::reverseLayout() ? Qt::RightToLeft : Qt::LeftToRight, QRect(xpos, 1, captionRect.width() - xpos - 10, + QRect tr = QStyle::visualRect( QApplication::isRightToLeft() ? Qt::RightToLeft : Qt::LeftToRight, QRect(xpos, 1, captionRect.width() - xpos - 10, captionRect.height() - 4), captionBuffer.rect() ); //p.setPen( Qt::red ); // debug @@ -1265,7 +1265,7 @@ void KeramikClient::updateCaptionBuffer() // Application icon if ( clientHandler->showAppIcons() ) { - QRect iconRect = QStyle::visualRect( QApplication::reverseLayout() ? Qt::RightToLeft : Qt::LeftToRight, QRect(tr.x(), + QRect iconRect = QStyle::visualRect( QApplication::isRightToLeft() ? Qt::RightToLeft : Qt::LeftToRight, QRect(tr.x(), 1 + (captionRect.height() - 4 - 16) / 2, 16, 16), tr ); QRect r( icon->rect() ); r.moveCenter( iconRect.center() ); @@ -1275,7 +1275,7 @@ void KeramikClient::updateCaptionBuffer() } else { QRect sr( 0, 0, icon->width(), icon->height() ); - if ( QApplication::reverseLayout() ) + if ( QApplication::isRightToLeft() ) sr.addCoords( icon->width() - tr.width(), 0, 0, 0 ); else sr.addCoords( 0, 0, -( icon->width() - tr.width() ), 0 ); @@ -1286,7 +1286,7 @@ void KeramikClient::updateCaptionBuffer() //p.drawRect( r ); // debug - if ( QApplication::reverseLayout() ) + if ( QApplication::isRightToLeft() ) tr.addCoords( 0, 0, -(16 + iconSpacing), 0 ); else tr.addCoords( (16 + iconSpacing), 0, 0, 0 ); @@ -1294,18 +1294,18 @@ void KeramikClient::updateCaptionBuffer() // Draw the titlebar text int flags = Qt::AlignVCenter | Qt::TextSingleLine; - flags |= ( QApplication::reverseLayout() ? Qt::AlignRight : Qt::AlignLeft ); + flags |= ( QApplication::isRightToLeft() ? Qt::AlignRight : Qt::AlignLeft ); if ( clientHandler->useShadowedText() ) { - p.translate( QApplication::reverseLayout() ? -1 : 1, 1 ); + p.translate( QApplication::isRightToLeft() ? -1 : 1, 1 ); //p.setPen( options()->color(ColorTitleBar, active).dark() ); if (qGray(options()->color(ColorFont, active).rgb()) < 100) p.setPen( QColor(200,200,200) ); else p.setPen( Qt::black ); p.drawText( tr, flags, caption() ); - p.translate( QApplication::reverseLayout() ? 1 : -1, -1 ); + p.translate( QApplication::isRightToLeft() ? 1 : -1, -1 ); } p.setPen( options()->color( ColorFont, active ) ); @@ -1325,7 +1325,7 @@ void KeramikClient::calculateCaptionRect() cw += 16 + 4; // icon width + space cw = QMIN( cw, titlebar->geometry().width() ); - captionRect = QStyle::visualRect( QApplication::reverseLayout() ? Qt::RightToLeft : Qt::LeftToRight, QRect(titlebar->geometry().x(), (largeCaption ? 0 : titleBaseY), + captionRect = QStyle::visualRect( QApplication::isRightToLeft() ? Qt::RightToLeft : Qt::LeftToRight, QRect(titlebar->geometry().x(), (largeCaption ? 0 : titleBaseY), cw, clientHandler->titleBarHeight(largeCaption) ), titlebar->geometry() ); } diff --git a/clients/kwmtheme/cli_installer/main.cpp b/clients/kwmtheme/cli_installer/main.cpp index 83b6124397..71ed3c0b42 100644 --- a/clients/kwmtheme/cli_installer/main.cpp +++ b/clients/kwmtheme/cli_installer/main.cpp @@ -25,7 +25,7 @@ void copy(const QString &src, const QString &dest) kdWarning() << "Couldn't open " << src << endl; return; } - if(!copyOutput.open(IO_WriteOnly)){ + if(!copyOutput.open(QIODevice::WriteOnly)){ kdWarning() << "Couldn't open " << dest << endl; copyInput.close(); return; diff --git a/clients/modernsystem/modernsys.cpp b/clients/modernsystem/modernsys.cpp index 7b911d0e3e..e5eee9124e 100644 --- a/clients/modernsystem/modernsys.cpp +++ b/clients/modernsystem/modernsys.cpp @@ -504,7 +504,7 @@ KCommonDecorationButton *ModernSys::createButton(ButtonType type) void ModernSys::init() { - reverse = QApplication::reverseLayout(); + reverse = QApplication::isRightToLeft(); KCommonDecoration::init(); diff --git a/clients/plastik/plastik.cpp b/clients/plastik/plastik.cpp index 7ab1a67d41..95a218b0d9 100644 --- a/clients/plastik/plastik.cpp +++ b/clients/plastik/plastik.cpp @@ -89,7 +89,7 @@ bool PlastikHandler::reset(unsigned long changed) } // check if we are in reverse layout mode - m_reverse = QApplication::reverseLayout(); + m_reverse = QApplication::isRightToLeft(); // read in the configuration readConfig(); diff --git a/clients/quartz/quartz.cpp b/clients/quartz/quartz.cpp index 02962a1911..f51e4be530 100644 --- a/clients/quartz/quartz.cpp +++ b/clients/quartz/quartz.cpp @@ -211,7 +211,7 @@ void QuartzHandler::readConfig() // A small hack to make the on all desktops button look nicer onAllDesktopsButtonOnLeft = KDecoration::options()->titleButtonsLeft().contains( 'S' ); - if ( QApplication::reverseLayout() ) + if ( QApplication::isRightToLeft() ) onAllDesktopsButtonOnLeft = !onAllDesktopsButtonOnLeft; switch(options()->preferredBorderSize(this)) { case BorderLarge: diff --git a/kcmkwin/kwindecoration/preview.cpp b/kcmkwin/kwindecoration/preview.cpp index bfb88831a0..7d8a532626 100644 --- a/kcmkwin/kwindecoration/preview.cpp +++ b/kcmkwin/kwindecoration/preview.cpp @@ -127,7 +127,7 @@ void KDecorationPreview::positionPreviews() deco[Inactive]->borders( leftBorder, rightBorder, dummy1, dummy2 ); titleBarHeight = qMin( int( titleBarHeight * .9 ), 30 ); - xoffset = qMin( qMax( 10, QApplication::reverseLayout() + xoffset = qMin( qMax( 10, QApplication::isRightToLeft() ? leftBorder : rightBorder ), 30 ); // Resize the active window diff --git a/workspace.cpp b/workspace.cpp index e4c1baae6f..3b10627787 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -2374,7 +2374,7 @@ void Workspace::startKompmgr() allowKompmgrRestart = FALSE; QTimer::singleShot( 60000, this, SLOT(unblockKompmgrRestart()) ); QByteArray ba; - QDataStream arg(&ba, IO_WriteOnly); + QDataStream arg(&ba, QIODevice::WriteOnly); arg << ""; kapp->dcopClient()->emitDCOPSignal("default", "kompmgrStarted()", ba); } @@ -2390,7 +2390,7 @@ void Workspace::stopKompmgr() if (popup){ delete popup; popup = 0L; } // to add/remove opacity slider kompmgr->kill(); QByteArray ba; - QDataStream arg(&ba, IO_WriteOnly); + QDataStream arg(&ba, QIODevice::WriteOnly); arg << ""; kapp->dcopClient()->emitDCOPSignal("default", "kompmgrStopped()", ba); }