[yast-commit] r42615 - /branches/tmp/coolo/qt4-port/src/YQUI_x11.cc
![](https://seccdn.libravatar.org/avatar/d5900b51dba6d927d3feaf3b73360d4f.jpg?s=120&d=mm&r=g)
Author: dmacvicar Date: Mon Dec 3 16:59:22 2007 New Revision: 42615 URL: http://svn.opensuse.org/viewcvs/yast?rev=42615&view=rev Log: YQUI_x11 Modified: branches/tmp/coolo/qt4-port/src/YQUI_x11.cc Modified: branches/tmp/coolo/qt4-port/src/YQUI_x11.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQUI_x1... ============================================================================== --- branches/tmp/coolo/qt4-port/src/YQUI_x11.cc (original) +++ branches/tmp/coolo/qt4-port/src/YQUI_x11.cc Mon Dec 3 16:59:22 2007 @@ -18,18 +18,15 @@ /-*/ -#define QT3_SUPPORT -#include <qevent.h> -#include <qcursor.h> -#include <q3widgetstack.h> -#include <q3vbox.h> -#include <qwidget.h> -#include <qtextcodec.h> -#include <qregexp.h> -#include <qlocale.h> -#include <qmessagebox.h> +#include <QEvent> +#include <QCursor> +#include <QWidget> +#include <QTextCodec> +#include <QRegExp> +#include <QLocale> +#include <QMessageBox> #include <QColorGroup> -#include <QtGui/qdesktopwidget.h> +#include <QDesktopWidget> #define y2log_component "qt-ui" @@ -126,15 +123,13 @@ { if ( _usingVisionImpairedPalette ) { - qApp->setPalette( normalPalette(), - true ); // informWidgets + qApp->setPalette( normalPalette()); // informWidgets _usingVisionImpairedPalette = false; } else { - qApp->setPalette( visionImpairedPalette(), - true ); // informWidgets + qApp->setPalette( visionImpairedPalette() ); // informWidgets _usingVisionImpairedPalette = true; } @@ -144,37 +139,33 @@ QPalette YQUI::visionImpairedPalette() { const QColor dark ( 0x20, 0x20, 0x20 ); + QPalette pal; - QColorGroup activeCg; // for the active window (the one with the keyboard focus) - - activeCg.setColor( QColorGroup::Background, Qt::black ); - activeCg.setColor( QColorGroup::Foreground, Qt::cyan ); - activeCg.setColor( QColorGroup::Text, Qt::cyan ); - activeCg.setColor( QColorGroup::Base, dark ); - activeCg.setColor( QColorGroup::Button, dark ); - activeCg.setColor( QColorGroup::ButtonText, Qt::green ); - activeCg.setColor( QColorGroup::Highlight, Qt::yellow ); - activeCg.setColor( QColorGroup::HighlightedText, Qt::black ); - - QColorGroup inactiveCg; // for other windows (those that don't have the keyboard focus) - - inactiveCg.setColor( QColorGroup::Background, Qt::black ); - inactiveCg.setColor( QColorGroup::Foreground, Qt::cyan ); - inactiveCg.setColor( QColorGroup::Text, Qt::cyan ); - inactiveCg.setColor( QColorGroup::Base, dark ); - inactiveCg.setColor( QColorGroup::Button, dark ); - inactiveCg.setColor( QColorGroup::ButtonText, Qt::green ); - - QColorGroup disabledCg; // for disabled widgets - - disabledCg.setColor( QColorGroup::Background, Qt::black ); - disabledCg.setColor( QColorGroup::Foreground, Qt::gray ); - disabledCg.setColor( QColorGroup::Text, Qt::gray ); - disabledCg.setColor( QColorGroup::Base, dark ); - disabledCg.setColor( QColorGroup::Button, dark ); - disabledCg.setColor( QColorGroup::ButtonText, Qt::gray ); - - QPalette pal( activeCg, disabledCg, inactiveCg ); + // for the active window (the one with the keyboard focus) + pal.setColor( QPalette::Active, QPalette::Background, Qt::black ); + pal.setColor( QPalette::Active, QPalette::Foreground, Qt::cyan ); + pal.setColor( QPalette::Active, QPalette::Text, Qt::cyan ); + pal.setColor( QPalette::Active, QPalette::Base, dark ); + pal.setColor( QPalette::Active, QPalette::Button, dark ); + pal.setColor( QPalette::Active, QPalette::ButtonText, Qt::green ); + pal.setColor( QPalette::Active, QPalette::Highlight, Qt::yellow ); + pal.setColor( QPalette::Active, QPalette::HighlightedText, Qt::black ); + + // for other windows (those that don't have the keyboard focus) + pal.setColor( QPalette::Inactive, QPalette::Background, Qt::black ); + pal.setColor( QPalette::Inactive, QPalette::Foreground, Qt::cyan ); + pal.setColor( QPalette::Inactive, QPalette::Text, Qt::cyan ); + pal.setColor( QPalette::Inactive, QPalette::Base, dark ); + pal.setColor( QPalette::Inactive, QPalette::Button, dark ); + pal.setColor( QPalette::Inactive, QPalette::ButtonText, Qt::green ); + + // for disabled widgets + pal.setColor( QPalette::Disabled, QPalette::Background, Qt::black ); + pal.setColor( QPalette::Disabled, QPalette::Foreground, Qt::gray ); + pal.setColor( QPalette::Disabled, QPalette::Text, Qt::gray ); + pal.setColor( QPalette::Disabled, QPalette::Base, dark ); + pal.setColor( QPalette::Disabled, QPalette::Button, dark ); + pal.setColor( QPalette::Disabled, QPalette::ButtonText, Qt::gray ); return pal; } @@ -256,7 +247,7 @@ QWidget * widget = dynamic_cast<QWidget *> (obj); if ( widget ) - widget->setActiveWindow(); + widget->activateWindow(); } return false; // Don't stop event processing -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
dmacvicar@svn.opensuse.org