mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-23 03:18:49 +03:00
30fb46e25b
Basically reverts the last font related commits since pointSize isn't as reliable as pixelSize. Also some layout values (margins, spacings) have been moved out to Config.h.
30 lines
563 B
C++
30 lines
563 B
C++
#pragma once
|
|
|
|
#include <QMenu>
|
|
|
|
#include "Config.h"
|
|
|
|
class Menu : public QMenu
|
|
{
|
|
public:
|
|
Menu(QWidget *parent = nullptr)
|
|
: QMenu(parent)
|
|
{
|
|
QFont font;
|
|
font.setPixelSize(conf::fontSize);
|
|
|
|
setFont(font);
|
|
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); }");
|
|
};
|
|
|
|
protected:
|
|
void leaveEvent(QEvent *e)
|
|
{
|
|
Q_UNUSED(e);
|
|
|
|
hide();
|
|
}
|
|
};
|