Uwe Rathmann 484780a40e using "icon" instead of "graphic".
"icon" was not used to avoid confusing with QIcon,
but it is probably more confusing not to use the name that
is used by almost all toolkits.
2023-03-08 14:11:27 +01:00

58 lines
1.2 KiB
C++

/******************************************************************************
* Copyright (C) 2021 Edelhirsch Software GmbH
* This file may be used under the terms of the 3-clause BSD License
*****************************************************************************/
#pragma once
#include <QskGraphicLabel.h>
#include <QskLinearBox.h>
#include <QskPushButton.h>
#include <QskTextLabel.h>
#include "MainItem.h"
class MenuBarTopLabel final : public QskGraphicLabel
{
Q_OBJECT
public:
QSK_SUBCONTROLS( Icon )
MenuBarTopLabel( const QString& icon, QQuickItem* parent = nullptr )
: QskGraphicLabel( icon, parent )
{
setSubcontrolProxy( QskGraphicLabel::Graphic, Graphic );
}
};
class MenuButton final : public QskPushButton
{
Q_OBJECT
public:
QSK_SUBCONTROLS( Panel, Text, Icon )
MenuButton( const QString& name, QQuickItem* parent );
};
class MenuBar final : public QskLinearBox
{
Q_OBJECT
public:
QSK_SUBCONTROLS( Panel )
MenuBar( QQuickItem* parent );
Q_SIGNALS:
void pageChangeRequested( const int index );
public Q_SLOTS:
void setActivePage( const int index );
private:
MenuButton* m_buttons[ Cube::NumPositions ];
uint m_currentIndex;
};