From 6ffd3286c3552feed07ec4adedaf368ee08672ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Imobach=20Gonz=C3=A1lez=20Sosa?= Date: Mon, 10 Oct 2016 17:02:04 +0100 Subject: [PATCH] Clean-up old palette support for vision impaired users --- src/YQUI.cc | 48 ------------------------------------------------ src/YQUI.h | 25 ------------------------- 2 files changed, 73 deletions(-) diff --git a/src/YQUI.cc b/src/YQUI.cc index e4e5db1e..9c20c317 100644 --- a/src/YQUI.cc +++ b/src/YQUI.cc @@ -103,7 +103,6 @@ YQUI::YQUI( bool withThreads ) _uiInitialized = false; _fatalError = false; _fullscreen = false; - _usingVisionImpairedPalette = false; _noborder = false; screenShotNameTemplate = ""; _blockedLevel = 0; @@ -158,7 +157,6 @@ void YQUI::initUI() _busyCursorTimer = new QTimer( _signalReceiver ); _busyCursorTimer->setSingleShot( true ); - _normalPalette = qApp->palette(); (void) QY2Styler::styler(); // Make sure QY2Styler singleton is created setButtonOrderFromEnvironment(); @@ -628,52 +626,6 @@ void YQUI::deleteNotify( YWidget * widget ) _eventHandler.deletePendingEventsFor( widget ); } - -void YQUI::toggleVisionImpairedPalette() -{ - QY2Styler::styler()->toggleHighContrastStyleSheet(); -} - -bool YQUI::usingVisionImpairedPalette() { - return QY2Styler::styler()->usingHighContrastStyleSheet(); -} - -QPalette -YQUI::visionImpairedPalette() -{ - const QColor dark ( 0x20, 0x20, 0x20 ); - QPalette pal; - - // 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; -} - - // FIXME: Does this still do anything now that YQUI is no longer a QObject? bool YQUI::close() { diff --git a/src/YQUI.h b/src/YQUI.h index 8a1be749..ba9a5510 100644 --- a/src/YQUI.h +++ b/src/YQUI.h @@ -28,7 +28,6 @@ #include #include #include -#include #include #include @@ -271,27 +270,6 @@ class YQUI: public YUI **/ static void setTextdomain( const char * domain ); - /** - * Returns a high-contrast color palette suitable for vision impaired users. - **/ - static QPalette visionImpairedPalette(); - - /** - * Returns the normal color palette - **/ - QPalette normalPalette() const { return _normalPalette; } - - /** - * Toggle between the vision impaired and the normal color palette. - **/ - void toggleVisionImpairedPalette(); - - /** - * Returns 'true' if high-contrast colors for vision impaired users is in use. - * This should be queried at other places before using custom colors. - **/ - bool usingVisionImpairedPalette(); - /** * Returns the application name for the window title (e.g. "YaST2@hostname") **/ @@ -369,9 +347,6 @@ class YQUI: public YUI YSimpleEventHandler _eventHandler; int _blockedLevel; - QPalette _normalPalette; - bool _usingVisionImpairedPalette; - bool _leftHandedMouse; bool _askedForLeftHandedMouse;