* Added the new QSS file with images Added the new QSS file with images * fixed some disabled colors to be the same everywhere. * update * big update fixed the scrollbars and lots more. * small tweaks * small fixes * fixed groupbox in qsint * Added light classic This light theme is basicallyt exactly no-stylesheet. * fixed the tabs * fixed background reportview * updated overlay stylesheets * Added preference settings from Opentheme @obelisk79 * tabbar tweaks * forgot the gradients on dark * Overlay stylesheets clean-up +move icon to folder. * removing old stylesheets removing old stylesheets * it was icons not icon, fixed it. * updated cmake and package.xml * to many spaces * removing old theme's * updated default overlay qss * removed my settings files * updated cfg files * Bunch of fixes I compiled it and didn't see any issues anymore. Could be some discussions about the new startpage thumbnails. * fixed up double arrows and the correct logo! * updated the work file for the icons * Sets no-stylesheet overlay to a stylesheet. * type in cmakelist * type in filename * oeps did set the dark theme * Update OverlayManager.cpp I removed a bit to much reverting this line * fixed text color issue in Qsint on the light theme and dark background * Update Light Theme + Dark Background.qss Fine tuning the treeview it now works good for ligth theme and dark brackgrounds. * removed prodark added back Behave dark overlay @Syres916 I deleted the overlay qss behave dark by accident. But you might want to check this PR out since it changes a lot. I deleted Pro-dark since it was not updated and is outdated and it looks also a lot like the default dark. * Update Light Theme + Light Background.qss Fixes * small fixes small fixes * remove ProDark * Update CMakeLists.txt * changed the thumbnails Also removed teh dimensions in the filename since that got annoying real fast :) * Updated other overlay stylesheets * missing extension * cleanup and some fixes to the overlay. * Update Dark Theme + Light Background.qss udpated the dark theme overaly with light background for all you maniacs who use this. * Title bar fix for windows This makes it so that it uses black title bar in windows if you have dark mode * updated white background and some colors * I think I fix merge issue now. * Some cleanup on the thumbnails * Create CMakePresets.json * idk * trying to fix conflicts * removing old themes * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Some fixes for Qsint sketcher toolbars icons * fixed merge issue with maingui * trying to fix merge conflicts * and removing again. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Start Workbench
This Workbench is intended to eventually replace (and be renamed to) Start. Its main reason for existing is to eliminate FreeCAD's dependency on QtWebEngine by redesigning Start to eliminate the HTML component.
The long-term plan for this workbench is to migrate from Qt Widgets to QtQuick/QML with a C++ backend providing access to things like FreeCAD's Recent Files list. This switch will happen sometime after we no longer have to support building on Ubuntu 20.04 LTS, which still uses Qt 5.12. The cMake integration of QML and C++ together in a single project is greatly improved in Qt 5.15 and later.
In the meantime the workbench is written in C++ so that the models can be re-used later, and only the UI itself will have to change.
Structure
The main UI file for the Start screen is in Gui/StartView.cpp -- that class is a QScrollArea that gets embedded
into a new FreeCAD MDIView. Inside the scroll area are three regions:
- New File. A set of
QPushButtonswith embeddedQLayoutsdisplaying an image and two lines of text. Currently laid out manually in aQGridLayout, but eventually it would be nice to dynamically calculate that layout to allow the buttons to exist on a single line when there is enough space for them. - Recent Files. One of two "File Card" regions, this shows a list of recent files. It uses the
Model-View-Controller architecture for flexibility and re-usability. In that architecture, the data being displayed is
called the "model", and the actual mechanism for doing the display is called the "view". Qt further differentiates
between the overall view and the display of the individual items in the view. The items are rendered by a "delegate"
when they are too complex to be displayed by the simple view (e.g. if you want images and text in a particular layout).
- The "model" in this case is
RecentFilesModel, a simple read-only interface to FreeCAD's preferences system, where it gets the list of recent files. That class is inApp/RecentFilesModel.*. It is implemented using a set of User Roles, one for each piece of data about a file. Not all data is available for all files. For example, when givenconst QModelIndex &index, you can callindex.data(DisplayedFilesModelRoles::author)to get the "author" metadata item of anFCStdfile. See theDisplayedFilesModelRolesenumeration for possible values. These roles are also exposed to QML via their names. - The View is a class derived from
QListView,Gui/FileCardView.*, whose only function beyond the standardQListViewis to implement the "height for width" functionality, so the widget can properly resize based on the number of file cards and the screen width, laying them out in a grid. - The file cards are rendered using the
FileCardDelegateclass inGui/FileCardDelegate.*. That class uses a simpleQVBoxLayoutto paint the icon, filename, and file size.
- The "model" in this case is
- Examples. Another "File Card" widget, using the same classes as Recent Files, but with a different model. In this
case the model is
ExamplesModelinApp/ExamplesModel.*. It fetches a read-only list of files from the FreeCADresources/examplesdirectory and displays them.
UI Design
This Workbench does the minimum amount of design customization, preferring to allow Stylesheet authors control over the
display via the normal QSS mechanisms in Qt. There are three FreeCAD Parameters that control the spacing between the
widgets and the size of the icons, all in the BaseApp/Preferences/Mod/Start/ preferences group:
FileCardSpacing(default: 20). The space between and around the individual File Cards.FileThumbnailIconsSize(default: 128). The size of the file thumbnail on the File Cards.NewFileIconSize(default: 48). The size of the icons on each of the "new file" buttons.
At present none of these are directly exposed to the user, and the new Start workbench does not have a preferences panel. The parameters are intended to be used by Preference Pack authors to assist in customization of FreeCAD themes. It is likely that this will be expanded once feedback from theme designers is received.