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:
Tom A. Wagner 2023-12-09 16:01:11 +01:00
parent e78d6f5fb4
commit 4549ba6ff5
2 changed files with 6 additions and 0 deletions

View file

@ -85,6 +85,9 @@ mod imp {
fn constructed(&self) {
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.
self.node_name
.set_cursor(gtk::gdk::Cursor::from_name("grab", None).as_ref());

View file

@ -101,6 +101,9 @@ mod imp {
fn constructed(&self) {
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.
self.obj()
.set_cursor(gtk::gdk::Cursor::from_name("grab", None).as_ref());