refactor(bar): use Gtk enums for position and orientation

Ensure that the position and the corresponding CSS class on window are
always set.
This commit is contained in:
Aleksei Bavshin
2024-02-14 19:14:39 -08:00
parent 28cd9dff47
commit 2f555a6936
10 changed files with 114 additions and 72 deletions

View File

@ -62,7 +62,7 @@ class BarSurface {
virtual void setLayer(bar_layer layer) = 0;
virtual void setMargins(const struct bar_margins &margins) = 0;
virtual void setPassThrough(bool enable) = 0;
virtual void setPosition(const std::string_view &position) = 0;
virtual void setPosition(Gtk::PositionType position) = 0;
virtual void setSize(uint32_t width, uint32_t height) = 0;
virtual void commit(){};
@ -89,8 +89,9 @@ class Bar {
Json::Value config;
struct wl_surface *surface;
bool visible = true;
bool vertical = false;
Gtk::Window window;
Gtk::Orientation orientation = Gtk::ORIENTATION_HORIZONTAL;
Gtk::PositionType position = Gtk::POS_TOP;
int x_global;
int y_global;