#pragma once

#include <QBoxLayout>
#include <QLabel>
#include <QValidator>

class DThinVBoxLayout: public QVBoxLayout
{
    Q_OBJECT
public:
    DThinVBoxLayout(QWidget *parent = 0);
};

class DThinHBoxLayout: public QHBoxLayout
{
    Q_OBJECT
public:
    DThinHBoxLayout(QWidget *parent = 0);
};

class Label: public QLabel
{
    Q_OBJECT
public:
    Label(QWidget *parent = 0, Qt::WindowFlags f = 0);
    Label(const QString &text, QWidget *parent = 0, Qt::WindowFlags f = 0);

protected:
    void mousePressEvent(QMouseEvent *ev);

Q_SIGNALS:
    void clicked();
};

class UpcaseValidator: public QValidator
{
    Q_OBJECT
public:
    UpcaseValidator(QWidget *parent = Q_NULLPTR): QValidator(parent) {}

    virtual State validate(QString &text, int &) const Q_DECL_OVERRIDE
    {
        text = text.toUpper();
        return Acceptable;
    }
};
