Commit Graph

64 Commits

Author SHA1 Message Date
0penBrain
9e2883d322 Inline documentation fix 2022-01-24 17:00:36 +01:00
wmayer
43b06fe431 Gui: in AccelLineEdit use the provided placeholder text and enable the clear button 2022-01-24 15:46:53 +01:00
Dirk Olbrich
1f32cae256 [Core] set Backspace key as shortcut 2022-01-24 15:07:54 +01:00
wmayer
edd1d3e8e5 Gui: move options to use native or Qt dialogs to class DialogOptions 2021-12-30 17:31:00 +01:00
mwganson
9976b4cf84 [core] Add new parameter to BaseApp/Preferences/Dialog called DontUseNativeColorDialog, default to true 2021-12-30 17:07:25 +01:00
wmayer
b787f05d66 Gui: add button group that allows to uncheck all buttons in exclusive mode 2021-11-22 23:00:30 +01:00
wmayer
8b7dadc1ab Gui: do not include generated ui file inside header file 2021-11-22 16:50:21 +01:00
Chris Hennes
1a7b8cd379 [Gui] Refactor StatefulLabel coloring 2021-10-12 11:23:13 -05:00
Chris Hennes
3e8d84ce9b Merge branch 'master' into sketcherMoveColorsToPrefs 2021-10-11 12:31:08 -05:00
Chris Hennes
94d6a6e0f0 Gui: Add option to show alpha in QColorDialog 2021-10-10 20:17:44 -05:00
Chris Hennes
5c2aece9de [Gui] Migrate UrlLabel to use QDesktopServices
UrlLabel predates QDesktopServices' ability to ask the host OS to launch
a URL, and resorted to a Python workaround that on Windows resulted in
launchin Internet Explorer regardless of the default system browser.
2021-10-10 11:12:36 -05:00
Chris Hennes
3c463d8b78 [Gui] Add ability for stylesheet to override prefs 2021-10-06 11:43:06 -05:00
Chris Hennes
5a51cc9103 [Gui] New widget supporting per-state styles
The new StatefulLabel widget is designed to be customizable by optional
preferences entries, Qt stylesheets, and default styles, set on a
per-state basis, where "state" is a Qt property that can be changed
dynamically at runtime.
2021-10-05 23:20:29 -05:00
Chris Hennes
8f1cf9496f [Gui] Add StatefulLabel 2021-10-02 22:15:47 -05:00
wmayer
f5063af183 Gui: Change label type to ExpressionLabel in ExpressionBinding
* Add function ExpressionBinding::makeLabel() and use it in subclasses to reduce code duplication
2021-04-02 17:46:42 +02:00
Chris Hennes
b34acb8b31 Add tooltip to f(x) when there is no expression
As suggested by @luzpaz, this adds a tooltip to the f(x) icon of all
of the widgets that use it: QuantitySpinBox, UIntSpinBox, IntSpinBox,
DoubleSpinBox, and ExpLineEdit. These five classes are divided across
three files, and all five classes duplicate the same basic code. In the
existing code, no tooltip is shown if there is no expression. If there
is an expression, it (alone) is used as the tooltip.

This commit modifies that behavior to have explanatory text as the
tooltip when there is no expression, and when there is, to prepend a
short string to the beginning.

To reduce further code duplication, this is implemented by adding a new
function to ExpressionLabel allowing the text of the expression to be set.
It checks that text and if it's empty, uses a preset default string as the
tooltip. If there is expression text, it instead prepends another
bit of text to the front and sets the entire expression+prefix as the
tooltip.

TODO: In the future a lot of the preexisting code duplication could be
removed by making the ExpressionLabel class do more internal management
of the expression.

Thanks to @kisolre for the assistance tracking these down, and
suggesting the default text used.
2021-04-02 16:17:04 +02:00
Chris Hennes
098d7b9aee [GUI] Remove code for Qt < 5.9 2021-04-02 10:10:37 +02:00
Benjamin Nauck
d69bbaa51b [Gui] Use std::shared_ptr instead of boost::shared_ptr
There's no need to use boost version when stl has support for shared_ptr
2021-03-06 19:32:03 +01:00
Chris Hennes
0bc39982df [GUI] Make UrlLabel in About styleable
The UrlLabel in the About FreeCAD box was not styleable because its
rich-text contents overrode any styling applied to it. This commit
converts it to a plain text label that can then be styled in a
stylesheet using the Gui--UrlLabel selector. If no stylesheet is
applied, the UrlLabel styles itself using the old-school blue text with
an underline, but any applied stylesheet completely overrides this
default.

