Struct tdesktop_theme::Wallpaper
source · pub struct Wallpaper {
pub wallpaper_type: WallpaperType,
pub extension: WallpaperExtension,
pub bytes: Vec<u8>,
}
Expand description
Represents a theme’s wallpaper.
Fields§
§wallpaper_type: WallpaperType
Represents the type of the wallpaper, e.g. background.*
or tiled.*
.
extension: WallpaperExtension
Represents the extension of the wallpaper, e.g. *.png
or *.jpg
.
bytes: Vec<u8>
Holds the wallpaper’s original bytes.
Implementations§
source§impl Wallpaper
impl Wallpaper
sourcepub fn get_filename(&self) -> String
pub fn get_filename(&self) -> String
Generates the name of the wallpaper when the theme is zipped.
Possible return values
wallpaper.wallpaper_type | wallpaper.extension | Return value |
---|---|---|
Tiled | Png | "tiled.png" |
Tiled | Jpg | "tiled.jpg" |
Background | Png | "background.png" |
Background | Jpg | "background.jpg" |
Examples
use tdesktop_theme::*;
let wallpaper = Wallpaper {
wallpaper_type: WallpaperType::Background,
extension: WallpaperExtension::Jpg,
bytes: Vec::new(),
};
assert_eq!(wallpaper.get_filename(), "background.jpg");