fix: don't a warning for a width/height of 0

This commit is contained in:
Alex 2020-07-12 11:57:47 +02:00 committed by GitHub
parent 27f89bdcc3
commit e3fdd6d94a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -121,7 +121,7 @@ void waybar::Bar::onConfigure(GdkEventConfigure* ev) {
auto tmp_width = width_; auto tmp_width = width_;
if (ev->height > static_cast<int>(height_)) { if (ev->height > static_cast<int>(height_)) {
// Default minimal value // Default minimal value
if (height_ != 1) { if (height_ > 1) {
spdlog::warn(MIN_HEIGHT_MSG, height_, ev->height); spdlog::warn(MIN_HEIGHT_MSG, height_, ev->height);
} }
if (config["height"].isUInt()) { if (config["height"].isUInt()) {
@ -132,7 +132,7 @@ void waybar::Bar::onConfigure(GdkEventConfigure* ev) {
} }
if (ev->width > static_cast<int>(width_)) { if (ev->width > static_cast<int>(width_)) {
// Default minimal value // Default minimal value
if (width_ != 1) { if (width_ > 1) {
spdlog::warn(MIN_WIDTH_MSG, width_, ev->width); spdlog::warn(MIN_WIDTH_MSG, width_, ev->width);
} }
if (config["width"].isUInt()) { if (config["width"].isUInt()) {