pub fn load(name: &str, search_paths: Vec<PathBuf>) -> Self {
        let mut dirs = Vec::new();
        let mut inherits = String::from("default");

        // Find dirs
        for mut path in search_paths.clone() {
            path.push(name);
            if path.is_dir() {
                dirs.push(path.clone());
            }
        }

        // Find inheritance
        for mut path in dirs.clone() {
            path.push("index.theme");

            if let Some(i) = theme_inherits(&path) {
                inherits = i;
            }
        }

        CursorTheme {
            name: String::from(name),
            dirs,
            inherits,
            search_paths,
        }
    }
/// This function searches for a theme with the given name
/// in the given search paths, and returns an XCursorTheme which
/// represents it.
/// If no inheritance can be determined, then the themes inherits
/// from the "default" theme.
This function searches for a theme with the given name
in the given search paths, and returns an XCursorTheme which
represents it.
If no inheritance can be determined, then the themes inherits
from the "default" theme.
This function searches for a theme with the given name in the given search paths and returns an XCursorTheme which represents it . If no inheritance can be determined then the themes inherits from the " default " theme .
pub fn load(name: &str, search_paths: Vec<PathBuf>) -> Self {
        let mut dirs = Vec::new();
        let mut inherits = String::from("default");
        // Find dirs
        for mut path in search_paths.clone() {
            path.push(name);
            if path.is_dir() {
                dirs.push(path.clone());
            }
        }
        // Find inheritance
        for mut path in dirs.clone() {
            path.push("index.theme");
            if let Some(i) = theme_inherits(&path) {
                inherits = i;
            }
        }
        CursorTheme {
            name: String::from(name),
            dirs,
            inherits,
            search_paths,
        }
    }
pub fn load ( name : & str , search_paths : Vec < PathBuf > ) -> Self { let mut dirs = Vec :: new ( ) ; let mut inherits = String :: from ( " " ) ; // Find dirs for mut path in search_paths . clone ( ) { path . push ( name ) ; if path . is_dir ( ) { dirs . push ( path . clone ( ) ) ; } } // Find inheritance for mut path in dirs . clone ( ) { path . push ( " " ) ; if let Some ( i ) = theme_inherits ( & path ) { inherits = i ; } } CursorTheme { name : String :: from ( name ) , dirs , inherits , search_paths , } }
This function searches for a theme with the given name
in the given search paths, and returns an XCursorTheme which
represents it.
This function searches for a theme with the given name in the given search paths and returns an XCursorTheme which represents it .
name
&str
search_paths
Vec<PathBuf>
name
&str
search_paths
Vec<PathBuf>