Commit Graph

16 Commits

Author SHA1 Message Date
Chris Hennes
5c3ec1f422 Gui: WorkbenchSelector linter cleanup 2024-06-29 18:15:52 -05:00
Kacper Donat
d1535e7827 Gui: Disable changing workbench on tab bar scroll
Fixes: #14164
2024-06-21 10:55:00 -05:00
Kacper Donat
3684dc6560 Gui: Display workbench icon in the middle for icon-only
It ensures that for icon-only style it is displayed in the middle and
empty text is not accounted while calculating tab size hint. Custom
styles may need to target `QTabBar[style="icon-only"]` to apply specific
fixes like disabling padding.

Fixes: #14282
2024-06-21 10:55:00 -05:00
wmayer
d1d2b730ef Gui: Move ToolBarAreaWidget to its own files
Since ToolBarAreaWidget is not a private class any more move its declaration and definition to their own source files.
2024-06-18 18:42:18 -05:00
Kacper Donat
b1a11a6ab0 Gui: Fix wrong orientation of workbench tab bar after start
This replaces old mechanism that was based on storing tab bar
orientation in user settings with one that delays initialization by half
of a second to ensure that toolbar is placed where in right place.
2024-05-12 19:05:14 +02:00
Kacper Donat
82f6b68307 Gui: Use RTL layout when Wb Tab Bar is placed in right corner
Right corner is placed to the right edge of screen, so its natural
growth occours on the left side. Basically it is Right to Left order and
so in that case the "end" is actually on left and so TabBar should grow
in that direction.

Unfortunately it is not possible to simply use RTL Qt feature to handle
that case as it would result in reverse order of workbenches (people will still
read it in LTR order) and icons on the right which is not wanted. That's
custom support is introduced.
2024-05-12 19:05:14 +02:00
Kacper Donat
37d6ba2898 Gui: Adjust sizing of Workbench TabBar when changing orientation
This should fix issues when toolbar containing Workbench TabBar suddenly
(or not) changes orientation. It also fixes size policies so toolbar
resizes properly and does not cause window to grow.

Fixes: #13286
2024-05-12 19:05:14 +02:00
Kacper Donat
7e22dade12 Gui: Add proper tooltip to Workbench TabBar tab 2024-05-12 19:05:14 +02:00
Kacper Donat
3405939f10 Gui: Move more button to the end WB TabBar
This changes back placement of the "more" button of the WB TabBar to be
at the end, where it should be naturally placed. In order to ensure that
it is always visible the control was reworked to show this button always
after the tab bar widget which now is dynamically sized. This is
behavior that is well known from browsers.

This commit also ensures that active workbench is always visible in the
TabBar by adding additional temporary tab when necessary. This tab will
automatically dissapear when not needed.

Fixes: #13720
Fixes: #13630
2024-05-12 19:05:14 +02:00
Zheng Lei
c24ace7f73 Gui: support toolbar drag and drop to status bar and menu bar (#13571)
* Gui: support toolbar drag and drop to status bar and menu bar

Closes FreeCAD/FreeCAD#12979

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Gui: improve toolbar handling in status and menu bar

* Gui: fix workbench tab bar orientation in status or menu bar

* Gui: remove workbench toolbar position settings

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-06 17:59:16 +02:00
PaddleStroke
6ae13db72a Core: TabBar: fix issue following #13508 2024-04-29 10:55:44 -05:00
PaddleStroke
7e0cf657f4 TabBar: Move + tab to beginning. 2024-04-22 11:13:12 -05:00
wmayer
d92267c6a7 Fix several compiler warnings
* fix -Winconsistent-missing-override
* fix -Wunused-but-set-variable
* fix -Wunused-parameter
* fix -Wunused-lambda-capture
* fix -Wunused-private-field
* fix -Wpessimizing-move
2024-04-03 10:04:56 +02:00
Ladislav Michl
5a9ba5f4db Gui: WorkbenchSelector: Fix build with Qt6
indexOf is returning qsizetype in Qt6, so use type explicitely.
2024-04-02 16:19:27 +02:00
Ladislav Michl
870334cfcd Gui: WorkbenchSelector: Fix whitespaces 2024-04-02 16:19:27 +02:00
PaddleStroke
cd94350df0 Core: Introduce Tab-Bar workbench selector 2024-04-01 10:35:53 -05:00