From c184362044a222546c1c3a0519f47754067742e6 Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Wed, 31 May 2017 17:06:03 +0300 Subject: Add menu to toggle notifications --- include/ui/Menu.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 include/ui/Menu.h (limited to 'include/ui/Menu.h') diff --git a/include/ui/Menu.h b/include/ui/Menu.h new file mode 100644 index 00000000..78a35b43 --- /dev/null +++ b/include/ui/Menu.h @@ -0,0 +1,25 @@ +#pragma once + +#include + +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(); + } +}; -- cgit 1.5.1