matrixion/include/ui/Menu.h

31 lines
581 B
C
Raw Normal View History

2017-05-31 17:06:03 +03:00
#pragma once
#include <QMenu>
#include "Config.h"
2017-05-31 17:06:03 +03:00
class Menu : public QMenu
{
public:
Menu(QWidget *parent = nullptr)
2017-08-20 13:47:22 +03:00
: QMenu(parent)
2017-05-31 17:06:03 +03:00
{
QFont font;
font.setPixelSize(conf::fontSize);
setFont(font);
2017-08-20 13:47:22 +03:00
setStyleSheet("QMenu { color: black; background-color: white; margin: 0px;}"
"QMenu::item { color: black; padding: 7px 20px; border: 1px solid transparent; margin: "
"2px 0px; }"
"QMenu::item:selected { color: black; background: rgba(180, 180, 180, 100); }");
2017-05-31 17:06:03 +03:00
};
protected:
void leaveEvent(QEvent *e)
{
Q_UNUSED(e);
hide();
}
};