OrangeDrangon / android-messages-desktop

Android Messages as a Cross-platform Desktop App
Other
312 stars 27 forks source link

Remove titlebar on macos #374

Closed OrangeDrangon closed 2 years ago

OrangeDrangon commented 2 years ago

The current change just removes the frame. It does not mark any draggable regions. If the frame is gone and you cannot move the window we can work towards marking a good location as draggable.

myspivey commented 2 years ago

This does indeed make the window not draggable. The fix can be found in adjusting the style sheet. This is the code that made it work from the previous version. https://github.com/chrisknepper/android-messages-desktop/blob/b3abdcddc288e7aace0be452713a4949f1c8348f/src/stylesheets/main.css#L51

OrangeDrangon commented 2 years ago

Since we now load the website directly we need to pick part of the page that is always available. Or maybe we can inject a bar?

myspivey commented 2 years ago

Ya, without a custom header there is not a great way to inject a draggable area. Looking at the divs existing are we could latch onto this is the best, and that has other interactive elements in it so not great as a draggable area. So I think the only way really is injecting a small draggable bar that knocks the screen down a bit. Screen Shot 2022-04-21 at 4 10 09 PM k

OrangeDrangon commented 2 years ago

Does the dom have a app-root (I assume this is an angular app) that we can slide next too. I wouldn't want to interfere with the apps dom. Might cause unexpected issues.

myspivey commented 2 years ago

Screen Shot 2022-04-21 at 4 18 32 PM

main-stack includes all of it

myspivey commented 2 years ago

Just doing a quick hack of things this worked easy for a bar, and the bar states when moving around. If you inject it below this, it will get wiped out on any changing of visible message because of router-outlet

image image document.getElementsByTagName('mw-app')[0].parentNode.prepend(document.createElement('div'))

OrangeDrangon commented 2 years ago

Makes sense. I'll push a new commit up for testing later.

OrangeDrangon commented 2 years ago

Currently the titlebar will always be injected. Potentially only want to do it on mac.

myspivey commented 2 years ago

Tested and it works

OrangeDrangon commented 2 years ago

Can you confirm it still works otherwise I will need to revert that commit and make sure the bar doesnt interfere on other platforms.

myspivey commented 2 years ago

Confirmed still working with latest from this PR

OrangeDrangon commented 2 years ago

Does the size feel correct? As in do you find it obvious where you can drag even though the bar is invisible?

myspivey commented 2 years ago

Ya, there is plenty of space to grab it. Sure we could refine it but I would be happy with this.

OrangeDrangon commented 2 years ago

Good enough for me