Author: coolo
Date: Fri Nov 30 11:01:26 2007
New Revision: 42530
URL: http://svn.opensuse.org/viewcvs/yast?rev=42530&view=rev
Log:
follow the widget state - for reference: you don't
want to do this for wallpapers too often
Modified:
branches/tmp/coolo/qt4-port/src/YQImage.cc
branches/tmp/coolo/qt4-port/src/YQImage.h
Modified: branches/tmp/coolo/qt4-port/src/YQImage.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQImage.cc?rev=42530&r1=42529&r2=42530&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQImage.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQImage.cc Fri Nov 30 11:01:26 2007
@@ -20,6 +20,7 @@
#include
#include
#include
+#include <QIcon>
//Added by qt3to4:
#include
#define y2log_component "qt-ui"
@@ -165,5 +166,17 @@
resize( newWidth, newHeight );
}
+void YQImage::setEnabled( bool enable )
+{
+ qDebug("setEnabled %d", enable);
+ if (enable)
+ setImage( imageFileName(), animated() );
+ else {
+ // Trigger image re-display
+ QPixmap pixmap( fromUTF8( imageFileName() ) );
+ QIcon icon(pixmap);
+ QLabel::setPixmap( icon.pixmap( pixmap.size(), QIcon::Disabled, QIcon::Off) );
+ }
+}
#include "YQImage.moc"
Modified: branches/tmp/coolo/qt4-port/src/YQImage.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQImage.h?rev=42530&r1=42529&r2=42530&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQImage.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQImage.h Fri Nov 30 11:01:26 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