summary refs log tree commit diff
path: root/include/ui/Menu.h
blob: 78a35b432388047032a55e50309d830333e1dcf1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#pragma once

#include <QMenu>

class Menu : public QMenu
{
public:
	Menu(QWidget *parent = nullptr)
	    : QMenu(parent)
	{
		setFont(QFont("Open Sans", 10));
		setStyleSheet(
			"QMenu { background-color: white; margin: 0px;}"
			"QMenu::item { padding: 7px 20px; border: 1px solid transparent; margin: 2px 0px; }"
			"QMenu::item:selected { background: rgba(180, 180, 180, 100); }");
	};

protected:
	void leaveEvent(QEvent *e)
	{
		Q_UNUSED(e);

		hide();
	}
};