Commit Graph

4653 Commits

Author SHA1 Message Date
Sergio Martins
763ad1ae6b Wrapper views now also get a dummy controller
Now we can finally make all setVisible/isVisible calls go
through the controller
2022-08-20 19:24:21 +01:00
Sergio Martins
bf43df1233 Call setVisible() through the controller instead of view
This is state that's moving to the controller
2022-08-20 18:48:01 +01:00
Sergio Martins
8e0ba911d0 Call isVisible() through the controller instead of view
This will be state that's moving to the controller.
2022-08-20 18:28:58 +01:00
Sergio Martins
a1f427e8e2 Remove unused DockRegistry::dockWidgetForGuest() 2022-08-20 18:09:52 +01:00
Sergio Martins
301af34dec flutter: Generate bindings for the MainWindow controller 2022-08-20 15:54:13 +01:00
Sergio Martins
598fedaf86 flutter: Add virtual onRebuildRequested() to tab bar view
So C++ can call this whenever a tab was removed or inserted
2022-08-20 12:05:59 +01:00
Sergio Martins
809ca9e586 cmake: Add preset to build flutter frontend standalone
It can't be build in conjuction with the QtWidgets one, since
that would mean using QAction from Qt and requiring a QApplication.

Instead just build the flutter frontend.
2022-08-19 23:35:50 +01:00
Sergio Martins
8c881b6db7 flutter: Group now shows the current dockwidget 2022-08-19 22:17:01 +01:00
Sergio Martins
b0f98dfd2d flutter: Only DropArea creates the stack now
It was a bad default. Other widgets can fill parent.
2022-08-19 20:53:54 +01:00
Sergio Martins
8e5e4d9d0e flutter: Refactor DropArea_flutter.dart
Just specialized it, so we can customize it.
2022-08-19 20:46:48 +01:00
Sergio Martins
ee14264655 flutter: Regenerate bindings
Since KDDW API has changed
2022-08-18 00:10:16 +01:00
Sergio Martins
6757370ca0 Add more documentation 2022-08-15 21:36:31 +01:00
Sergio Martins
91f0a250e7 Workround Qt bug when reordering tabs 2022-08-15 21:25:11 +01:00
Sergio Martins
63ae96a919 Re-add support for reordering tabs
And this time, implement the state in the controllers.
2022-08-15 21:22:53 +01:00
Sergio Martins
65b0b7e140 Remove TabViewInterface::numDockWidgets()
The controller knows how many. Frontends no longer need to
implement this
2022-08-15 21:02:44 +01:00
Sergio Martins
a11414ed8d insertDockWidget() now returns void instead of bool
It doesn't fail.
Furthermore, the views shouldn't dictate anything. The controller
is in charge. Views don't get to say a tab failed to be added.
2022-08-15 20:56:21 +01:00
Sergio Martins
74bd786be8 qtquick: Remove code already handled by the backend
DockWidget controller knows when it's reparented
2022-08-15 20:48:55 +01:00
Sergio Martins
ca26e856db tests: Fix tst_tabbar for QtQuick 2022-08-15 20:46:36 +01:00
Sergio Martins
be2c297fa9 Fix list of tabs not being updated when dock widget closed
When closing, we need to remove from the TabBar controller.

