2021-04-29 07:49:08 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* Copyright (C) 2021 Edelhirsch Software GmbH
|
|
|
|
* This file may be used under the terms of the 3-clause BSD License
|
|
|
|
*****************************************************************************/
|
2021-04-26 06:22:35 +02:00
|
|
|
|
2021-08-04 10:11:12 +02:00
|
|
|
#pragma once
|
2021-04-26 06:22:35 +02:00
|
|
|
|
|
|
|
#include <QskGraphicLabel.h>
|
|
|
|
#include <QskLinearBox.h>
|
|
|
|
#include <QskTextLabel.h>
|
|
|
|
|
2021-07-14 14:43:12 +02:00
|
|
|
class MenuBarTopLabel final : public QskGraphicLabel
|
2021-04-26 06:22:35 +02:00
|
|
|
{
|
2021-08-04 09:31:16 +02:00
|
|
|
Q_OBJECT
|
2021-04-26 06:22:35 +02:00
|
|
|
|
2021-08-04 09:31:16 +02:00
|
|
|
public:
|
|
|
|
QSK_SUBCONTROLS( Graphic )
|
2021-04-26 06:22:35 +02:00
|
|
|
|
2021-08-26 17:02:31 +02:00
|
|
|
MenuBarTopLabel( const QString& icon, QQuickItem* parent = nullptr )
|
|
|
|
: QskGraphicLabel( icon, parent )
|
2021-08-04 09:31:16 +02:00
|
|
|
{
|
2021-08-04 15:06:04 +02:00
|
|
|
setSubcontrolProxy( QskGraphicLabel::Graphic, Graphic );
|
2021-08-04 09:31:16 +02:00
|
|
|
}
|
2021-04-26 06:22:35 +02:00
|
|
|
};
|
|
|
|
|
2021-07-14 14:43:12 +02:00
|
|
|
class MenuBarGraphicLabel final : public QskGraphicLabel
|
2021-04-26 06:22:35 +02:00
|
|
|
{
|
2021-08-04 09:31:16 +02:00
|
|
|
Q_OBJECT
|
2021-04-26 06:22:35 +02:00
|
|
|
|
2021-08-04 09:31:16 +02:00
|
|
|
public:
|
|
|
|
QSK_SUBCONTROLS( Graphic )
|
2021-04-26 06:22:35 +02:00
|
|
|
|
2021-08-26 17:02:31 +02:00
|
|
|
MenuBarGraphicLabel( const QString& icon, QQuickItem* parent = nullptr )
|
|
|
|
: QskGraphicLabel( icon, parent )
|
2021-08-04 09:31:16 +02:00
|
|
|
{
|
2021-08-04 15:06:04 +02:00
|
|
|
setSubcontrolProxy( QskGraphicLabel::Graphic, Graphic );
|
2021-08-04 09:31:16 +02:00
|
|
|
}
|
2021-04-26 06:22:35 +02:00
|
|
|
};
|
|
|
|
|
2021-07-14 14:43:12 +02:00
|
|
|
class MenuBarLabel final : public QskTextLabel
|
2021-04-26 06:22:35 +02:00
|
|
|
{
|
2021-08-04 09:31:16 +02:00
|
|
|
Q_OBJECT
|
2021-04-26 06:22:35 +02:00
|
|
|
|
2021-08-04 09:31:16 +02:00
|
|
|
public:
|
|
|
|
QSK_SUBCONTROLS( Text )
|
2021-04-26 06:22:35 +02:00
|
|
|
|
2021-08-04 09:31:16 +02:00
|
|
|
MenuBarLabel( const QString& text, QQuickItem* parent = nullptr )
|
|
|
|
: QskTextLabel( text, parent )
|
|
|
|
{
|
2021-08-04 15:06:04 +02:00
|
|
|
setSubcontrolProxy( QskTextLabel::Text, Text );
|
2021-08-04 09:31:16 +02:00
|
|
|
}
|
2021-04-26 06:22:35 +02:00
|
|
|
};
|
|
|
|
|
2021-07-14 14:43:12 +02:00
|
|
|
class MenuItem final : public QskLinearBox
|
2021-04-26 06:22:35 +02:00
|
|
|
{
|
2021-08-04 09:31:16 +02:00
|
|
|
Q_OBJECT
|
2021-04-26 06:22:35 +02:00
|
|
|
|
2021-08-04 09:31:16 +02:00
|
|
|
public:
|
|
|
|
QSK_SUBCONTROLS( Panel )
|
|
|
|
QSK_STATES( Active )
|
2021-04-26 06:22:35 +02:00
|
|
|
|
2021-08-04 09:31:16 +02:00
|
|
|
MenuItem( const QString& name, QQuickItem* parent );
|
2021-04-26 06:22:35 +02:00
|
|
|
};
|
|
|
|
|
2021-07-14 14:43:12 +02:00
|
|
|
class MenuBar final : public QskLinearBox
|
2021-04-26 06:22:35 +02:00
|
|
|
{
|
2021-08-04 09:31:16 +02:00
|
|
|
Q_OBJECT
|
2021-04-26 06:22:35 +02:00
|
|
|
|
2021-08-04 09:31:16 +02:00
|
|
|
public:
|
|
|
|
QSK_SUBCONTROLS( Panel )
|
2021-04-26 06:22:35 +02:00
|
|
|
|
2021-08-04 09:31:16 +02:00
|
|
|
MenuBar( QQuickItem* parent );
|
2021-04-26 06:22:35 +02:00
|
|
|
|
2021-08-04 09:31:16 +02:00
|
|
|
private:
|
|
|
|
QList< QString > m_entryStrings;
|
|
|
|
QList< MenuItem* > m_entries;
|
|
|
|
uint m_activeEntry = 0;
|
2021-04-26 06:22:35 +02:00
|
|
|
};
|