Skip to content

Commit

Permalink
fix: improve menu style
Browse files Browse the repository at this point in the history
  • Loading branch information
vzhd1701 committed Jun 21, 2022
1 parent 8ce0d4b commit 9d3e489
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions gridplayer/player/managers/menu.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from types import MappingProxyType

from PyQt5.QtCore import QEvent
from PyQt5.QtCore import QEvent, Qt
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QMenu, QProxyStyle, QStyle

Expand All @@ -9,10 +9,25 @@
from gridplayer.utils.qt import translate

MENU_STYLE = """
QMenu::item { height:24px; padding: 2px; margin: 0 5px;}
QMenu::item:selected { background-color: #53aedf; }
QMenu::item:checked { background-color: #7b888f; }
QMenu::separator { height: 2px; margin: 0; }
QMenu {
background-color: #eee;
color: #000;
border: 1px solid #aaa;
margin: 0;
menu-scrollable: 0;
}
QMenu::icon { margin-left: 5px;}
QMenu::item {
height:24px;
margin: 0;
padding: 1px 5px 1px 5px;
background: transparent;
border: 0 solid transparent;
}
QMenu::separator { height: 1px; margin: 2px 3px; background: #aaa; }
QMenu::item:selected { background-color: #bbb; }
QMenu::item:checked { background-color: #888; }
QMenu::item:checked:selected { background-color: #bbb; }
"""

SUBMENUS = MappingProxyType(
Expand Down Expand Up @@ -155,6 +170,9 @@ def make_menu(self):
menu = QMenu(self.parent())
menu.setStyle(BigMenuIcons())
menu.setStyleSheet(MENU_STYLE)
menu.setWindowFlags(
menu.windowFlags() | Qt.FramelessWindowHint | Qt.NoDropShadowWindowHint
)

menu_sections = self._menu_sections()

Expand Down

0 comments on commit 9d3e489

Please sign in to comment.