Commit Graph

71 Commits

Author SHA1 Message Date
Uwe
faca6b2e40 [Gui] fixes for NaviCube parameters
- add missing routines to save default values

- also fix color read in (transparency was read in wrong order)
2023-02-25 18:56:27 +01:00
Uwe
4adf98e369 [Gui] add UI to change the NaviCube button size
- it was frequently requested and people now even published videos since I documented this hidden feature in the Wiki.
However, for a user it is a nightmare without a UI and users who like a bright background need to change the button color to keep the buttons visible.
2023-02-25 15:28:51 +01:00
Adrian Insaurralde Avalos
b15391752e Fix NaviCube default font incorrect display in pref. page 2023-02-25 00:00:56 +01:00
Uwe
ef29cc7657 [Gui] font setting fixes for NaviCube
- it turned out that the current check for default font failed because of wrong check for the hinting
- fix bug that when the FontSize is not yet stored in the parameters, the dialog shows a wrong size value
2023-02-16 14:11:54 +01:00
wmayer
2ffa1d546f Gui: use QString::fromStdString for std::string 2023-02-07 22:16:09 +01:00
wmayer
d24bb7195a Gui: move calls of OnChange to separate method
and explicitly call the class' method to fix warning about bypassing virtual dispatch during construction
2023-02-07 22:16:09 +01:00
luzpaz
a38b2ffbf7 Fix various trailing newlines, typos and grammar 2023-02-04 18:29:07 +01:00
Uwe
932abebca9 [Gui] register NaviCube parameters to view
- there is a bug: when deleting any NaviCube parameter in the parameters dialog, the background color suddenly changes
the fix is to register the NaviCube parameters to the view

- the PR also fixes the issue that the default font size was not properly calculated but hardcoded
2023-02-02 19:02:51 +01:00
Uwe
b39e1f2fc8 [Gui] NaviCube: improve default font
- it turned out that DejaVu Sans is not the best font since its letters are wide. Bahnschrift was designed to run narrow and it at least on all Win 10 since 2017. Therefore use this, if possible
2023-01-27 15:44:01 +01:00
Uwe
588f2d50e4 [Gui] allow to specify font for NaviCube
- the problem is that depending on the OS, the font of the NaviCube is hardly readable. For example under Windows 11, there is no Helvetica font and therefore an ugly replacement font is used. On some laptop screens the font is too large or too small etc.
- as solution this PR add the change the NaviCube's font and font size

- the PR also fixes an issue that the position (corner) of the NaviCube was not respected when the NaviCube is recreated. This fix is necessary for the PR therefore included

- as by-product the PR fixes #8082 since every change in the preferences now properly recreates the NaviCube

