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

feat(layout): extend layout functionality #576

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

NickTheWilder
Copy link

@NickTheWilder NickTheWilder commented Oct 14, 2024

Starts the first part of #535 to hide specific rectangles based on the user's configuration file.
Inspired from the review comments in #545

Opened as a draft bc I've limited out on knowledge of the application (and rust).

TODO:

  • Set the focused state to the first 'found' rectangle.
  • Update default configuration file.
  • Extend README.

Feel free to takeover and create a new branch or directly add commits here.

@NickTheWilder
Copy link
Author

NickTheWilder commented Oct 14, 2024

I see that the blob below sets the default focus state to the playlists, how can I import the config to this and set the initial focused state to the first 'found' percentage in the config?

impl LibraryPageUIState {
pub fn new() -> Self {
Self {
playlist_list: ListState::default(),
saved_album_list: ListState::default(),
followed_artist_list: ListState::default(),
focus: LibraryFocusState::Playlists,
playlist_folder_id: 0,
}
}
}

--

My thought was smth like

// ...
focus: match configs.app_config.layout.library {
    lib if lib.playlist_percent.is_some() => LibraryFocusState::Playlists,
    lib if lib.album_percent.is_some() => LibraryFocusState::SavedAlbums,
    lib if lib.artist_percent.is_some() => LibraryFocusState::FollowedArtists,
    _ => LibraryFocusState::Playlists,
},
// ...

@NickTheWilder NickTheWilder marked this pull request as draft October 14, 2024 14:42
@NickTheWilder NickTheWilder changed the title feat(layout): extend layout functionality #535 feat(layout): extend layout functionality Oct 14, 2024
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.

1 participant