docs: small overall documentation improvements (#1381)
* docs: small overall documentation improvements - Add documentation comments to various items - Change web API return types from bool/Option to Result - Create helper functions with descriptive names instead of comments - Remove redundant/confusing types - Fix some documentation comments as instructed by `cargo doc` - Rename variables to clear names * docs: small fixes to the documentation update
This commit is contained in:
12
src/theme.rs
12
src/theme.rs
@@ -6,6 +6,17 @@ use log::warn;
|
||||
|
||||
use crate::config::ConfigTheme;
|
||||
|
||||
/// Get the given color from the given [ConfigTheme]. The first argument is the [ConfigTheme] to get
|
||||
/// the color out of. The second argument is the name of the color to get and is an identifier. The
|
||||
/// third argument is a [Color] that is used as the default when no color can be parsed from the
|
||||
/// provided [ConfigTheme].
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// load_color!(config_theme, background, TerminalDefault)
|
||||
/// load_color!(config_theme, primary, TerminalDefault)
|
||||
/// ```
|
||||
macro_rules! load_color {
|
||||
( $theme: expr, $member: ident, $default: expr ) => {
|
||||
$theme
|
||||
@@ -22,6 +33,7 @@ macro_rules! load_color {
|
||||
};
|
||||
}
|
||||
|
||||
/// Create a [cursive::theme::Theme] from `theme_cfg`.
|
||||
pub fn load(theme_cfg: &Option<ConfigTheme>) -> Theme {
|
||||
let mut palette = Palette::default();
|
||||
let borders = BorderStyle::Simple;
|
||||
|
||||
Reference in New Issue
Block a user