Opened 9 years ago

Closed 9 years ago

#382 closed defect (fixed)

Panel positioning has been broken for windows

Reported by: butler Owned by: butler
Priority: major Milestone: SasView 3.1.0
Component: SasView Keywords:
Cc: Work Package: SasView Bug Fixing

Description (last modified by butler)

When starting up SasView the top of the Data Manager Panel and Fit Panel are aligned and just below the toolbar by a few pixels. However, on windows if one switches to Pr or Invariant the panel moves UP so that the top of the panel is UNDER the menu and tool bar and a scroll bar appears so one can scroll up. If scolled up to the new top, the panel now has the Data Manager Panel scooted significantly down. When loading Fit Panel back it now appears where the Pr panel was (top of NEW panel area). Interestingly the Results Panel that currently loads directly beneath the Fit Panel still loads in the old place, aligned with the top of the Data Manager Panel (assuming it was not moved) but no longer completely covered by the Fit Panel.

This is NOT the case with release 3.1 alpha. I suspect that it came about by someone fiddling with the positioning on a mac and not checking on a PC as this is not a problem on the latest mac build. One of the things that is true is that the MAC version is quite ugly, but that is another issue (we currently have lots of: if Mac size, position, font, etc are one thing while PC is something else - probably need to simplify that and be more consistant).

Change History (4)

comment:1 Changed 9 years ago by butler

  • Description modified (diff)

comment:2 Changed 9 years ago by butler

  • Description modified (diff)

comment:3 Changed 9 years ago by butler

  • Owner set to butler
  • Status changed from new to accepted

comment:4 Changed 9 years ago by krzywon

  • Resolution set to fixed
  • Status changed from accepted to closed

I fixed this in windows, and would like someone to verify this is working properly on Mac, but I expect it to be fine.

The bug came the following two lines of code:
tool_height = self.parent.get_toolbar_height()
self.frame.SetPosition?((pos_x, pos_y - tool_height))

When a new perspective is chosen, PluginBase?.on_perspective in sas.guiframe.plugin_base checks the position of the current perspective window (if it exists) and then draws a new one in a spot relative to the tool bar height. The perspective window is drawn before the toolbar, so the initial tool_height is 0, but then is given a value, shifting the window up each time it is redrawn. I removed the tool_height variable and the shifting is gone.

This wouldn't have been an issue on Macs because there is no tool bar, so the height is always 0.

Note: See TracTickets for help on using tickets.