This does not affect the "clickability" of a UrlLabel widget, which is
handled independently of the label's content (including its textual
hyperlink, which was and still is ignored).
2021-03-02 16:45:03 +01:00
wmayer
564610211c Gui: [skip ci] Fix Qt warning 'Unable to set geometry ...' 2020-12-09 16:22:14 +01:00
luz paz
38815b9550 Gui: Fix header uniformity, whitespace, and doxygen fixes 2020-11-26 10:14:56 +01:00
wmayer
99451511ed Qt5: make StatusWidget derive from QDialog instead of QWidget to avoid code duplication and using deprecated API functions 2020-10-18 14:45:31 +02:00
wmayer
c8dae9eb85 Qt5: 'void QTime::start()' / 'int QTime::elapsed() const' / 'int QTime::restart()' are deprecated: Use QElapsedTimer instead [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer
8dbe26a95f Qt5: 'int QFontMetrics::width' is deprecated since Qt 5.11: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer
88fd77b31d Porting Py3.8/Py3.9:
Since Py3.3: 'Py_ssize_t PyUnicode_GetSize(PyObject*)' is deprecated [-Wdeprecated-declarations]
Since Py3.9: 'PyObject* PyEval_CallObjectWithKeywords(PyObject*, PyObject*, PyObject*)' is deprecated [-Wdeprecated-declarations]
Since Py3.9: 'void PyEval_InitThreads()' is deprecated [-Wdeprecated-declarations]
2020-06-12 17:51:33 +02:00
wmayer
1af7a5646f Qt5: 'Qt::DropAction QDrag::start(Qt::DropActions)' is deprecated: Use QDrag::exec() instead [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer
ca327b6f25 Qt5: 'bool QTreeWidget::isItemSelected(const QTreeWidgetItem*) const' is deprecated: Use QTreeWidgetItem::isSelected() instead [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer
06b6f9df33 Gui: [skip ci] fix ColorButton to pre-select current color in dialog 2020-03-16 09:46:09 +01:00
wmayer
3ab0a20fcd Gui: [skip ci] when changing expression of a widget then set tooltip only for the label child but not for the widget itself
this allows that a custom tooltip can be set
2020-01-09 21:35:13 +01:00
Zheng, Lei
d004278209 Gui: fix ExpLineEdit::apply()
ExpLineEdit was originally created for editing PropertyString with
optional expression. It has since been extended to be used by any type
of property.
2019-10-07 17:24:31 +02:00
Zheng, Lei
38c47d6e95 Expression: split Expression.h to ExpressionParser.h
Split Expression details into a separate header to reduce recompilation
time on changes.
2019-09-28 15:30:41 +02:00
Zheng, Lei
8b3ef8faf5 Gui: property view related changes
* Display property from linked object, colored green,

* Change DlgPropertyLink to support external linking and sub-object
  selection

* Improve large selection performance by using a timer

* Improve TAB key behavior in property editor

* Add context menu to show hidden properties, change property status,
  set expression on any and property, and add/remove dynamic properties

* Optimize expression completer model construction, as the original
  implementation gets prohibitively slow for moderate number of objects.
2019-08-17 15:08:33 +02:00
wmayer
307bb7744f add method to check if key sequence is none 2019-01-18 00:54:49 +01:00
wmayer
378c57fe1c Qt5: don't use native color dialog 2019-01-03 16:14:12 +01:00
wmayer
81f50a577c fix several bugs in LabelEditor to handle PropertyStringList 2018-12-20 23:20:23 +01:00
Peter Lama
991573f1fc Fix macOS button layout in property editor
The size of the "..." button calculated by QMacStyle was not correct,
causing other widgets in the layout to be clipped.

Also, set the size of all "..." buttons the same way.
2017-09-26 10:56:55 -03:00
Peter Lama
9187919bb8 Attacher UX enhancements
- New editor for MapMode with button to open attacher dialog
- Hide attachment properties when they are not applicable
- Disable super placement ui in attacher dialog when object is not attached
- Always select used mode in mode list
2017-09-20 19:24:35 +02:00
wmayer
0766340ebb fix clang warning: -Wunused-private-field 2017-04-22 15:55:18 +02:00
wmayer
6f230bfa58 fix build failure 2017-04-22 15:23:21 +02:00
wmayer
2e6345dbba Extend task panel for filling function 2017-04-22 14:46:26 +02:00
wmayer
e05f9dfa26 add lineedit class with clear button 2017-04-22 11:11:13 +02:00
wmayer
c997180a47 Qt4/Qt5 neutral changes:
+ remove QCoreApplication::UnicodeUTF8/QApplication::UnicodeUTF8
+ remove QCoreApplication::CodecForTr/QApplication::CodecForTr
2016-12-12 14:52:09 +01:00
wmayer
326855cab6 support to auto change color when color dialog is modal 2016-10-02 19:57:01 +02:00
wmayer
1e6dcabefc fix -Wextra in FreeCADGui 2016-09-21 20:54:52 +02:00
wmayer
e725c7b207 avoid expensive fromUtf8 method where not needed 2016-09-21 11:42:23 +02:00
Yorik van Havre
da92d338b7 Allow to edit PropertyLists directly in the property editor - fixes #2535,#2689 2016-09-05 13:25:32 -03:00
wmayer
9a38507c76 fix Coverity issues 2016-08-21 23:13:22 +02:00
Yorik van Havre
a280c3ba39 Allow to enter empty values in PropertyFloatList and PropertyIntegerList - issue #2535 2016-04-29 23:00:11 -03:00
Mateusz Skowroński
6942c23895 Qt4's qglobal.h defined TRUE and FALSE. Qt5 does not do it anymore. Replace it with true and false.
158f39ec78

This change is Qt4/Qt5 neutral.
2016-01-05 16:43:33 +01:00
Mateusz Skowroński
f48f0f69be Qt::WFlags is obsolete in Qt5. Replace it with Qt::WindowFlags.
This change is Qt4/Qt5 neutral.
2016-01-05 16:07:58 +01:00