Currently in Sketcher when one clicks on the "Create a new sketch' icon the 'Sketch orientation' dialog appears.
Essentially, I'd like to:
1) ascertain if the FC devs and community would welcome this feature?
2) request some guidance coding this
I'm a programming newb but I have lurked on several different FOSS projects, including Scribus and QGIS.
I've taken a look at the code and have learned that 'Sketch orientation' dialog .ui[1] and .cpp[2] are probably the places I need to implement the code. I've also taken a look at Qt5 Stylesheets[3] & Qt5 list of psuedo states[4]
[1] https://github.com/FreeCAD/FreeCAD/blob ... alog.ui#L4
[2] https://github.com/FreeCAD/FreeCAD/blob ... Dialog.cpp
[3] http://doc.qt.io/Qt-5/stylesheet-syntax.html
[4] http://doc.qt.io/Qt-5/stylesheet-refere ... udo-states
More research in FC forums:
"Problems Styling in FC" viewtopic.php?f=10&t=12417&start=10
When a user toggles the radio buttons the cube icon/vector changes states. What I'd like to propose is that when the user hovers the mouse over the radio buttons that the same effect occur but without needing to select said radiobutton.Beginner Project RFC for using mouse hover on UI dialogs
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Beginner Project RFC for using mouse hover on UI dialogs
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: Beginner Project RFC for using mouse hover on UI dialogs
I don't think the stylesheet can't do more than change values for the radio buttons themselves.
FYI, if you want to change its properties while hovering with the mouse you have to do it the following way:
I'm also attaching a simple stylesheet (.qss) with this code so that you can try it out:
1) unzip the file
2) Place the .qss file in the path that fits your OS:
OSX = /Users/[YOUR_USER_NAME]/Library/Preferences/FreeCAD/Gui/Stylesheets/
WINDOWS = C:/[INSTALLATION_PATH]/FreeCAD/data/Gui/Stylesheets/
LINUX = /home/[YOUR_USER_NAME]/.FreeCAD/Gui/Stylesheets/
FYI, if you want to change its properties while hovering with the mouse you have to do it the following way:
Code: Select all
QRadioButton:hover {
color: blue;
background-color: red;
}
1) unzip the file
2) Place the .qss file in the path that fits your OS:
OSX = /Users/[YOUR_USER_NAME]/Library/Preferences/FreeCAD/Gui/Stylesheets/
WINDOWS = C:/[INSTALLATION_PATH]/FreeCAD/data/Gui/Stylesheets/
LINUX = /home/[YOUR_USER_NAME]/.FreeCAD/Gui/Stylesheets/
- Attachments
-
- QRadioButton_hover.zip
- (253 Bytes) Downloaded 64 times
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
Re: Beginner Project RFC for using mouse hover on UI dialogs
Pyside question:
How to simulate a mouse click by hovering over a button?
Clue: need to workaround the mouseMoveEvent or directly a QHoverEvent
How to simulate a mouse click by hovering over a button?
Clue: need to workaround the mouseMoveEvent or directly a QHoverEvent
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
- wandererfan
- Veteran
- Posts: 6268
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: Beginner Project RFC for using mouse hover on UI dialogs
Hover event has a type. On mouse over it is a "HoverEnter" type and as you move away, it is "HoverLeave" type. So, onHoverEnter() emulates the mouse click logic and onHoverLeave() puts it back the way it was.
Re: Beginner Project RFC for using mouse hover on UI dialogs
The idea is that the button remains depressed when we onHoverLeave() said the button (which also means that the graphic doesn't change). If we hover over another button (not the same one) it will trigger the previous button to deselect and the new button to be depressed and the associated orientation svg to change as well.wandererfan wrote: ↑Tue Oct 01, 2019 5:50 pm Hover event has a type. On mouse over it is a "HoverEnter" type and as you move away, it is "HoverLeave" type. So, onHoverEnter() emulates the mouse click logic and onHoverLeave() puts it back the way it was.
The next things is the activating the dialog by clicking on the depressed button (instead of clicking OK) which will accept the state. Obviously there is a need to think about the other components of the dialog like offset field and the reversed checkbox.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs