Author: coolo
Date: Fri Nov 30 11:13:41 2007
New Revision: 42532
URL: http://svn.opensuse.org/viewcvs/yast?rev=42532&view=rev
Log:
backport the icon disabling - it looks horrible with QIconset though
Modified:
trunk/qt/src/YQImage.cc
trunk/qt/src/YQImage.h
Modified: trunk/qt/src/YQImage.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQImage.cc?rev=42532&r1=42531&r2=42532&view=diff
==============================================================================
--- trunk/qt/src/YQImage.cc (original)
+++ trunk/qt/src/YQImage.cc Fri Nov 30 11:13:41 2007
@@ -20,6 +20,7 @@
#include
#include
#include
+#include
#define y2log_component "qt-ui"
#include
@@ -163,5 +164,17 @@
resize( newWidth, newHeight );
}
+void YQImage::setEnabled( bool enable )
+{
+ if (enable)
+ setImage( imageFileName(), animated() );
+ else {
+ // Trigger image re-display
+ QPixmap pixmap( fromUTF8( imageFileName() ) );
+ QIconSet icon(pixmap);
+ icon.setIconSize( QIconSet::Large, pixmap.size());
+ QLabel::setPixmap( icon.pixmap( QIconSet::Large, QIconSet::Disabled, QIconSet::Off ) );
+ }
+}
#include "YQImage.moc"
Modified: trunk/qt/src/YQImage.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQImage.h?rev=42532&r1=42531&r2=42532&view=diff
==============================================================================
--- trunk/qt/src/YQImage.h (original)
+++ trunk/qt/src/YQImage.h Fri Nov 30 11:13:41 2007
@@ -62,6 +62,11 @@
virtual void setAutoScale( bool autoScale = true );
/**
+ * if false, the image will be displayed in gray
+ */
+ virtual void setEnabled( bool enabled );
+
+ /**
* Preferred width of the widget.
*
* Reimplemented from YWidget.
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org