QtWidgets tests no pass again.
2022-08-15 19:55:01 +01:00
Sergio Martins
838e953320 Fix TabBar::moveTabTo() not swapping indexes
The list of dock widgets is now stored in the controller.
2022-08-15 19:38:12 +01:00
Sergio Martins
e61d55df53 Revert "wip"
This reverts commit 4af2f1d46b.
Shouldn't have been commited, it's a local change.
2022-08-15 15:18:14 +01:00
Sergio Martins
376202c3f8 Remove more logic from tabbar view into controller 2022-08-15 14:33:33 +01:00
Sergio Martins
2a37813409 Remove more TabBarViewInterface related to indexes
That's in the controller now, shared by all frontends
2022-08-15 14:14:15 +01:00
Sergio Martins
bbef108e32 Override QTabBar::tabInserted insted of QTabWidget::tabInserted
Since we're moving logic to tab bar instead of tab widget.
Otherwise calling count() on the tab bar while QTabWidget::tabInserted
is running can give the wrong value. So settle with a single class.
2022-08-15 13:47:03 +01:00
Sergio Martins
a0329a01fb Remove from old tab bar before adding to new
By having the state consistent in the controllers it makes it easier
to implement the view counter part code. Relying on the view to
remove from old tab bar implicitly due to reparenting is obscure
2022-08-15 00:09:06 +01:00
Sergio Martins
4af2f1d46b wip 2022-08-14 23:12:21 +01:00
Sergio Martins
24040ccfbf Remove some unneeded code, already covered in TabBar.cpp 2022-08-14 23:11:51 +01:00
Sergio Martins
5a455f86a1 TabBar now knows the list of dockwidgets
It's no longer on the view.
2022-08-14 22:43:33 +01:00
Sergio Martins
9a8ca5135e Fix build 2022-08-14 19:38:51 +01:00
Sergio Martins
a9485ee0b2 Port an old syle connect to Qt5 style 2022-08-14 18:54:54 +01:00
Sergio Martins
6a9988e7b0 Remove more unneeded tab widget code 2022-08-14 18:47:59 +01:00
Sergio Martins
7f072366ed Remove now unneeded TabBar::currentTabChanged(int)
It's all in terms of current dock widget now, not indexes.
2022-08-14 18:31:50 +01:00
Sergio Martins
0b5e9bc6c1 Remove unneeded emissions of currentDockWidgetChanged
It's now wrapped with a setter, so it's emitted at the right
times always
2022-08-14 17:45:33 +01:00
Sergio Martins
8834f7d75b TabBar controller now stores the current dock widget
It's no longer stored in the view.
This makes it easier for new frontends.
2022-08-14 17:34:01 +01:00
Sergio Martins
4627571f3f qtquick: Fix current tab being current even after removed
Added lots of tests for TabBar.
2022-08-14 15:44:38 +01:00
Sergio Martins
d071fc440a Don't run tst_qtquick if KDDW_TEST_FRONTENT=1 is set
Only QtWidgets test should run in that case.
2022-08-14 14:24:51 +01:00
Sergio Martins
bcbb75da72 Add more documentation to GroupViewInterface.h 2022-08-13 23:19:09 +01:00
Sergio Martins
ca0f767f21 Add more documentation and make interfaces simpler 2022-08-13 23:08:10 +01:00
Sergio Martins
30955b5f5b Remove more pure-virtuals from GroupViewInterface
In this case, made them non-pure, as the default impl is enough
for most frontends. Only qtquick does something different
2022-08-13 22:32:49 +01:00
Sergio Martins
7a4c969b86 Removed a lot of unneeded GroupViewInterface methods
These are already implemented in TabViewInterface
2022-08-13 22:17:56 +01:00
Sergio Martins
3ffe116a02 Move more methods away from StackViewInterface
Let's just have TabBarViewInterface, which is similar
2022-08-13 20:35:09 +01:00
Sergio Martins
fb59e30c59 Move more code away from Stack and into TabBar 2022-08-13 16:04:32 +01:00
Sergio Martins
8955ec8bcb Remove unused StackViewInterface::currentIndex() 2022-08-13 14:54:59 +01:00
Sergio Martins
1868ad7bd4 Move more code out of Stack and into TabBar
The signals are more about the tabs.
2022-08-13 14:50:19 +01:00
Sergio Martins
1abebef40b Move move code from StackViewInterface.h to TabBarViewInterface.h
Phasing out the former, so frontend writers don't have to implement
two duplicate interfaces
2022-08-13 14:11:33 +01:00
Sergio Martins
de3ef59506 flutter: Regenerate bindings
Rename some DropArea arguments too, so they don't appear as "arg_X"
in Dart
2022-08-12 23:01:40 +01:00
Sergio Martins
b56e6a8279 flutter: Add convenience to access the controller
Dart can't access the DockWidgetViewInterface since Dartagnan
doesn't support multiple inheritance
2022-08-12 22:49:32 +01:00
Sergio Martins
da21d35f4b flutter: Group will display the dock widget as well 2022-08-12 22:31:33 +01:00
Sergio Martins
73cdaa8698 flutter: Show a title bar and a tab bar
Just placeholders for now, no actual tabs
2022-08-12 21:41:38 +01:00
Sergio Martins
a97e3ae831 flutter: Derive state/widget for all our view types
Mostly boilerplate code, no functionality
2022-08-12 17:58:54 +01:00