qskinny/playground/inputpanel/LineEditSkinlet.h

45 lines
1.1 KiB
C
Raw Normal View History

2017-07-21 18:21:34 +02:00
/******************************************************************************
* QSkinny - Copyright (C) 2016 Uwe Rathmann
* This file may be used under the terms of the QSkinny License, Version 1.0
*****************************************************************************/
#ifndef _LINE_EDIT_SKINLET_H
#define _LINE_EDIT_SKINLET_H
2017-07-21 18:21:34 +02:00
#include "QskGlobal.h"
#include "QskSkinlet.h"
class LineEdit;
2017-07-21 18:21:34 +02:00
class LineEditSkinlet : public QskSkinlet
2017-07-21 18:21:34 +02:00
{
Q_GADGET
using Inherited = QskSkinlet;
public:
enum NodeRole
{
BackgroundRole,
ForegroundRole
};
Q_INVOKABLE LineEditSkinlet( QskSkin* = nullptr );
virtual ~LineEditSkinlet();
2017-07-21 18:21:34 +02:00
virtual QRectF subControlRect( const QskSkinnable*,
QskAspect::Subcontrol ) const override;
protected:
virtual QSGNode* updateSubNode( const QskSkinnable*,
quint8, QSGNode* ) const override;
private:
QRectF panelRect( const LineEdit* ) const;
2017-07-21 18:21:34 +02:00
QSGNode* updateBackgroundNode( const LineEdit*, QSGNode* ) const;
QSGNode* updateForegroundNode( const LineEdit*, QSGNode* ) const;
2017-07-21 18:21:34 +02:00
};
#endif