Add favorite limit settings

This commit is contained in:
2026-05-08 03:31:41 -04:00
parent e2d8b0cc6e
commit 569851eae9
7 changed files with 233 additions and 14 deletions
+38
View File
@@ -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.",
}
}
}
+2
View File
@@ -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,