matrixion/include/ui/Menu.h

33 lines
779 B
C
Raw Permalink 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:
2017-09-10 12:59:21 +03:00
Menu(QWidget *parent = nullptr)
: QMenu(parent)
{
QFont font;
font.setPixelSize(conf::fontSize);
2017-09-10 12:59:21 +03:00
setFont(font);
setStyleSheet(
"QMenu { color: black; background-color: white; margin: 0px;}"
2017-10-01 12:11:33 +03:00
"QMenu::item {"
"color: black; padding: 7px 20px; border: 1px solid transparent;"
"margin: 2px 0px; }"
2017-09-10 12:59:21 +03:00
"QMenu::item:selected { color: black; background: rgba(180, 180, 180, 100); }");
};
2017-05-31 17:06:03 +03:00
protected:
2017-09-10 12:59:21 +03:00
void leaveEvent(QEvent *e)
{
Q_UNUSED(e);
2017-05-31 17:06:03 +03:00
2017-09-10 12:59:21 +03:00
hide();
}
2017-05-31 17:06:03 +03:00
};