- the PR also removes the strange and unused class "HuuhaaClassPy"
2023-01-27 02:23:46 +01:00
luzpaz
836835074e Navicube: convert indentations to spaces 2023-01-23 16:57:58 +01:00
Uwe
3e58ada046 [skip ci] [Gui] NaviCube: remove tabs
- as detected by the CI
2022-11-29 01:38:34 +01:00
Adrian Insaurralde Avalos
dfaecfa187 [fixes #7875] Gui: use hexagon shape in NaviCube corners
makes the corners bigger and therefore easier to click

fix inconsistent NaviCube borders


Co-authored-by: Rexbas <rexbasie@gmail.com>
2022-11-29 01:31:48 +01:00
Uwe
7869b443db [skip ci] [Gui] NaviCube: fix warning about too short variable name
- also some whitespace unification
2022-11-11 05:16:18 +01:00
Uwe
60d536bdf2 [Gui] NaviCube: fix rotation to backside
- when pressing the "dot" besides the NaviCube, the rotation to the backside was not in the center thus the view jumped
2022-11-11 04:58:20 +01:00
wmayer
09550656c2 Qt6 port:
* Constructor of QFontDatabase is deprecated, use static functions instead
* Fix QuantitySpinBox::selectNumber()
* Fix InputField::selectNumber()
* Make InputField::fixup() compatible with Qt6
* QFont::setWeight requires an enum now
* QInputEvent reuires a pointing device now
* QAbstractItemView::viewOptions() has been renamed to QAbstractItemView::initViewItemOption()
2022-11-03 12:38:11 +01:00
wmayer
ec553a9292 Qt6 port:
* Explicitly include some missing headers
* Use 'static const char*' for XPM icon
* Skip template parameters for qMakePair
* Constructor of QFileInfo is marked as 'explicit' now
* QString::fromLatin1() also accepts a QByteArray
* QDateTime::fromTime_t() is deprecated in Qt5 and has been removed in Qt6. Use QDateTime::fromSecsSinceEpoch()
* QDateTime::toTime_t() is deprecated in Qt5 and has been removed in Qt6. Use QDateTime::toSecsSinceEpoch()
* QApplication::globalStrut() is deprecated. Don't use it any more.
* QWidget::isTopLevel() is deprecated, use QWidget::isWindow()
2022-11-02 15:16:41 +01:00
berniev
75acacd1b7 Gui: Use auto and range-based for (#7481)
* On lines where the variable type is obvious from inspection, avoid repeating the type using auto. 
* When possible use a ranged for loop instead of begin() and end() iterators
2022-09-14 13:25:13 -05:00
berniev
a909df7f39 Gui: Single arg ctors must be explicit (PR #7369) 2022-08-24 15:06:03 +02:00
Uwe
d1ffbc0ae9 [Gui] [skip CI] NaviCube: fix indentation mistake from previous commit 2022-08-13 15:11:32 +02:00
Uwe
d78d1bbe58 [Gui] fix NaviCube step handling
- as reported in https://forum.freecadweb.org/viewtopic.php?f=3&t=71050
2022-08-13 15:02:26 +02:00
berniev
0c70d45c83 Gui: Use override etc 2 2022-08-09 12:43:23 +02:00
berniev
6ac4d8392e Gui: use emplace_back 2022-08-05 10:33:41 +02:00
Uwe
1d95c26e2e [Gui] remove more superfluous nullptr checks 2022-07-18 03:34:22 +02:00
Uwe
f256e3caf4 [Gui] attempt to improve NaviCube rendering
When the NaviCube is relatively small, it looks clumsy on some screens. This PR tries to improve that.
2022-06-08 01:06:15 +02:00
Uwe
f60e20ef98 [skip CI] [Gui] NaviCube.cpp revert a change
from commit f70329390c since the intended fix is not universal for all cube sizes, therefore leave the old pen width as compromise that obviously worked well

(as strange as it is, restarting FC brings me everytime a different border width)
2022-05-12 06:43:29 +02:00
Uwe
84feca0521 [skip CI] [Gui] NaviCube.cpp code cleanup
- fix a typo
- uniform a variable name
- style and whitespace fixes by MSVC
2022-05-12 06:37:12 +02:00
Uwe
f70329390c [Gui] NaviCube: fix #6689
- this is almost #6848 plus some changes suggested by @Jolbas in #6839 to get rid of some magic numbers

changes to:
- the default border width of 1.5 looked clumsy, therefore reduced to 1.1
- fix pen for SHAPE_CORNER (still not optimal, see comment in #6839)
2022-05-12 05:55:48 +02:00
wmayer
2a559df2cd Gui: [skip ci] a couple of IDEs or editors struggle with the degree symbol in the comment, replace it with 'deg' 2022-05-02 13:17:50 +02:00
wmayer
254a1c5645 Gui: issue #6306 was fixed with be2ddb37a6 but this doesn't work on high DPI monitors.
This commit fixes that now
2022-05-02 12:54:07 +02:00
wmayer
46cf94e20f Gui: fixes issue #6766: Navigation Cube -> Isometric View does not work 2022-04-19 19:06:45 +02:00
wmayer
be2ddb37a6 Gui: fixes #6306: UI Rotation box can be dragged out of view 2022-04-18 16:31:10 +02:00
wmayer
97330443a2 All: modernize C++11
* replace deprecated headers
2022-03-23 22:44:18 +01:00
wmayer
96adb98f46 Gui: modernize C++11
* use nullptr
2022-03-23 18:41:21 +01:00
Uwe
bd77ff03ce [skip ci] [Gui] fix a typo 2022-03-12 19:19:16 +01:00
Uwe
3f4e7e7df7 [Gui] remove more unused headers 2022-02-19 04:04:14 +01:00
wmayer
daf1269497 Gui: remove support of using deprecated Qt OpenGL API 2022-01-26 14:46:41 +01:00
wmayer
fe7f4c4be7 Gui: remove QT_TR_NOOP from command group names and use "CommandGroup" as context string 2021-09-29 16:31:55 +02:00
donovaly
8fb567291d [Gui] fix a NaviCube Corner
fixes a copy/paste issue of commit f525904c1b
2021-03-30 12:10:15 +02:00
wmayer
f525904c1b Gui: concatenate rotations and apply the result once at the end 2021-03-29 18:29:44 +02:00
donovaly
23747f9d11 fix animation issue
SO's auto rotation has its own rotation logic that ends at fixed positions. This collides with the "to nearest" option whose aim is to rotate to the next sensible state taking into account from what position the rotation was started.

Thus the solution is to disable SO's auto rotation while the cube is rotated.
2021-03-29 17:11:50 +02:00
donovaly
e58ee299d4 [Gui] improving NaviCube
fixes bug 4495

- add missing edge faces
- implement a proper rotation recipe -> rotate towards the nearest possible state
- add preferences settings to turn off this new rotation behavior
- get rid of transparent cube faces to avoid wrong clicks, this way also remove the backfaces
- to make the edge faces fit, use triangles for the corners
- expose cube size setting to preferences dialog
- add new button to view backside
- get rid of bitmaps because as reported in https://forum.freecadweb.org/viewtopic.php?f=3&t=52118&start=20#p481781
the x y z labels are not scaled on HiDPI screens
moreover they are often "in they way" when you want to click on a corner and in principle they don't provide more info since we already have the CS with the axis labels

- also fix an arithmetic overflow compiler warning
- also rename 2 variables
2021-03-29 17:11:34 +02:00
Benjamin Nauck
0d49525798 Gui: Auto update NaviCube when changing preferences 2021-03-09 17:27:48 +01:00
luz paz
298c677873 Gui: Fix header uniformity, whitespace, and doxygen fixes 2020-11-26 10:14:56 +01:00
wmayer
27b6066beb clang/gcc/cmake: move handling of suppressed deprecated-copy warnings from source file to CMake file to more easily support gcc 10 2020-06-09 15:30:42 +02:00
wmayer
300e887480 Handle clang 10 warnings:
+ fix -Wtautological-bitwise-compare
+ fix -Wimplicit-int-float-conversion
+ fix -Wmisleading-indentation
+ fix -Wrange-loop-construct
+ suppress -Wdeprecated-copy of 3rd party libs
2020-05-25 15:34:43 +02:00
triplus
1090da622a NaviCube fix compiler warning
Forum discussion:

https://forum.freecadweb.org/viewtopic.php?f=10&t=45012
2020-04-21 10:20:01 +02:00
triplus
2241d0d112 NaviCube - tweaks and new parameters
By default navigation cube text now has more weight and CS axes are slightly shifted. A few additional parameters have been added, for being able to customize navigation cube offset, colors, font and visibility of CS. Parameters are consolidated under NaviCube group. Customization front-end, making use of this new parameters, will be added to CubeMenu module in the following days:

https://forum.freecadweb.org/viewtopic.php?f=34&t=43338
2020-03-24 11:12:54 +01:00
UR-0
e66f86c661 introducing user parameters: BaseApp->Preferences->View->NaviFontStretch
BaseApp->Preferences->View->NaviTextFront
 BaseApp->Preferences->View->NaviTextRear
 BaseApp->Preferences->View->NaviTextTop
 BaseApp->Preferences->View->NaviTextBottom
 BaseApp->Preferences->View->NaviTextLeft
 BaseApp->Preferences->View->NaviTextRight
2020-02-05 10:55:40 +01:00
UR-0
3e5806cd68 introducing user parameter: BaseApp->Preferences->View->NaviWidgetSize 2020-02-05 10:55:40 +01:00