Start Page Redesign

A forum for research and development of the user interface of FreeCAD

Moderator: agryson

User avatar
openfablab
Posts: 20
Joined: Wed Nov 02, 2016 4:42 pm

Re: Start Page Redesign

Postby openfablab » Tue May 07, 2019 9:09 pm

Hello!

New start page is great and it inspired me to experiment there with an issue tracker (simplified kind of PLM).

But I did not found how to update HTML content of start page programmatically. Can it be done at all?

tracker.png
tracker.png (25.55 KiB) Viewed 710 times
User avatar
yorik
Site Admin
Posts: 11574
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Start Page Redesign

Postby yorik » Wed May 08, 2019 2:06 pm

Yes and no...

Basically it works like this: When the Start workbench starts, a web view is automatically created, and then the StartPage.handle() function is called to produce the html code that is inserted in the webview (all happens in Start/Gui/Workbench.cpp, line78 onwards).

After this is done, the reference to the created webview is lost so there is no way to fill it with the contents of StartPage.handle() again.

There are several ways to work around this. One, which I think is the best way, would be to work only with HTML/JS, inside the existing page. That is, with javascript you are able to alter contents of the html page, basically replace the contents of a <div> element with javascript's innerHtml function. You can add timers inside javascript, or have buttons trigger a reload, etc.

If you absolutely need to reload the whole start page, then the best way is probably replace Start/Gui/Workbench.cpp line 105, instead of webView=..., make it something like FreeCADGui.webView =... So after the start WB is started, you can do something like this:

FreeCADGui.webView.webPage.browser.setHtml(StartPage.handle())

But it's less elegant and more complicated. I would try the JS way. Have a look at the StartPage.js, it has several functions that update the contents of divs to use as examples...
User avatar
Kunda1
Posts: 5915
Joined: Thu Jan 05, 2017 9:03 pm

Re: Start Page Redesign

Postby Kunda1 » Wed May 08, 2019 4:13 pm

#documentation
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
yorik
Site Admin
Posts: 11574
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Start Page Redesign

Postby yorik » Thu May 09, 2019 6:22 pm

The start center documentation actually needs some heavy work... Adding that to my todo list...
pablogil
Posts: 764
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: Start Page Redesign

Postby pablogil » Mon Aug 19, 2019 8:40 am

yorik wrote:
Thu May 09, 2019 6:22 pm
ping
Hi @yorik,

I'm wondering if you think it would be nice to add a filter to the list of Recent files of the Start WB.

It's pretty annoying (for me, of course) to see other file types in the Recent files list than the only ones I would like to have: the FCstd ones, so I was thinking about a Preferences option that let you choose which files types you want to have listed in this list.
May be the perfect solution would be to have this filter in the list itself and have the option to "live" filter it and to save (or remember) the last filtered file types you have when starting up FreeCAD again.

What do you think about it?
Thank
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
User avatar
Kunda1
Posts: 5915
Joined: Thu Jan 05, 2017 9:03 pm

Re: Start Page Redesign

Postby Kunda1 » Mon Aug 19, 2019 1:56 pm

pablogil wrote:
Mon Aug 19, 2019 8:40 am
I'm wondering if you think it would be nice to add a filter to the list of Recent files of the Start WB.
:+1:
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
yorik
Site Admin
Posts: 11574
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Start Page Redesign

Postby yorik » Mon Aug 19, 2019 4:39 pm

Good idea! I suggest you implement it as a preference option first, then if you go forward with it it will be easier to implement a system directly on the start page, that sets/unset the preference...
pablogil
Posts: 764
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: Start Page Redesign

Postby pablogil » Mon Aug 19, 2019 5:37 pm

yorik wrote:
Mon Aug 19, 2019 4:39 pm
Good idea! I suggest you implement it as a preference option first, then if you go forward with it it will be easier to implement a system directly on the start page, that sets/unset the preference...
Sadly I don’t have the skills to implement it... I just got the idea (or need) and felt like making the suggestion to anyone with enough skills to implement it :oops:

BTW, I could help with the html/CSS styles under the Start page
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here