From ce477303019c7f3ba18dcab48e4205d59614ce5a Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 17 Sep 2015 17:30:17 -0500 Subject: Add initial cryptographic card login support Tested with themed greeter and SAK disabled --- tdm/kfrontend/themer/tdmitem.cpp | 21 ++++++++++++++++----- tdm/kfrontend/themer/tdmitem.h | 1 + tdm/kfrontend/themer/tdmlabel.h | 6 +++--- tdm/kfrontend/themer/tdmthemer.cpp | 6 ++++++ tdm/kfrontend/themer/tdmthemer.h | 1 + 5 files changed, 27 insertions(+), 8 deletions(-) (limited to 'tdm/kfrontend/themer') diff --git a/tdm/kfrontend/themer/tdmitem.cpp b/tdm/kfrontend/themer/tdmitem.cpp index f5eabdb56..26a4887c1 100644 --- a/tdm/kfrontend/themer/tdmitem.cpp +++ b/tdm/kfrontend/themer/tdmitem.cpp @@ -204,6 +204,22 @@ KdmItem::findNode( const TQString &_id ) const return 0; } +KdmItem * +KdmItem::findNodeByType( const TQString &_type ) const +{ + if (itemType == _type) + return const_cast( this ); + + TQValueList::ConstIterator it; + for (it = m_children.begin(); it != m_children.end(); ++it) { + KdmItem *t = (*it)->findNodeByType( _type ); + if (t) + return t; + } + + return 0; +} + void KdmItem::setWidget( TQWidget *widget ) { @@ -336,11 +352,6 @@ KdmItem::paint( TQPainter *p, const TQRect &rect ) else { // We have compositing support! TQRgb blend_color = tqRgba(m_backgroundModifier, m_backgroundModifier, m_backgroundModifier, 0); // RGBA overlay - float alpha = tqAlpha(blend_color) / 255.; - int pixel = tqAlpha(blend_color) << 24 | - int(tqRed(blend_color) * alpha) << 16 | - int(tqGreen(blend_color) * alpha) << 8 | - int(tqBlue(blend_color) * alpha); TQImage img( myWidget->size(), 32 ); img = img.convertDepth(32); diff --git a/tdm/kfrontend/themer/tdmitem.h b/tdm/kfrontend/themer/tdmitem.h index be7fa65d3..d2aeed69c 100644 --- a/tdm/kfrontend/themer/tdmitem.h +++ b/tdm/kfrontend/themer/tdmitem.h @@ -152,6 +152,7 @@ public: } KdmItem *findNode( const TQString &id ) const; + KdmItem *findNodeByType( const TQString &type ) const; virtual void setWidget( TQWidget *widget ); TQWidget *widget() const { return myWidget; } virtual void setLayoutItem( TQLayoutItem *item ); diff --git a/tdm/kfrontend/themer/tdmlabel.h b/tdm/kfrontend/themer/tdmlabel.h index 8b955fca5..e45d68091 100644 --- a/tdm/kfrontend/themer/tdmlabel.h +++ b/tdm/kfrontend/themer/tdmlabel.h @@ -40,6 +40,9 @@ public: KdmLabel( KdmItem *parent, const TQDomNode &node, const char *name = 0 ); void setText( const TQString &txt ); + /* Method to lookup the caption associated with an item */ + TQString lookupStock( const TQString &stock ); + protected: // reimplemented; returns the minimum size of rendered text virtual TQSize sizeHint(); @@ -71,9 +74,6 @@ public slots: void slotAccel(); private: - /* Method to lookup the caption associated with an item */ - TQString lookupStock( const TQString &stock ); - /* Lookup variables in the text */ TQString lookupText( const TQString &t ); diff --git a/tdm/kfrontend/themer/tdmthemer.cpp b/tdm/kfrontend/themer/tdmthemer.cpp index d6d051cf8..6c27b7629 100644 --- a/tdm/kfrontend/themer/tdmthemer.cpp +++ b/tdm/kfrontend/themer/tdmthemer.cpp @@ -117,6 +117,12 @@ KdmThemer::findNode( const TQString &item ) const return rootItem->findNode( item ); } +KdmItem * +KdmThemer::findNodeByType( const TQString &item ) const +{ + return rootItem->findNodeByType( item ); +} + void KdmThemer::updateGeometry( bool force ) { diff --git a/tdm/kfrontend/themer/tdmthemer.h b/tdm/kfrontend/themer/tdmthemer.h index 2b8865b4d..785a116da 100644 --- a/tdm/kfrontend/themer/tdmthemer.h +++ b/tdm/kfrontend/themer/tdmthemer.h @@ -72,6 +72,7 @@ public: virtual // just to put the reference in the vmt KdmItem *findNode( const TQString & ) const; + KdmItem *findNodeByType( const TQString & ) const; void updateGeometry( bool force ); // force = true for external calls -- cgit v1.2.1