mirror of
https://gitlab.freedesktop.org/pipewire/helvum
synced 2026-03-15 03:26:10 +08:00
ui: Force LTR direction on the nodes port grid and on ports
Forces the direction on the nodes internal port grid and on the ports themselves to be always left-to-right (LTR), to avoid the UI becoming messed up when defaulting to right-to-left (RTL). Previously, when using RTL, the side of input and output ports would be swapped, causing the port handles to be inside the node instead of at the edge.
This commit is contained in:
@@ -85,6 +85,9 @@ mod imp {
|
|||||||
fn constructed(&self) {
|
fn constructed(&self) {
|
||||||
self.parent_constructed();
|
self.parent_constructed();
|
||||||
|
|
||||||
|
// Force left-to-right direction for the ports grid to avoid messed up UI when defaulting to right-to-left
|
||||||
|
self.port_grid.set_direction(gtk::TextDirection::Ltr);
|
||||||
|
|
||||||
// Display a grab cursor when the mouse is over the label so the user knows the node can be dragged.
|
// Display a grab cursor when the mouse is over the label so the user knows the node can be dragged.
|
||||||
self.node_name
|
self.node_name
|
||||||
.set_cursor(gtk::gdk::Cursor::from_name("grab", None).as_ref());
|
.set_cursor(gtk::gdk::Cursor::from_name("grab", None).as_ref());
|
||||||
|
|||||||
@@ -101,6 +101,9 @@ mod imp {
|
|||||||
fn constructed(&self) {
|
fn constructed(&self) {
|
||||||
self.parent_constructed();
|
self.parent_constructed();
|
||||||
|
|
||||||
|
// Force left-to-right direction for the ports grid to avoid messed up UI when defaulting to right-to-left
|
||||||
|
self.obj().set_direction(gtk::TextDirection::Ltr);
|
||||||
|
|
||||||
// Display a grab cursor when the mouse is over the port so the user knows it can be dragged to another port.
|
// Display a grab cursor when the mouse is over the port so the user knows it can be dragged to another port.
|
||||||
self.obj()
|
self.obj()
|
||||||
.set_cursor(gtk::gdk::Cursor::from_name("grab", None).as_ref());
|
.set_cursor(gtk::gdk::Cursor::from_name("grab", None).as_ref());
|
||||||
|
|||||||
Reference in New Issue
Block a user