Zren / material-decoration

Material-ish window decoration theme for KWin, with LIM, based on zzag's original design.
GNU General Public License v2.0
197 stars 17 forks source link

problem with menus that are too long #29

Open guiodic opened 3 years ago

guiodic commented 3 years ago

I am not able to describe the problem clearly, so I prefer to send a video. The issue emerges only for long menues (higher than screen hight)

https://user-images.githubusercontent.com/294764/103149908-8f3c4b00-476e-11eb-8176-bafe0a0f366b.mp4

Zren commented 3 years ago

enum QStyle::ContentsType

Constant Value Description
QStyle::CT_Menu 10 A menu, like QMenu.
QStyle::CT_MenuBar 9 A menu bar, like QMenuBar.
QStyle::CT_MenuBarItem 8 A menu bar item, like the buttons in a QMenuBar.
QStyle::CT_MenuItem 7 A menu item, like QMenuItem.

enum QStyle::ControlElement

Constant Value Description
QStyle::CE_MenuBarItem 20 A menu item in a QMenuBar.
QStyle::CE_MenuBarItem 20 A menu item in a QMenuBar.
QStyle::CE_MenuBarEmptyArea 21 The empty area of a QMenuBar.
QStyle::CE_MenuItem 14 A menu item in a QMenu.
QStyle::CE_MenuScroller 15 Scrolling areas in a QMenu when the style supports scrolling.
QStyle::CE_MenuTearoff 18 A menu item representing the tear off section of a QMenu.
QStyle::CE_MenuEmptyArea 19 The area in a menu without menu items.
QStyle::CE_MenuHMargin 17 The horizontal extra space on the left/right of a menu.
QStyle::CE_MenuVMargin 16 The vertical extra space on the top/bottom of a menu.
// This adds a scroller at the top, but an overflow at the bottom :/
actionMenu->setStyleSheet(QLatin1String("QMenu { menu-scrollable: true; }"));

// We can set the dropdown X11 property after the window opens. I think it's ignored if set before.
// It does nothing visually however.
actionMenu->popup(rootPosition);
actionMenu->setAttribute(Qt::WA_X11NetWmWindowTypeDropDownMenu);
Zren commented 3 years ago

So the issue is probably because the menu bar isn't a real QMenuBar so it's drawing the menus above the original position.

Edit: What's your screen resolution?

Hmm, is there an environment variable to scale GTK applications so I can easily test in 1080p?

guiodic commented 3 years ago

Edit: What's your screen resolution?

1366x768

Hmm, is there an environment variable to scale GTK applications so I can easily test in 1080p?

I don't know, but Libreoffice is a QT app. I have the same problem with Inkscape that is GTK.

Zren commented 3 years ago

Wait nvm, I need to scale KWin not the app itself. I can use the Qt scaling env vars when restarting kwin to test it hopefully... Or just double the UI scaling... Was hoping to not scale my entire OS though.

gobonja commented 3 years ago

This can also be reproduced by making kate height smaller than submenu height, than after opening submenu (e.g. File) move mouse to next menu item that is below opened submenu (e.g. Edit) Here is video:

https://user-images.githubusercontent.com/26535797/103156694-a5b4c780-47ab-11eb-97ef-77d58e8444b5.mp4

guiodic commented 3 years ago

Yes, it's the same problem

(what's your screen recorder?)

gobonja commented 3 years ago

(what's your screen recorder?)

OBS Studio

Zren commented 3 years ago

Oh ya, it's easy to just move the window to the bottom of the screen. It looks like the menu will open up the 2nd top level menu if you hover where "Edit" is even though the "File" submenu is covering it.