From 67f1ceaacacff7b886efd3bf5b21d36f7a8f36be Mon Sep 17 00:00:00 2001
From: patrick96
Date: Sun, 13 Jan 2019 22:10:34 +0100
Subject: [PATCH] feat: format-font
Resolves #19
---
include/modules/meta/base.hpp | 1 +
src/modules/meta/base.cpp | 7 +++++++
src/modules/mpd.cpp | 1 +
3 files changed, 9 insertions(+)
diff --git a/include/modules/meta/base.hpp b/include/modules/meta/base.hpp
index 2659ce11..3d2f5b71 100644
--- a/include/modules/meta/base.hpp
+++ b/include/modules/meta/base.hpp
@@ -74,6 +74,7 @@ namespace modules {
size_t padding{0};
size_t margin{0};
int offset{0};
+ int font{0};
string decorate(builder* builder, string output);
};
diff --git a/src/modules/meta/base.cpp b/src/modules/meta/base.cpp
index b8d5d9fe..4155dbc1 100644
--- a/src/modules/meta/base.cpp
+++ b/src/modules/meta/base.cpp
@@ -32,6 +32,9 @@ namespace modules {
if (!ol.empty()) {
builder->overline(ol);
}
+ if(font > 0) {
+ builder->font(font);
+ }
if (padding > 0) {
builder->space(padding);
}
@@ -57,6 +60,9 @@ namespace modules {
if (padding > 0) {
builder->space(padding);
}
+ if(font > 0) {
+ builder->font_close();
+ }
if (!ol.empty()) {
builder->overline_close();
}
@@ -95,6 +101,7 @@ namespace modules {
format->padding = m_conf.get(m_modname, name + "-padding", formatdef("padding", format->padding));
format->margin = m_conf.get(m_modname, name + "-margin", formatdef("margin", format->margin));
format->offset = m_conf.get(m_modname, name + "-offset", formatdef("offset", format->offset));
+ format->font = m_conf.get(m_modname, name + "-font", formatdef("font", format->font));
format->tags.swap(tags);
try {
diff --git a/src/modules/mpd.cpp b/src/modules/mpd.cpp
index 1eb529a6..74feaac8 100644
--- a/src/modules/mpd.cpp
+++ b/src/modules/mpd.cpp
@@ -39,6 +39,7 @@ namespace modules {
mod_format->padding = m_conf.get(name(), FORMAT_ONLINE + "-padding"s, mod_format->padding);
mod_format->margin = m_conf.get(name(), FORMAT_ONLINE + "-margin"s, mod_format->margin);
mod_format->offset = m_conf.get(name(), FORMAT_ONLINE + "-offset"s, mod_format->offset);
+ mod_format->font = m_conf.get(name(), FORMAT_ONLINE + "-font"s, mod_format->font);
try {
mod_format->prefix = load_label(m_conf, name(), FORMAT_ONLINE + "-prefix"s);