Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

  • setShowEdges from one side only

    Good Morning!

    I created a Layout at the left side of the screen as a navigation-panel. Also i use Edges to resize the panel, but only at the right site.
    Example Code:

    VLayout NavigationBar = new VLayout();
    ...
    NavigationBar.setCanDragResize(true);
    NavigationBar.setShowEdges(true);
    NavigationBar.setEdgeSize(10);
    NavigationBar.setEdgeMarginSize(10);
    NavigationBar.setResizeFrom(EdgeName.R);
    Since i only use the right edge to resize, i dont want to waste space displaying the other three edges.
    Is there a way, to display only the right Edge?

    Thank you in advance!

  • #2
    See the doc for Canvas.showResizeBar

    Comment


    • #3
      Thank you for the fast answer!

      Well.. the Edge/Resizebar is only on the right side. I guess that is what i asked for.
      But i does not solve my problem here. Let me try to discribe it a better way:

      Discription:
      Overall i got two Sidebars, one on the left and one on the right.
      The left one is the Navigationbar, which i discribed earlier. It needs to be resized from the right.
      The right one is the Actionbar, which need to be resized from the left side.
      Booth are pinned by default. But they can be unpinned.
      If they are unpinned there are two handlers, that show or hide the sidebar:
      public void onMouseOut(MouseOutEvent event) {
      hideSideBar();
      }
      and
      public void onMouseOver(MouseOverEvent event) {
      showSideBar();
      }
      Problems:
      There are some problems using the ResizeBars:
      -The MouseOutEvent triggers, as you reach the ResizeBar and hides the Sidebar. Thats why i used"NavigationBar.setEdgeMarginSize(10);". I expanded the area to touch the Edge, to avoid the problem.
      -I need a way to set the Resizebar only to the left side, for the ActionBar.
      -Another problem here is, that the Sidebar does not resize. I got an event "addResizedHandler(event -> { ... });" that does some configuration, but it seems that is is not called using the ResizeBar.

      Maybe it is possible to to create a ResizeBar that fits the needs, or to only show one Edge?

      Thank you and kind Regards
      Jay
      Last edited by JayG; 19th May 2017, 01:05.

      Comment


      • #4
        You don't need to show edges in order to drag one of them.

        This code should do what you want, with the only difference for your ActionBar being the resizeFrom side:

        Code:
        VLayout NavigationBar = new VLayout();
        ...
        NavigationBar.setCanDragResize(true);
        NavigationBar.setEdgeMarginSize(10);
        NavigationBar.setResizeFrom(EdgeName.R);
        From there, you can, of course, use regular settings or styles to apply borders/right-padding, or whatever, since you aren't showing physical edges.
        Last edited by Isomorphic; 19th May 2017, 04:28.

        Comment


        • #5
          This works for me.

          Thank you for the quick help!

          Comment

          Working...
          X