Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Plugin] styled-bars #201

Merged
merged 35 commits into from
Mar 31, 2021
Merged

[Plugin] styled-bars #201

merged 35 commits into from
Mar 31, 2021

Conversation

Araxeus
Copy link
Collaborator

@Araxeus Araxeus commented Mar 23, 2021

I got bored of the old bars :)
This plugin changes the Titlebar, main menu, and scrollbar
If Hide Menu option is active - Menu can be toggled on/off when pressing Escape key

Pictures:

With menu on::

menuOn

With menu off:

noMenu

Files changed:


  • Start window with no frame if plugin is on
    frame: !is.macOS() && !config.plugins.isEnabled("styled-bars"),

  • Add 'custom-electron-titlebar' to package.json+yarn.lock
    "custom-electron-titlebar": "^3.2.6",

    youtube-music/yarn.lock

    Lines 2632 to 2635 in 5218b80

    custom-electron-titlebar@^3.2.6:
    version "3.2.6"
    resolved "https://registry.yarnpkg.com/custom-electron-titlebar/-/custom-electron-titlebar-3.2.6.tgz#4cd064efa5020954c09732efa8c667a7ee3636e3"
    integrity sha512-P3ZGEr0eouUHqhdBBXllpuy2bFhfSmp+32HQBPcwzujjIsUhQxQj/nCpJiFa4SUGAEp1ifu/icuZdDKNNX72Tw==

I could add settings to change colors etc, if anyone's interested..

@Araxeus Araxeus marked this pull request as draft March 24, 2021 22:08
Araxeus and others added 3 commits March 25, 2021 01:00
* Added Discord timeout

* Add getOptions in plugin util

* Mutex in ffmpeg conversion (only supports one command at a time)

* Add menu customization in plugin system

* Add ytpl package (playlist info)

* Handle ffmpeg metadata flags when metadata is not present

* Only use artist in file name if present

* Export sendError method

* Handle image not present in metadata util

* Add downloader utils (getFolder and default menu label)

* Pass (optional) existing metadata and subfolder in mp3 converter

* Add listener to download playlist

* Add custom menu in downloader plugin ("download playlist" item)

* nit: fix main CSS style

* Only set the "enable" item in menu if plugin not enabled

* Navigation plugin: inject HTML once CSS is loaded

Co-authored-by: Sem Visscher <semvisscher10@gmail.com>
Co-authored-by: TC <th-ch@users.noreply.github.com>
@Araxeus Araxeus marked this pull request as ready for review March 25, 2021 00:31
@Araxeus Araxeus marked this pull request as draft March 25, 2021 04:47
@Araxeus Araxeus marked this pull request as ready for review March 25, 2021 05:54
Copy link
Owner

@th-ch th-ch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution, love the idea! 🤩

Left a few comments (main one is about re-using the existing menu to avoid duplicating code, otherwise it will make maintenance of the code harder - also, IMHO styled-bars feels a bit unclear as plugin name, I would have gone with something explicit like in-app-menu) - I am fine with merging it as it is and make the follow ups, or you can update the PR if you feel like it! It's up to you, in both cases this contribution is already awesome 👍

Note: it does not work for me on MacOS but it might be the same issue as AlexTorresDev/custom-electron-titlebar#145 (from the package)

plugins/styled-bars/back.js Outdated Show resolved Hide resolved
plugins/styled-bars/front.js Show resolved Hide resolved
plugins/styled-bars/back.js Outdated Show resolved Hide resolved
Araxeus added 2 commits March 25, 2021 23:13
instead it modifies the original menu
@Araxeus
Copy link
Collaborator Author

Araxeus commented Mar 25, 2021

You are welcome to change the name to whatever you like :)
It was styled-titlebar at the beginning , but then I added the scrollbar so I changed the name 😂

It was tested only on windows but from what i've seen - mac users can use their own special titlebar ;)

About the comments on the code

  • I changed the menu logic
    It nows only fixes the existing template instead of creating a new one.
    Seems to work great for now but i will test drive it more

Also is it ok if I integrate a folder chooser for the downloader plugin if you aren't planning on doing that?

(to plugins/downloader/menu.js)

@Araxeus
Copy link
Collaborator Author

Araxeus commented Mar 25, 2021

09d2feb added to the main menu a change that I originally had in my copied template :
Quit button + Restart button
I put them in the Navigation submenu

ea3d198 remove the new exit button, and also - the view menu from tray which didn't work and was redundant.
(could be fixed but no one even seemed to notice it didn't work lol)

this hasn't got much to do with the plugin, you can disregard those commits if you really want 😝

also delete useless nonfunctional view submenu
@Araxeus Araxeus requested a review from th-ch March 30, 2021 16:15
Copy link
Owner

@th-ch th-ch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for the contribution! ✅
Just a comment about generating the menu with options (instead of deleting parts of it later) to reduce the risk of breaking changes, but no blocker, I will tackle that in a follow up 👍
Will also rename the plugin to in-app-menu for clarity (but open to alternative names)

}

//custom menu doesn't support roles, so they get injected manually
function fixRoles(MenuItem) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: we could add options (like noRoles) to the mainMenuTemplate to reduce risks of breaking changes in the menu.

// delete quit button from navigation submenu
let navigation = getIndex(template,'Navigation');
let quit = getIndex(template[navigation].submenu,'Quit App');
delete template[navigation].submenu[quit];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same note: we could have options to return a "tray specific menu" in mainMenuTemplate

@th-ch th-ch merged commit 76f8868 into th-ch:master Mar 31, 2021
@Araxeus Araxeus deleted the styled-bars branch April 1, 2021 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants