Waybar
Waybar copied to clipboard
making a drawer open on the right
Hello, I am trying to construct a drawer that shows pulseaudio, and then shows mpris on hover like so:
"modules-left": ["group/audio"],
"modules-center": ["hyprland/workspaces"],
"modules-right": ["network", "battery", "clock", "tray"],
"group/audio": {
"orientation": "inherit",
"drawer": {
"transition-duration": 500,
"children-class": "not-power",
"transition-left-to-right": true,
},
"modules": ["pulseaudio", "mpris"]
},
//configs for mpris and pulseaudio
I have 1 minor and a major problem.
-
since the module is on the left, the drawer needs to slide out on the left, but it comes out on the left and I can't find a fix.
-
my modules are round, so pulseaudio needs to have different css when the drawer is extended vs non-extended.
accident sry
I can recreate your problem. transition-left-to-right
doesn't seem to change anything.
When looking at the Object Hierarchy with this, Revealer
comes before EventBox
(the leaderObject):
Since changing the transition_type
of revealer
doesn't change anything, I tried moving Revealer
after the leaderObject
:
diff --git a/src/group.cpp b/src/group.cpp
index cad36e51..997ab628 100644
--- a/src/group.cpp
+++ b/src/group.cpp
@@ -73,7 +73,7 @@ Group::Group(const std::string& name, const std::string& id, const Json::Value&
revealer.get_style_context()->add_class("drawer");
revealer.add(revealer_box);
- box.pack_start(revealer);
+ box.pack_end(revealer);
addHoverHandlerTo(revealer);
}
It worked:
Hidden Modules now appear on the right side.
@Alexays did I miss something on how revealer
works?
I'll add an If statement to check which function to use based on transition-left-to-right
and make a PR.
I might even be able to remove to whole preferedTransitionType
thing.