Announcement

Collapse
No announcement yet.

Widget out of screen when opened with an event

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Widget out of screen when opened with an event

    Hello,

    I have a widget that is opening when right mouse button is clicked. However, when I click the mouse when It is close enough to viewport border (too left for example), half of widget stay out the view. How can I fix that? Thank you.
    Click image for larger version

Name:	Capture1.PNG
Views:	1
Size:	106.4 KB
ID:	1221871

    #2
    You can clamp the X and Y position from getting too close to the borders. The delay may not be necessary. Get Desired Size will only output the correct values if the widget's size matches up with the size of the widget's visible elements.
    Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	308.9 KB
ID:	1129472
    Last edited by drb1992; 06-13-2017, 01:30 PM.
    Logitech Wheel Plugin

    Comment


      #3
      I know this is old and all, but what do I do when my widget returns a desired size of 0/0 ?

      Comment


        #4
        You can try Force Layout Prepass (node). And then get desired size. Is the widget on a canvas? In a container or directly in the viewport?

        Comment


          #5
          I just posted this on the answerhub

          "The hierarchy is: I have a kind of root-widget that all other UserWidget-derived widgets are either a part of, or they get dynamically attached to and removed from a panel of it. The root-panel of everything is a canvas in this root-widget. Like I described in the original question, I was hoping I could stop my context menus from being partly off-screen when clicking near the right or bottom edge by using the panel's "Clipping" property. They are rather small, not full screen. I don't know how to use anchors dynamically. The only function I found related to anchors was "Set Anchors In Viewport" and I'm not sure how to use it."

          Comment


            #6
            Originally posted by Everynone View Post
            You can try Force Layout Prepass (node). And then get desired size. Is the widget on a canvas? In a container or directly in the viewport?
            I used to have it in the viewport directly, but I moved it to the canvas to have it "clipped", which isn't quite working yet...

            edit: I think Force Layout Prepass is actually helping. Then I will have to do it manually after all, I guess. Thanks!
            Last edited by MaxPower42; 10-20-2018, 12:25 PM.

            Comment

            Working...
            X