Add favorite limit settings
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
|
||||
pub enum FavoriteLimit {
|
||||
Six,
|
||||
#[default]
|
||||
Twelve,
|
||||
TwentyFour,
|
||||
}
|
||||
|
||||
impl FavoriteLimit {
|
||||
pub const ALL: &[Self] = &[Self::Six, Self::Twelve, Self::TwentyFour];
|
||||
|
||||
#[must_use]
|
||||
pub fn value(self) -> usize {
|
||||
match self {
|
||||
Self::Six => 6,
|
||||
Self::Twelve => 12,
|
||||
Self::TwentyFour => 24,
|
||||
}
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn label(self) -> &'static str {
|
||||
match self {
|
||||
Self::Six => "6 Favorites",
|
||||
Self::Twelve => "12 Favorites",
|
||||
Self::TwentyFour => "24 Favorites",
|
||||
}
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn detail(self) -> &'static str {
|
||||
match self {
|
||||
Self::Six => "Keep the Favorites shelf compact.",
|
||||
Self::Twelve => "Default Favorites shelf capacity.",
|
||||
Self::TwentyFour => "Allow a larger cross-space Favorites shelf.",
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ mod bookmark;
|
||||
mod command;
|
||||
mod download;
|
||||
mod error;
|
||||
mod favorite;
|
||||
mod history;
|
||||
mod identifiers;
|
||||
mod new_tab;
|
||||
@@ -26,6 +27,7 @@ pub use download::{
|
||||
DownloadPolicy, DownloadSecurity, DownloadState,
|
||||
};
|
||||
pub use error::DomainError;
|
||||
pub use favorite::FavoriteLimit;
|
||||
pub use history::HistoryEntry;
|
||||
pub use identifiers::{
|
||||
BookmarkId, DownloadId, ProfileId, ReadingListId, SpaceId, SplitId, TabId, WebViewId,
|
||||
|
||||
Reference in New Issue
Block a user