diff options
| author | MaxVerevkin <maxxverrr@gmail.com> | 2022-08-09 22:19:56 +0300 |
|---|---|---|
| committer | MaxVerevkin <maxxverrr@gmail.com> | 2022-08-09 22:19:56 +0300 |
| commit | 2d77969c7719e72237ec365c3db9e35c3e178631 (patch) | |
| tree | 7f0e398768e31dcca0b2ec6f09548065f7764e69 /src/tags.rs | |
| parent | 2a3c0d9ceac54c9f6d9312c610d2a161a4bb37c9 (diff) | |
| download | i3bar-mango-2d77969c7719e72237ec365c3db9e35c3e178631.tar.gz | |
refactoring
Diffstat (limited to 'src/tags.rs')
| -rw-r--r-- | src/tags.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/tags.rs b/src/tags.rs index 8114a74..0c63570 100644 --- a/src/tags.rs +++ b/src/tags.rs @@ -1,4 +1,4 @@ -use crate::text::{Attributes, ComputedText, Text}; +use crate::text::{Attributes, ComputedText}; use cairo::Context; use pango::FontDescription; use pangocairo::{cairo, pango}; @@ -28,9 +28,10 @@ impl TagsInfo { } } -pub fn compute_tag_label(label: String, font: FontDescription, context: &Context) -> ComputedText { - let text = Text { - attr: Attributes { +pub fn compute_tag_label(label: &str, font: FontDescription, context: &Context) -> ComputedText { + ComputedText::new( + label, + Attributes { font, padding_left: 25.0, padding_right: 25.0, @@ -38,7 +39,6 @@ pub fn compute_tag_label(label: String, font: FontDescription, context: &Context align: Default::default(), markup: false, }, - text: label, - }; - text.compute(context) + context, + ) } |
