(Webdialog) Window match clientsize.
-
It feels SO good to have an epiphany !
-
Epiphany
-
-
@unknownuser said:
Sounds like the name of a girl...
Yeah, Tiffany.
On the subject about resizing webdialogs. I have been experimenting with dlg.set_size a little today. And it's possible to change layout with the click on a button, for ex. With some callbacks and CSS. Cool! One can therefore have vertical or horisontalmenys as an option.
Now since I'm on a roll with strange solutions and odd logic, I gotta ask. Is there any pitfall doing this?
I reckon 1 is that the dialog dimensions will only be remembered during sessions(if using @variables), and go back to default setting when restarting Sketchup.
I'm just experimenting so it's not sure I would need a function like this, but it would be nice to know if its safe to use.
-
@jolran said:
I reckon 1 is that the dialog dimensions will only be remembered during sessions(if using @variables), and go back to default setting when restarting Sketchup.
don't forget it's not the WWW and a independent browser.
SU can collect values and rewrite the html and can use.min_height, .max_height
etc. to lock and carry the setting to the next session...overall position is harder to guarantee.
john -
@unknownuser said:
don't forget it's not the WWW and a independent browser.
SU can collect values and rewrite the html and can use .min_height, .max_height etc. to lock and carry the setting to the next session...Yeah, Trying to get a grasp of that. It's not evident (for me anyway) what one "should do" in ruby and what goes best in html/JS.
Storing setting to the next session on the Ruby side, must not attributes be good choice then?
@unknownuser said:
overall position is harder to guarantee.
You mean :left => 600, :top => 200 ?
Why would that be more difficult to store?
Thanks.
-
Although it is possible we should be careful not to fiddle too much with window management without a good reason. Dialogs in SketchUp store their size and position automatically.
If a dialog needs to have a specific size set to work correctly (because of dynamic content etc.) then we can do this. There is even less often a reason to force a specific position on the screen (other than the position from the last session, which the dialog should remember on its own). Window positioning is user land and should be left to be intelligently managed by the window manager (placing windows on free screen area, considering screen size and workspaces etc.).
-
@aerilius said:
If a dialog needs to have a specific size set to work correctly (because of dynamic content etc.)
I think dynamic 'context' is also a good reason.
I have a webdialog that changes it's position, size and content [based on where I moved it to] each open 'model space', SU can't handle that level of user choice.
john -
I think I'm going to consider this:
@unknownuser said:
Although it is possible we should be careful not to fiddle too much with window management without a good reason
Don't really have a good reason to use it. Just mucking around.
@unknownuser said:
I have a webdialog that changes it's position, size and content [based on where I moved it to] each open 'model space', SU can't handle that level of user choice.
Sounds really advanced. Responsive window.
-
@jolran said:
Sounds really advanced. Responsive window.
it's a prototype that seems to work on my mac, might find an excuse to finish it one day.
john
Advertisement