mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-08-20 08:11:03 +02:00
refactor: split bar/top-level config structs
This allows for some options which are not actually bar-level to be separated, which makes some work moving forward a little easier and keeps things cleaner.
This commit is contained in:
parent
4aab6d5061
commit
706e040e25
5 changed files with 81 additions and 56 deletions
|
@ -1,4 +1,4 @@
|
|||
use super::{BarPosition, Config, MonitorConfig};
|
||||
use super::{BarConfig, BarPosition, MonitorConfig};
|
||||
use color_eyre::{Help, Report};
|
||||
use gtk::Orientation;
|
||||
use serde::{Deserialize, Deserializer};
|
||||
|
@ -13,11 +13,11 @@ impl<'de> Deserialize<'de> for MonitorConfig {
|
|||
let content =
|
||||
<serde::__private::de::Content as serde::Deserialize>::deserialize(deserializer)?;
|
||||
|
||||
match <Config as serde::Deserialize>::deserialize(
|
||||
match <BarConfig as serde::Deserialize>::deserialize(
|
||||
serde::__private::de::ContentRefDeserializer::<D::Error>::new(&content),
|
||||
) {
|
||||
Ok(config) => Ok(Self::Single(config)),
|
||||
Err(outer) => match <Vec<Config> as serde::Deserialize>::deserialize(
|
||||
Err(outer) => match <Vec<BarConfig> as serde::Deserialize>::deserialize(
|
||||
serde::__private::de::ContentRefDeserializer::<D::Error>::new(&content),
|
||||
) {
|
||||
Ok(config) => Ok(Self::Multiple(config)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue