Просмотр исходного кода

Add window-size handling to draggable component. [CURA-6478]

Remco Burema 5 лет назад
Родитель
Сommit
9283c3d321
1 измененных файлов с 18 добавлено и 0 удалено
  1. 18 0
      resources/qml/ExpandableComponent.qml

+ 18 - 0
resources/qml/ExpandableComponent.qml

@@ -263,6 +263,24 @@ Item
                         contentContainer.trySetPosition(contentContainer.x + delta.x, contentContainer.y + delta.y);
                     }
                 }
+
+                Connections
+                {
+                    target: UM.Preferences
+                    onPreferenceChanged:
+                    {
+                        if
+                        (
+                            preference !== "general/window_height" &&
+                            preference !== "general/window_width" &&
+                            preference !== "general/window_state"
+                        )
+                        {
+                            return;
+                        }
+                        contentContainer.trySetPosition(contentContainer.x, contentContainer.y);
+                    }
+                }
             }
         }