columns: switch to bitflag app options

we're adding a ScrollToTop bool for an updating change
to the toolbar, but we have too many flags now. Let's switch
to bitflags

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2025-07-15 12:42:20 -07:00
parent cd560cb7bf
commit 119456e2b3
4 changed files with 57 additions and 25 deletions

View File

@@ -0,0 +1,26 @@
use bitflags::bitflags;
bitflags! {
// Attributes can be applied to flags types
#[repr(transparent)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct AppOptions: u64 {
/// Explicitly enable/disable column persistence for the sessions
const TmpColumns = 1 << 0;
/// Debug mode for debug ui controls
const Debug = 1 << 1;
/// Should we explicitly disable since optimization?
const SinceOptimize = 1 << 2;
/// Should we scroll to top on the active column?
const ScrollToTop = 1 << 3;
}
}
impl Default for AppOptions {
fn default() -> AppOptions {
AppOptions::SinceOptimize
}
}