mirror of
https://github.com/CringeStudios/element-desktop.git
synced 2025-01-31 05:29:58 +01:00
Improve edge cases around macOS drag handles (#1219)
* Allow dragging macOS window by area around mx_UserMenu Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Fix context menus overlapping drag regions being unclickable Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Fix captcha overlapping drag region being unclickable Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Expand drag handle on top left user menu surround Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
1905e4759b
commit
f45f83f0f5
@ -25,7 +25,17 @@ export function setupMacosTitleBar(window: BrowserWindow): void {
|
|||||||
cssKey = await window.webContents.insertCSS(`
|
cssKey = await window.webContents.insertCSS(`
|
||||||
/* Create margin of space for the traffic light buttons */
|
/* Create margin of space for the traffic light buttons */
|
||||||
.mx_UserMenu {
|
.mx_UserMenu {
|
||||||
margin-top: 32px !important;
|
/* We zero the margin and use padding as we want to use it as a drag handle */
|
||||||
|
margin-top: 0 !important;
|
||||||
|
margin-left: 0 !important;
|
||||||
|
padding-top: 32px !important;
|
||||||
|
padding-left: 20px !important;
|
||||||
|
-webkit-app-region: drag;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
}
|
||||||
|
/* Exclude the button from being a drag handle and not working */
|
||||||
|
.mx_UserMenu > * {
|
||||||
|
-webkit-app-region: no-drag;
|
||||||
}
|
}
|
||||||
/* Maintain alignment of the toggle space panel button */
|
/* Maintain alignment of the toggle space panel button */
|
||||||
.mx_SpacePanel_toggleCollapse {
|
.mx_SpacePanel_toggleCollapse {
|
||||||
@ -112,6 +122,14 @@ export function setupMacosTitleBar(window: BrowserWindow): void {
|
|||||||
.mx_RoomPreviewCard {
|
.mx_RoomPreviewCard {
|
||||||
-webkit-app-region: no-drag;
|
-webkit-app-region: no-drag;
|
||||||
}
|
}
|
||||||
|
/* Exclude context menus and their backgrounds */
|
||||||
|
.mx_ContextualMenu, .mx_ContextualMenu_background {
|
||||||
|
-webkit-app-region: no-drag;
|
||||||
|
}
|
||||||
|
/* Exclude iframes, such as recaptcha */
|
||||||
|
iframe {
|
||||||
|
-webkit-app-region: no-drag;
|
||||||
|
}
|
||||||
`);
|
`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user