Skip to content

Commit

Permalink
add fill types
Browse files Browse the repository at this point in the history
  • Loading branch information
ayrat555 committed May 16, 2024
1 parent fb5f8dd commit 2c1c99a
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,23 @@ pub enum MenuButton {
Default,
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum ChatBackground {
Fill(BackgroundTypeFill),
Wallpaper(BackgroundTypeWallpaper),
Patter(BackgroundTypePattern),
ChatTheme(BackgroundTypeChatTheme),
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum BackgroundFill {
Solid(BackgroundFillSolid),
Gradient(BackgroundFillGradient),
FreeformGradient(BackgroundFillFreeformGradient),
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)]
pub struct MenuButtonWebApp {
#[builder(setter(into))]
Expand Down Expand Up @@ -1533,6 +1550,25 @@ pub struct ChatBoostAdded {
pub boost_count: u32,
}

#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Builder)]
pub struct BackgroundFillSolid {
pub color: u32,
}

#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Builder)]
pub struct BackgroundFillGradient {
pub top_color: u32,

pub bottom_color: u32,

pub rotation_angle: u16,
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)]
pub struct BackgroundFillFreeformGradient {
pub colors: Vec<u32>,
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)]
pub struct ForumTopicCreated {
#[builder(setter(into))]
Expand Down

0 comments on commit 2c1c99a

Please sign in to comment.