~ubuntu-branches/ubuntu/hardy/kdebase-workspace/hardy

« back to all changes in this revision

Viewing changes to plasma/applets/pager/pager.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2008-03-03 11:37:30 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20080303113730-ppdchskh93rr77le
Tags: 4:4.0.2-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
257
257
            m_rows = m_desktopCount;
258
258
        }
259
259
        globalcg.writeEntry("rows", m_rows);
 
260
        emit configNeedsSaving();
260
261
        // force an update of the column count in recalculateGeometry
261
262
        m_columns = 0;
262
263
        m_size = QSizeF(-1, -1);
518
519
    Q_UNUSED( option );
519
520
    Q_UNUSED( contentsRect );
520
521
 
521
 
    // paint desktop background
522
 
    QBrush hoverBrush(QColor(255,255,255,50));
 
522
    KColorScheme plasmaColorTheme = KColorScheme(QPalette::Active, KColorScheme::View, Plasma::Theme::self()->colors());
 
523
    painter->setFont(KGlobalSettings::taskbarFont());
 
524
 
 
525
    // Desktop background
 
526
    QColor textColor = Plasma::Theme::self()->textColor();
 
527
    textColor.setAlpha(64);
 
528
    QBrush hoverBrush(textColor);
523
529
    QBrush defaultBrush(Qt::NoBrush);
 
530
 
 
531
    // Inactive windows
 
532
    QColor drawingColor = plasmaColorTheme.foreground(KColorScheme::InactiveText).color();
 
533
    drawingColor.setAlpha(192);
 
534
    QBrush windowBrush(drawingColor);
 
535
 
 
536
    // Inactive window borders
 
537
    drawingColor = plasmaColorTheme.foreground(KColorScheme::NeutralText).color();
 
538
    drawingColor.setAlpha(238);
 
539
    QPen windowPen(drawingColor);
 
540
 
 
541
    // Active window borders
 
542
    QPen activeWindowPen(Plasma::Theme::self()->textColor());
 
543
 
 
544
    // Active windows
 
545
    drawingColor.setAlpha(238);
 
546
    QBrush activeWindowBrush(drawingColor);
 
547
 
 
548
    //kDebug() << "InActive (brush, pen): " << windowBrush.color() << windowPen.color();
 
549
    //kDebug() << "Active (brush, pen)  : " << activeWindowBrush.color() << activeWindowPen.color();
 
550
 
524
551
    painter->setPen(Qt::NoPen);
525
552
    for (int i = 0; i < m_desktopCount; i++) {
526
553
        if (m_rects[i] == m_hoverRect) {
531
558
        painter->drawRect(m_rects[i]);
532
559
    }
533
560
 
534
 
    // draw window thumbnails
535
 
    QPen windowPen(Qt::white);
536
 
    QBrush windowBrush(QColor(200,200,200));
537
 
    QBrush activeWindowBrush(QColor(100,100,255));
538
561
    painter->setPen(windowPen);
 
562
 
539
563
    for (int i = 0; i < m_windowRects.count(); i++) {
540
564
        for (int j = 0; j < m_windowRects[i].count(); j++) {
541
565
            QRect rect = m_windowRects[i][j].second;
542
566
            if (m_activeWindows.contains(rect)) {
543
567
                painter->setBrush(activeWindowBrush);
 
568
                painter->setPen(activeWindowPen);
544
569
            } else {
545
570
                painter->setBrush(windowBrush);
 
571
                painter->setPen(windowPen);
546
572
            }
547
573
            if (m_dragId == m_windowRects[i][j].first) {
548
574
                rect.translate((m_dragCurrentPos - m_dragOriginalPos).toPoint());
554
580
        }
555
581
    }
556
582
 
557
 
    // draw desktop foreground
 
583
    // draw desktop frame and number
558
584
    painter->setClipRect(option->exposedRect);
559
 
    QPen activePen(Qt::white);
560
 
    QPen defaultPen(QColor(120,120,120));
 
585
    QPen activePen(Plasma::Theme::self()->textColor());
 
586
    QPen drawingPen = QPen();
561
587
    painter->setBrush(Qt::NoBrush);
 
588
 
562
589
    for( int i = 0; i < m_desktopCount; i++) {
563
590
        if (i + 1 == m_currentDesktop || i == m_dragHighlightedDesktop) {
 
591
            drawingPen = QPen(Plasma::Theme::self()->textColor());
 
592
        } else {
 
593
            drawingPen = QPen(plasmaColorTheme.foreground(KColorScheme::InactiveText).color());
 
594
        }
 
595
        painter->setPen(drawingPen);
 
596
        painter->drawRect(m_rects[i]);
 
597
 
 
598
        if (m_showDesktopNumber) {
564
599
            painter->setPen(activePen);
565
 
        } else {
566
 
            painter->setPen(defaultPen);
567
 
        }
568
 
 
569
 
        painter->drawRect(m_rects[i]);
570
 
 
571
 
        if (m_showDesktopNumber) {
572
600
            painter->drawText(m_rects[i], Qt::AlignCenter, QString::number(i+1));
573
601
        }
574
602
    }