Skip to content

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
@NickTheWilder NickTheWilder force-pushed the feat-extend-layout-config branch from dbc6e92 to 4aa9d65 Compare October 18, 2024 04:17
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