1
0
Fork 0
forked from wry/wry

config: move parser option structs into schema crate

This commit is contained in:
kossLAN 2026-05-29 17:01:28 -04:00
parent b550bb1025
commit 41e7fcc290
No known key found for this signature in database
6 changed files with 25 additions and 21 deletions

View file

@ -8,4 +8,7 @@ pub mod animations;
pub mod options;
pub use animations::{AnimationCurveConfig, Animations};
pub use options::{Libei, RepeatRate, SimpleIm, Tearing, UiDrag, Vrr, Xwayland};
pub use options::{
ColorManagement, Float, FocusHistory, Libei, RepeatRate, SimpleIm, Tearing, UiDrag, Vrr,
Xwayland,
};

View file

@ -9,6 +9,22 @@ pub struct UiDrag {
pub threshold: Option<i32>,
}
#[derive(Clone, Debug)]
pub struct ColorManagement {
pub enabled: Option<bool>,
}
#[derive(Debug, Clone)]
pub struct Float {
pub show_pin_icon: Option<bool>,
}
#[derive(Debug, Clone)]
pub struct FocusHistory {
pub only_visible: Option<bool>,
pub same_workspace: Option<bool>,
}
#[derive(Debug, Clone)]
pub struct RepeatRate {
pub rate: i32,

View file

@ -13,10 +13,7 @@ use {
config::{
context::Context,
parsers::{
color_management::ColorManagement,
config::{ConfigParser, ConfigParserError},
float::Float,
focus_history::FocusHistory,
},
},
toml::{self},
@ -48,7 +45,8 @@ use {
};
pub use jay_config_schema::{
AnimationCurveConfig, Animations, Libei, RepeatRate, SimpleIm, Tearing, UiDrag, Vrr, Xwayland,
AnimationCurveConfig, Animations, ColorManagement, Float, FocusHistory, Libei, RepeatRate,
SimpleIm, Tearing, UiDrag, Vrr, Xwayland,
};
#[derive(Debug, Copy, Clone)]

View file

@ -1,6 +1,7 @@
use {
crate::{
config::{
ColorManagement,
context::Context,
extractor::{Extractor, ExtractorError, bol, opt},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
@ -24,11 +25,6 @@ pub enum ColorManagementParserError {
pub struct ColorManagementParser<'a>(pub &'a Context<'a>);
#[derive(Clone, Debug)]
pub struct ColorManagement {
pub enabled: Option<bool>,
}
impl Parser for ColorManagementParser<'_> {
type Value = ColorManagement;
type Error = ColorManagementParserError;

View file

@ -1,6 +1,7 @@
use {
crate::{
config::{
Float,
context::Context,
extractor::{Extractor, ExtractorError, bol, opt, recover},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
@ -24,11 +25,6 @@ pub enum FloatParserError {
pub struct FloatParser<'a>(pub &'a Context<'a>);
#[derive(Debug, Clone)]
pub struct Float {
pub show_pin_icon: Option<bool>,
}
impl Parser for FloatParser<'_> {
type Value = Float;
type Error = FloatParserError;

View file

@ -1,6 +1,7 @@
use {
crate::{
config::{
FocusHistory,
context::Context,
extractor::{Extractor, ExtractorError, bol, opt, recover},
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
@ -24,12 +25,6 @@ pub enum FocusHistoryParserError {
pub struct FocusHistoryParser<'a>(pub &'a Context<'a>);
#[derive(Debug, Clone)]
pub struct FocusHistory {
pub only_visible: Option<bool>,
pub same_workspace: Option<bool>,
}
impl Parser for FocusHistoryParser<'_> {
type Value = FocusHistory;
type Error = FocusHistoryParserError;