fix: check vertical after parsing multiple outputs

This commit is contained in:
Alex 2019-03-25 21:02:00 +01:00
parent 5144426f0e
commit dda0cc793e
2 changed files with 6 additions and 6 deletions

View File

@ -98,6 +98,7 @@
"custom/spotify": {
"format": " {}",
"max-length": 40,
"escape": true,
"exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
}
}

View File

@ -28,12 +28,6 @@ waybar::Bar::Bar(const Client& client,
setupConfig();
setupCss();
if (config_["position"] == "right" || config_["position"] == "left") {
vertical = true;
height_ = 0;
width_ = 30;
}
auto wrap = reinterpret_cast<GtkWidget*>(window.gobj());
gtk_widget_realize(wrap);
GdkWindow *gdk_window = gtk_widget_get_window(wrap);
@ -101,6 +95,11 @@ void waybar::Bar::initBar()
};
zwlr_layer_surface_v1_add_listener(layer_surface, &layer_surface_listener, this);
if (config_["position"] == "right" || config_["position"] == "left") {
height_ = 0;
width_ = 30;
}
auto height = config_["height"].isUInt() ? config_["height"].asUInt() : height_;
auto width = config_["width"].isUInt() ? config_["width"].asUInt() : width_;