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

Add module position configuration #80

Conversation

ReshetnikovPavel
Copy link

@ReshetnikovPavel ReshetnikovPavel commented Dec 30, 2024

Added a way to configure which modules should be on the left, center or right
image

@ReshetnikovPavel ReshetnikovPavel marked this pull request as draft December 30, 2024 22:19
@fiersik
Copy link
Contributor

fiersik commented Dec 31, 2024

That's a great idea! However, the screenshot you provided shows the main problem with this implementation.

image

image

(sorry for my bad English)

@fiersik
Copy link
Contributor

fiersik commented Dec 31, 2024

also, changing the position of the module will not change the position of the menu that is opened by the module, for example, Updates

@MalpenZibo
Copy link
Owner

MalpenZibo commented Jan 2, 2025

I thought about this kind of configuration recently.

I would like to have a configuration field like modules that's something like

enum ModuleName {
  Workspace,
  Title,
  Settings,
  etc ...
}

enum ModuleDef {
  Single(ModuleName),
  Group(Vec<ModuleName>)
}

struct Modules {
  left: Vec<ModuleDef>,
  center: Vec<ModuleDef>,
  right: Vec<ModuleDef>
}

...
modules: Modules,
...

A Single ModuleDef should have the HeaderButtonStyle::Full or the header_pills style (I should probably refactor these styles), and a Group ModuleDef should have:

  • the HeaderButtonStyle::Full or the header_pills if there's only one element in the vector
  • the HeaderButtonStyle::Left or the header_pills_left if it's the first element in the vector
  • the HeaderButtonStyle::Right or the header_pills_right if it's the last element in the vector
  • what I currently use for the privacy module otherwise (it could be called HeaderButtonStyle::None or header_pills_none I don't know yet)

Also with this new configuration, we could remove the enabled flag in each module config structure and a module is enabled only if it's present inside this new modules field.

Regarding the menu position, I'm currently working on a solution that decides the position of a menu based on the position of the relative button. This solution should be implemented to make the tray module work correctly, so I plan to use this new system for the other modules as well.

It's not a trivial change. So If you want, you could begin working, for example, on the configuration stuff then as soon as I can I could make the other changes to complete this feature

@MalpenZibo
Copy link
Owner

@ReshetnikovPavel thanks for the input! I moved the implementation in this PR #84

@MalpenZibo MalpenZibo closed this Jan 13, 2025
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