mirror of
https://github.com/alacritty/alacritty.git
synced 2025-02-10 15:46:10 -05:00
Move dimensions and padding into window section
This commit is contained in:
parent
dbc6970aaa
commit
7928b33ee0
1 changed files with 16 additions and 13 deletions
|
@ -209,8 +209,19 @@ impl Default for Alpha {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Deserialize)]
|
#[derive(Debug, Copy, Clone, Deserialize)]
|
||||||
pub struct WindowConfig {
|
pub struct WindowConfig {
|
||||||
|
|
||||||
|
/// Initial dimensions
|
||||||
|
#[serde(default)]
|
||||||
|
dimensions: Dimensions,
|
||||||
|
|
||||||
|
/// Pixel padding
|
||||||
|
#[serde(default="default_padding")]
|
||||||
|
padding: Delta,
|
||||||
|
|
||||||
|
/// Draw the window with title bar / borders
|
||||||
|
#[serde(default)]
|
||||||
decorations: bool,
|
decorations: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -223,6 +234,8 @@ impl WindowConfig {
|
||||||
impl Default for WindowConfig {
|
impl Default for WindowConfig {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
WindowConfig{
|
WindowConfig{
|
||||||
|
dimensions: Default::default(),
|
||||||
|
padding: default_padding(),
|
||||||
decorations: true,
|
decorations: true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -235,14 +248,6 @@ pub struct Config {
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
env: HashMap<String, String>,
|
env: HashMap<String, String>,
|
||||||
|
|
||||||
/// Initial dimensions
|
|
||||||
#[serde(default)]
|
|
||||||
dimensions: Dimensions,
|
|
||||||
|
|
||||||
/// Pixel padding
|
|
||||||
#[serde(default="default_padding")]
|
|
||||||
padding: Delta,
|
|
||||||
|
|
||||||
/// Font configuration
|
/// Font configuration
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
font: Font,
|
font: Font,
|
||||||
|
@ -342,7 +347,6 @@ impl Default for Config {
|
||||||
fn default() -> Config {
|
fn default() -> Config {
|
||||||
Config {
|
Config {
|
||||||
draw_bold_text_with_bright_colors: true,
|
draw_bold_text_with_bright_colors: true,
|
||||||
dimensions: Default::default(),
|
|
||||||
font: Default::default(),
|
font: Default::default(),
|
||||||
render_timer: Default::default(),
|
render_timer: Default::default(),
|
||||||
custom_cursor_colors: false,
|
custom_cursor_colors: false,
|
||||||
|
@ -359,7 +363,6 @@ impl Default for Config {
|
||||||
hide_cursor_when_typing: Default::default(),
|
hide_cursor_when_typing: Default::default(),
|
||||||
cursor_style: Default::default(),
|
cursor_style: Default::default(),
|
||||||
live_config_reload: true,
|
live_config_reload: true,
|
||||||
padding: default_padding(),
|
|
||||||
window: Default::default(),
|
window: Default::default(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1146,7 +1149,7 @@ impl Config {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn padding(&self) -> &Delta {
|
pub fn padding(&self) -> &Delta {
|
||||||
&self.padding
|
&self.window.padding
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -1163,7 +1166,7 @@ impl Config {
|
||||||
/// Get window dimensions
|
/// Get window dimensions
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn dimensions(&self) -> Dimensions {
|
pub fn dimensions(&self) -> Dimensions {
|
||||||
self.dimensions
|
self.window.dimensions
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get window config
|
/// Get window config
|
||||||
|
|
Loading…
Add table
Reference in a new issue