moved warnings near config options

This commit is contained in:
Ashwin 2022-10-18 08:49:24 +11:00 committed by Patrick Ziegler
parent cbf5439e80
commit 1e582accb8
1 changed files with 9 additions and 6 deletions

View File

@ -225,6 +225,15 @@ bar::bar(connection& conn, signal_emitter& emitter, const config& config, const
}
// Load values used to adjust the struts atom
if (!m_opts.struts) {
if (m_conf.has("global/wm", "margin-bottom")) {
m_log.warn("Struts are disabled, ignoring margin-bottom");
}
if (m_conf.has("global/wm", "margin-top")) {
m_log.warn("Struts are disabled, ignoring margin-top");
}
}
auto margin_top = m_conf.get("global/wm", "margin-top", percentage_with_offset{});
auto margin_bottom = m_conf.get("global/wm", "margin-bottom", percentage_with_offset{});
m_opts.strut.top = units_utils::percentage_with_offset_to_pixel(margin_top, m_opts.monitor->h, m_opts.dpi_y);
@ -549,12 +558,6 @@ void bar::reconfigure_pos() {
*/
void bar::reconfigure_struts() {
if (!m_opts.struts) {
if (m_conf.has("global/wm", "margin-bottom")) {
m_log.warn("Struts are disabled, ignoring margin-bottom");
}
if (m_conf.has("global/wm", "margin-top")) {
m_log.warn("Struts are disabled, ignoring margin-top");
}
return;
}