right-click for properties

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

Moderator: agryson

Zolko
Posts: 208
Joined: Mon Dec 17, 2018 10:02 am

right-click for properties

Postby Zolko » Tue Jan 29, 2019 2:28 pm

Hello,

I very much like the tab-bar for workbench switching, it leaves much more space for the icons in the toolbar. On the other hand, I'm not a big fan of the Combo View, because it does 2 things, and none of them very well:
  • it shows the model tree, which the tree view does also, but in full height, not 1/2 height
  • it shows the properties of the selected object, but again at the width of the tree

When I look a the tree, I'd like it to be at maximum height so I don't have to scroll so much through the model tree, but I don't need it to be very wide. The Properties on the other hand needs to be wide, but it's not always used. One can enable the Properties window, but then it's always shown, even if not used and empty. I spend my time scrolling up and down, left and right, pushing the separators...

So I have a simple request: would it be possible to have a right-click behaviour as in many software, where right-clicking on an object would present "Properties" in the menu, and that would bring up the Properties window, that would disappear when done ("OK" "Apply" "Cancel"). And the properties window would remember the size and position used the previous time it was used, to accommodate the user's habits and screen layout. All widgets being equal, there is nothing wrong with them.

Thus, one could have only the combo view, pushing the separator all the way down to give it full height, and the properties window would only show when asked. When not used, there would be more place for the tree and the main window, and when called the properties window would be larger showing more infos. This right-click is a standard behaviour now on many software.

UI2.png
UI2.png (386.06 KiB) Viewed 361 times
Zolko
Posts: 208
Joined: Mon Dec 17, 2018 10:02 am

Re: right-click for properties

Postby Zolko » Wed Jan 30, 2019 1:25 pm

From my investigation, "Property View" is a type DockWindow, and doesn't have a corresponding Std_Command. There is a similar functionality, "Appearance", which does have a Std_SetAppearance in ~/src/Gui/CommandView.cpp

Code: Select all

DEF_STD_CMD_A(StdCmdSetAppearance)

StdCmdSetAppearance::StdCmdSetAppearance()
  : Command("Std_SetAppearance")
{
...

The code is actually in ~src/Gui/DlgDisplayPropertiesImp, and is of type QWidget (QDialog ?). I believe it's a QWidget wrapped into a QDialog.

PropertyView itself is splitted in 2 parts: there is a PropertyView of type QWidget, which does all the work, and a a PropertyDockView of type Gui::DockWindow which only wraps it into a dock window. I tried to add another wrapper, of type QDialog, but failed.

Code: Select all

class PropertyDlgView : public QDialog
{
    Q_OBJECT

public:
    PropertyDlgView(Gui::Document*  pcDocument, QWidget *parent=0);
    virtual ~PropertyDlgView();
};

Code: Select all

error: invalid use of incomplete type ‘class QDialog’
 class PropertyDlgView : public QDialog
                                ^~~~~~~
In file included from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qwidget.h:44:0,
                 from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qframe.h:44,
                 from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qsplitter.h:44,
                 from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QSplitter:1,
                 from /home/hubertz/Documents/3Dcad/FreeCAD/FreeCAD-LinkStage3_git/FreeCAD/src/Gui/CombiView.cpp:26:
/usr/include/x86_64-linux-gnu/qt5/QtGui/qwindowdefs.h:55:7: note: forward declaration of ‘class QDialog’
...

If someone can give it a try and create a PropertyDlgView ... once there is a a QDialog object, it should be possible to add the command to ~/src/Gui/CommandView.cpp, like the command SetAppearance:

Code: Select all

        dlg = new Gui::Dialog::DlgDisplayPropertiesImp(getMainWindow());

Code: Select all

        dlg = new Gui::Dialog::PropertyDlgView(getMainWindow());
triplus
Posts: 8169
Joined: Mon Dec 12, 2011 4:45 pm

Re: right-click for properties

Postby triplus » Mon Feb 04, 2019 9:03 pm

Zolko wrote:
Tue Jan 29, 2019 2:28 pm
I very much like the tab-bar for workbench switching, it leaves much more space for the icons in the toolbar.
Good to hear that.

As for the rest there is Tasks section in Combo View too. Not just Tree View and Property View. Tasks section can include all sorts of widgets and options. Tree View usually has some items nested and items having longer names. In Assembly 3 i have seen another column was added to the Tree View. Further increasing the need to reserve some width for such dock widget as Combo View. Therefore in current paradigm, Combo View, i am afraid that narrow just wouldn't do.

P.S. You can create a macro to toggle (show/hide) Property View panel over the Combo View panel if you like. And for it to have different geometry, compared to the Combo View.
Opus
Posts: 85
Joined: Wed Nov 08, 2017 5:36 pm

Re: right-click for properties

Postby Opus » Thu Feb 07, 2019 2:33 pm

Zolko wrote:
Tue Jan 29, 2019 2:28 pm
When I look a the tree, I'd like it to be at maximum height so I don't have to scroll so much through the model tree, but I don't need it to be very wide. The Properties on the other hand needs to be wide, but it's not always used. One can enable the Properties window, but then it's always shown, even if not used and empty. I spend my time scrolling up and down, left and right, pushing the separators...
This was one of the objectives of the Ickby's alternative interface:
phpBB [video]


https://forum.freecadweb.org/viewtopic.php?f=34&t=23053
Zolko
Posts: 208
Joined: Mon Dec 17, 2018 10:02 am

Re: right-click for properties

Postby Zolko » Sat Mar 09, 2019 12:21 pm

triplus wrote:
Mon Feb 04, 2019 9:03 pm
As for the rest there is Tasks section in Combo View too. Not just Tree View and Property View.
well, there are 2 tabs in the property view: one for "View" and one for "Data". Except that there is also an "Appearance" entry in the right-click menu, where it's possible to edit the "View" properties (colours, transparency...). I'm asking for this same functionality for the "Data" tab, even simpler, because the "Appearance" dialog is a custom UI widget, different from the "Vew" tab (even though it changes the same parameters), and for the "Data" properties a simple window with the exact same layout would be sufficient.

The "Appearance" dialog is defined in ~/src/Gui/DlgDisplayPropertiesImp.cpp|h|ui, the Property view widget in ~/src/Gui/PropertyView.cpp|h.

P.S. You can create a macro to toggle (show/hide) Property View panel over the Combo View panel if you like. And for it to have different geometry, compared to the Combo View.
that would be close to what I want. How would you do such a macro ?