Cura icon indicating copy to clipboard operation
Cura copied to clipboard

4.20.13

Open 5axes opened this issue 1 year ago • 14 comments

I need to make a choice : use the @fieldOfView SideBar GUI Plugin or use the new function to display details of the current line in the layer view.

Without the Plugin installed image

With the Plugin SideBar GUI V4.6.1 image

5axes avatar Jun 06 '23 16:06 5axes

Hi @5axes , I know nothing about that plugin, perhaps @fieldofview can suggest a fix? Aldo, I anchor the (i) button to pathSlider.right.

smartavionics avatar Jun 06 '23 16:06 smartavionics

Just been thinking, a workaround could be to edit SimulationViewMainComponent.qml which will be installed somewhere in the Cura 4.20.13 tree and change line 156 from:

            left: pathSlider.right

to

            right: playButton.left

smartavionics avatar Jun 06 '23 20:06 smartavionics

And the vertical "layer" slider gets hidden by the SideBar GUI. That is no big thing as collapsing the Sidebar reveals the slider. The problem 5axes brought up is a pain. image image

GregValiant avatar Jun 06 '23 20:06 GregValiant

Just been thinking, a workaround could be to edit SimulationViewMainComponent.qml which will be installed somewhere in the Cura 4.20.13 tree and change line 156 from:

            left: pathSlider.right

to

            right: playButton.left

That moves the (i) to the left of the slider...

Screenshot_2023-06-06_22-50-29

smartavionics avatar Jun 06 '23 21:06 smartavionics

Not a workaround Whitout the plugin :

image

With the plugin

image

5axes avatar Jun 07 '23 08:06 5axes

Oh, I think we need help from @fieldOfView at this point because my knowledge of qml is like < 0.

smartavionics avatar Jun 07 '23 09:06 smartavionics

TBH, ensuring Sidebar GUI keeps working with Ultimaker Cura releases is more than enough work for me. I'm not sure if I will be able to put time into this any time soon.

fieldOfView avatar Jun 07 '23 18:06 fieldOfView

Hi @5axes , please try this instead, compared to the original file. As shown in the below diff, the line that starts "left:" is deleted and before the anchors section, a line that starts x: is added.

diff --git a/plugins/SimulationView/SimulationViewMainComponent.qml b/plugins/SimulationView/SimulationViewMainComponent.qml
index 72382597a5..2f9aad231c 100644
--- a/plugins/SimulationView/SimulationViewMainComponent.qml
+++ b/plugins/SimulationView/SimulationViewMainComponent.qml
@@ -150,10 +150,10 @@ Item
         color: UM.Theme.getColor("slider_handle")
         iconMargin: UM.Theme.getSize("thick_lining").width
         visible: !UM.SimulationView.compatibilityMode
+        x: playButton.x - playButton.width
 
         anchors
         {
-            left: pathSlider.right
             verticalCenter: pathSlider.verticalCenter
         }
 

smartavionics avatar Jun 09 '23 14:06 smartavionics

What I showed above works for me but isn't quite right. This version gives the same end result and is more correct:

diff --git a/plugins/SimulationView/SimulationViewMainComponent.qml b/plugins/SimulationView/SimulationViewMainComponent.qml
index 72382597a5..273b0007bf 100644
--- a/plugins/SimulationView/SimulationViewMainComponent.qml
+++ b/plugins/SimulationView/SimulationViewMainComponent.qml
@@ -150,10 +150,10 @@ Item
         color: UM.Theme.getColor("slider_handle")
         iconMargin: UM.Theme.getSize("thick_lining").width
         visible: !UM.SimulationView.compatibilityMode
+        x: playButton.x - UM.Theme.getSize("small_button").width
 
         anchors
         {
-            left: pathSlider.right
             verticalCenter: pathSlider.verticalCenter
         }
 

smartavionics avatar Jun 09 '23 15:06 smartavionics

Looks like really an issue due to the plugin and not easy to solved via your code.
x: playButton.x - UM.Theme.getSize("small_button").width produce exatly the same result as left: pathSlider.right

The button is at the same place if the plugin is not activated but with the plugin : image

5axes avatar Jun 09 '23 15:06 5axes

Ok, thanks for trying it. Sorry, I don't have any other ideas right now.

smartavionics avatar Jun 09 '23 15:06 smartavionics

Hi @5axes , here's another solution. The change below is applied to PathSlider.qml and it adds the line that starts Keys.onSpacePressed. With this in place, when the layer slider is focused, space will toggle the display of the line details. Hope this works for you.

diff --git a/plugins/SimulationView/PathSlider.qml b/plugins/SimulationView/PathSlider.qml
index 8d23c19d21..b35115e4ea 100644
--- a/plugins/SimulationView/PathSlider.qml
+++ b/plugins/SimulationView/PathSlider.qml
@@ -181,6 +181,8 @@ Item
 
         Keys.onRightPressed: handle.setValueManually(handleValue + ((event.modifiers & Qt.ShiftModifier) ? 10 : 1))
         Keys.onLeftPressed: handle.setValueManually(handleValue - ((event.modifiers & Qt.ShiftModifier) ? 10 : 1))
+        Keys.onSpacePressed: UM.SimulationView.setDisplayLineDetails(!UM.SimulationView.getDisplayLineDetails())
+
 
         // dragging
         MouseArea

smartavionics avatar Jun 09 '23 19:06 smartavionics

No change image

5axes avatar Jun 10 '23 10:06 5axes

You need to remove the previous changes and just use the space bar toggle and ignore the hidden (i) button.

smartavionics avatar Jun 10 '23 12:06 smartavionics