Commit Graph

944 Commits

Author SHA1 Message Date
Sergio Martins
8c8d6503f8 Don't delete the central frame when restoring
This one can be empty.

Caught by a failing unit-test
2019-08-01 17:09:03 +01:00
Sergio Martins
3f2f515553 Comment tests that are still failing 2019-08-01 16:56:30 +01:00
Sergio Martins
3303e1a682 Minor refactoring 2019-08-01 16:52:33 +01:00
Sergio Martins
9acfa2b9bf Add a failing test 2019-08-01 15:06:42 +01:00
Sergio Martins
a0dda5f0ec example: Add option to appear with the MainWindow embedded 2019-08-01 14:56:47 +01:00
Sergio Martins
1ac027c201 Don't show the DockWidget that's about to be restored 2019-08-01 10:58:37 +01:00
Sergio Martins
9fd4df484d Add test for DockWidgetFactoryFunc 2019-08-01 10:50:40 +01:00
Sergio Martins
1849010e3e Relax check, allow to set Config flags after QApplication 2019-08-01 10:05:25 +01:00
Sergio Martins
06e58c2225 Add a factory func to Config
So dock widgets can be created on demand while being restored
2019-07-31 22:52:35 +01:00
Sergio Martins
921d090461 Centralize the OS ifdefs in Config 2019-07-31 22:27:14 +01:00
Sergio Martins
08c858ba6e Add a Config.h public header, to configure behaviour
Like enabling aero snap or native title bar
2019-07-31 22:16:25 +01:00
Sergio Martins
b32e88d50d Make detaching smooth when having native title bar 2019-07-31 15:55:16 +01:00
Sergio Martins
e3f7a448f3 Make detaching smooth when using aero-snap
Needs the grabber
2019-07-31 15:48:28 +01:00
Sergio Martins
9dbe5114e2 Don't allow non-client drag while there's a client drag going on 2019-07-31 15:39:08 +01:00
Sergio Martins
95c883008c Unbreak native title bar support
Send a proper WM_NCHITTEST to know if we're on the title bar or not
2019-07-31 15:08:14 +01:00
Sergio Martins
cb07bdbacc Remove unneeded argument 2019-07-31 14:33:59 +01:00
Sergio Martins
69cc2a5f9f Dont grab mouse when using native title bar 2019-07-31 13:24:41 +01:00
Sergio Martins
4fb416f147 Don't count native resizing as a drag 2019-07-31 12:39:43 +01:00
Sergio Martins
c4e13cd949 Delete empty frames in case dock widget isn't found 2019-07-31 12:24:07 +01:00
Sergio Martins
a9bf02ec21 Set the guest widget visible when restoring dock widget 2019-07-31 11:39:24 +01:00
Sergio Martins
6754075c68 Set icon and title to native FloatingWindow title bar too 2019-07-31 11:22:08 +01:00
Sergio Martins
5dfa66b8f2 When using native toolbars make a nice transition from docked to
undocked

So movement doesn't break
2019-07-31 11:08:12 +01:00
Sergio Martins
d2f7503359 Added a comment 2019-07-31 09:54:16 +01:00
Sergio Martins
4db2c639c2 Enable aero-snap by default on windows 10 2019-07-31 09:53:35 +01:00
Sergio Martins
9c27cb7dab Enable aero-snap by default 2019-07-31 09:33:18 +01:00
Sergio Martins
73954d40ff Fix aero-snap when there's native childs eating WM_NCHITTEST 2019-07-31 09:32:43 +01:00
Sergio Martins
990a98d7d9 Fix tests
Some QToolButtons are deleted later
2019-07-30 22:52:57 +01:00
Sergio Martins
aeba3a44f2 Fix build 2019-07-30 22:52:49 +01:00
Sergio Martins
f1b7fc2f89 DebugWindow: Debug if we receive nchittest messages
Debugging a case where we don't
2019-07-30 22:28:25 +01:00
Sergio Martins
a924970da6 Add debug code to send an hit test 2019-07-30 22:06:41 +01:00
Sergio Martins
a613aba6e6 Don't crash in qtoolbutton.cpp when unfloating
unfloating will trigger a deletion of the qtoolbutton which
is still in its event handler and will still dereference 'd'
2019-07-30 20:25:56 +01:00
Sergio Martins
a0ad09e616 aero-snap: Don't allow to drag FloatingWindow by clicking anywhere
Must drag via its TitleBar
2019-07-30 18:53:43 +01:00
Sergio Martins
2101e4be26 Aero-snap: Fix maximization behavior
- Maximized windows were being clipped
- Double click no longer maximizes
2019-07-30 18:41:37 +01:00
Sergio Martins
65953c2846 Fix title bar buttons not working with aero-snap
We can't return HTCAPTION for those.

Also fixes the used title bar geometry. It was using the geometry
of the hidden titlebar. Use actualTitleBar() instead.
2019-07-30 17:43:03 +01:00
Sergio Martins
5c4c836f30 Move aerosnap implementation into cpp file 2019-07-30 17:23:30 +01:00
Sergio Martins
39dd859584 Added a comment 2019-07-30 17:14:14 +01:00
Sergio Martins
918fceb66c Cleanup 2019-07-30 17:12:39 +01:00
Sergio Martins
cdff9b3eaa Some renaming 2019-07-30 16:59:29 +01:00
Sergio Martins
1e93160058 Remove some dead code from DockWidget 2019-07-30 16:57:26 +01:00
Sergio Martins
e53427a9fc Only return HTCAPTION when clicking on the title bar 2019-07-30 16:48:29 +01:00
Sergio Martins
556df2b068 Only use the native event filter if aero snap is enabled 2019-07-30 16:21:23 +01:00
Sergio Martins
93a0377717 Don't allow to resize when clicking on the middle
It was using mCursorPos from previous invocations
2019-07-30 14:42:58 +01:00
Sergio Martins
9979696567 Fix being able to drag a FloatingWindow when dragging its body
We should only be able to drag via title bars, not widget
background.

This separates the concept of Draggable and Window, previously
they were mixed a bit. The draggable is something you drag,
usually a TitleBar, a Tab, or if using native window decorations
then FloatingWindow is also a draggable. Then, for each draggable
there's the actual window being dragged, that's always a FloatingWindow.

We should grab the mouse of the draggable.
2019-07-30 12:50:42 +01:00
Sergio Martins
80e98b32c3 Minor cleanup 2019-07-30 12:02:36 +01:00
Sergio Martins
6550939f0c Fix typos 2019-07-30 11:00:54 +01:00
Sergio Martins
5854cd540a Remove unused include 2019-07-30 10:26:00 +01:00
Sergio Martins
cdf0c88d45 Remove unneeded method 2019-07-30 10:14:53 +01:00
Sergio Martins
ed0cc44467 Simplify the drop/hover interfaces
Just pass FloatingWindow instead of Draggable. As we only drop
FloatingWindow.
2019-07-30 10:11:41 +01:00
Sergio Martins
42f2cc48b2 Simplify, remove unneeded code
Now that WindowBeingDragged deals only in terms of FloatingWindow.
2019-07-30 10:00:53 +01:00
Sergio Martins
316e3c8fd7 Simplify. DockWidget doesn't need to be a draggable
Floating dock widgets are FloatingWindow, and when docked
the draggable is the TitleBar, so this is dead code by now
2019-07-30 09:50:26 +01:00