Files
miniCashAll/libMiniCash/swsidebar.h
2025-08-05 22:37:51 +02:00

70 lines
1.6 KiB
C++

/***************************************************************************
source::worx libWidgets
Copyright © 2021-2022 c.holzheuer
c.holzheuer@sourceworx.org
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
***************************************************************************/
#ifndef SWSIDEBAR_H
#define SWSIDEBAR_H
#include <QWidget>
#include <QAction>
#include <QFrame>
#include <libMiniCash.h>
class LIBMINICASH_EXPORT SWSideBar : public QFrame
{
Q_OBJECT
public:
explicit SWSideBar( QWidget *parent = nullptr );
virtual ~SWSideBar();
void appendAction( QAction* action );
void appendAction( const QIcon &icon, const QString &text = "" );
void setCheckedAction( QAction* action );
QSize minimumSizeHint() const;
signals:
public slots:
//void koo();
protected:
void paintEvent( QPaintEvent *event );
void mousePressEvent( QMouseEvent *event );
void mouseReleaseEvent( QMouseEvent *event );
void mouseMoveEvent( QMouseEvent *event );
void leaveEvent( QEvent * event );
QAction* actionAt( const QPoint &at );
static const int SWACTIONHEIGHT = 108;
const QColor _hoveredColor = QColor( 150, 150, 150 );
const QColor _checkedColor = QColor( 55, 55, 55 );
QAction* _hoveredAction = nullptr;
QAction* _pressedAction = nullptr;
QAction* _checkedAction = nullptr;
};
#endif // SWSIDEBAR_H