aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Günzler <r@gnzler.io>2017-12-20 20:28:21 +0100
committerRobert Günzler <r@gnzler.io>2017-12-20 20:28:21 +0100
commit7928b33ee086a35ea01e874940b1f193244c6f65 (patch)
treea15e8b4dcc7e546098e1ecce42d2df2eb2b5256b
parentdbc6970aaa453dee9bcc4958036878529977af7f (diff)
downloadalacritty-7928b33ee086a35ea01e874940b1f193244c6f65.tar.gz
alacritty-7928b33ee086a35ea01e874940b1f193244c6f65.zip
Move dimensions and padding into window section
-rw-r--r--src/config.rs29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/config.rs b/src/config.rs
index 69f32179..96d3ee49 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -209,8 +209,19 @@ impl Default for Alpha {
}
}
-#[derive(Debug, Deserialize)]
+#[derive(Debug, Copy, Clone, Deserialize)]
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,
}
@@ -223,6 +234,8 @@ impl WindowConfig {
impl Default for WindowConfig {
fn default() -> Self {
WindowConfig{
+ dimensions: Default::default(),
+ padding: default_padding(),
decorations: true,
}
}
@@ -235,14 +248,6 @@ pub struct Config {
#[serde(default)]
env: HashMap<String, String>,
- /// Initial dimensions
- #[serde(default)]
- dimensions: Dimensions,
-
- /// Pixel padding
- #[serde(default="default_padding")]
- padding: Delta,
-
/// Font configuration
#[serde(default)]
font: Font,
@@ -342,7 +347,6 @@ impl Default for Config {
fn default() -> Config {
Config {
draw_bold_text_with_bright_colors: true,
- dimensions: Default::default(),
font: Default::default(),
render_timer: Default::default(),
custom_cursor_colors: false,
@@ -359,7 +363,6 @@ impl Default for Config {
hide_cursor_when_typing: Default::default(),
cursor_style: Default::default(),
live_config_reload: true,
- padding: default_padding(),
window: Default::default(),
}
}
@@ -1146,7 +1149,7 @@ impl Config {
}
pub fn padding(&self) -> &Delta {
- &self.padding
+ &self.window.padding
}
#[inline]
@@ -1163,7 +1166,7 @@ impl Config {
/// Get window dimensions
#[inline]
pub fn dimensions(&self) -> Dimensions {
- self.dimensions
+ self.window.dimensions
}
/// Get window config