Taimoor-Tariq / BetterDiscordStuff

My BetterDiscord Plugins and Themes
https://ko-fi.com/TaimoorTariq
GNU General Public License v2.0
19 stars 17 forks source link

[ FEATURE | (SendTimestamps) ] Show send timestamps in the โ€œnewโ€ menu #29

Closed TheChilliPL closed 2 years ago

TheChilliPL commented 2 years ago

It would be great if the button could be moved to the menu with the plus icon, where normally you can send files or create threads. image

Taimoor-Tariq commented 2 years ago

Sorry, I tried doing this when I first made the plugin and it is not possible to do this with the current API we have.

TheChilliPL commented 2 years ago

Wouldn't it be possible manually with the DOM mutation observers? It would probably be a bit harder to do, but it would just require detecting when Discord creates this popup and adding an element there, I believe

Taimoor-Tariq commented 2 years ago

I will look into it in the next week

Taimoor-Tariq commented 2 years ago

I figured out a way to do it, It's in the version I just released!

TheChilliPL commented 2 years ago

Wow, that was really fast! It seems to work well, although I can only see one tiny problem with styling: image image The button, unlike any other, doesn't have the blue glow on hover. Also, if you hover at any other button after this one, it doesn't get the hover effect: image For some unknown reason, the effect isn't done with the :hover pseudoclass, but with JS, adding the focused-3qFvc8 class to the label container element. If my research in devtools is correct, t's added by Discord in the pointerenter event and removed in the mouseout event handlers. The weird thing is that the pointerenter event doesn't seem to fire on the file send button if moving the mouse from the timestamp button, not sure why that is

Taimoor-Tariq commented 2 years ago

I already had this implemented but didn't test it without my theme lol. I fixed it and it should work properly now. Let me know if it works for you ๐Ÿ’›

TheChilliPL commented 2 years ago

It does work unless I move my mouse back to the โ€œsend a fileโ€ button ๐Ÿค” image

Taimoor-Tariq commented 2 years ago

I released a new version, should be fixed now ๐Ÿ’›

TheChilliPL commented 2 years ago

Out of curiosity, why did it happen and how did you fix that? ๐Ÿค” Thanks for the update, works flawlessly now!

Taimoor-Tariq commented 2 years ago

I just added another event listener to the "upload option" in the menu ๐Ÿ˜†.