--------------Boundary-00=_1N9P75Y2FTQX66RV6NX2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi, I wonder if this is acceptable. All the K* versions of the line edit widge= ts=20 we have, i.e. KLineEdit and KComboBox as well as their dervaties render a read-only widget slightly differently than the corresponding Qt classes do. This patch is intended to make this consistent by applying the same thing to TextAreaWidget of KHTML. FYI, the KDE version of read-only widget's are drawn with the same background color as disabled widgets, except the text color is NOT changed. This is done to distinguish it from a read-writ= e=20 edit widget. Having stated that I am not sure if this is the proper place for the patch= =20 since we probably want to this to be consistent through KDE. Perhaps we=20 should have a KTextEdit ? I really do not want to make a new class just to= =20 override this one feature though, but if there is interest to make things=20 look consistent then I can do that. Regards, Dawit A. --------------Boundary-00=_1N9P75Y2FTQX66RV6NX2 Content-Type: text/x-diff; charset="us-ascii"; name="render_form.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="render_form.diff" Index: render_form.cpp =================================================================== RCS file: /home/kde/kdelibs/khtml/rendering/render_form.cpp,v retrieving revision 1.180 diff -u -p -b -B -w -r1.180 render_form.cpp --- render_form.cpp 2002/05/23 23:09:19 1.180 +++ render_form.cpp 2002/05/26 03:48:00 @@ -1033,6 +1033,26 @@ bool TextAreaWidget::event( QEvent *e ) return QTextEdit::event( e ); } +void TextAreaWidget::setReadOnly( bool readOnly ) +{ + QPalette p = palette(); + if (readOnly) + { + QColor color = p.color(QPalette::Disabled, QColorGroup::Background); + p.setColor(QColorGroup::Base, color); + p.setColor(QColorGroup::Background, color); + } + else + { + QColor color = p.color(QPalette::Normal, QColorGroup::Base); + p.setColor(QColorGroup::Base, color); + p.setColor(QColorGroup::Background, color); + } + setPalette(p); + + QTextEdit::setReadOnly( readOnly ); +} + // ------------------------------------------------------------------------- RenderTextArea::RenderTextArea(HTMLTextAreaElementImpl *element) Index: render_form.h =================================================================== RCS file: /home/kde/kdelibs/khtml/rendering/render_form.h,v retrieving revision 1.71 diff -u -p -b -B -w -r1.71 render_form.h --- render_form.h 2002/05/09 23:18:24 1.71 +++ render_form.h 2002/05/26 03:48:00 @@ -374,6 +374,8 @@ class TextAreaWidget : public QTextEdit { public: TextAreaWidget(int wrap, QWidget* parent); + + virtual void setReadOnly ( bool ); protected: virtual bool event (QEvent *e ); --------------Boundary-00=_1N9P75Y2FTQX66RV6NX2--