Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow different settings for floated widgets #314

Closed
hannescmarits opened this issue Sep 12, 2022 · 15 comments
Closed

Allow different settings for floated widgets #314

hannescmarits opened this issue Sep 12, 2022 · 15 comments
Assignees
Labels
enhancement New feature or request

Comments

@hannescmarits
Copy link

Hi KDDockWidgets-Team, hi Sergio,
at the moment it seems to be possible to keep floated widget in front of the main application or allow to minimize and be also in the background of the main application.
We need the possibility to have both types.
Have floated widgets which stay always in front of the main application, and
widgets which can be in front or behind the main application.

If not already possible, this should be provided.

Cheers, Hannes

@hannescmarits hannescmarits changed the title Allow different settings for docked windows Allow different settings for floated widgets Sep 12, 2022
@iamsergio
Copy link
Contributor

Maybe, but needs to be well thought first.

Can two floating windows (with different settings) be tabbed together ? If so, which settings do they acquire ?

@hannescmarits
Copy link
Author

Hi Sergio,

you are right, a good question, but maybe it’s not that difficulty.

We have an application, with windows which can be easily docked.
Other windows are rarely used, or just used to configure something and afterwards closed again.
But during that time they interact with an docked window. Therefore they should stay in front of the application.

Other windows may be docked, or not, but may be to big to always stay in front of the our application.
So it should be possible to bring the application in front of this window.

So back to your question.
It see two possibilities.

  1. ) It’s not allowed to dock/tab floating windows of different kinds.
    2.) It’s configurable if such windows than always stay in front or be minimizable and stay in the background.

Kind regards,
Hannes

@iamsergio iamsergio self-assigned this Sep 14, 2022
@iamsergio
Copy link
Contributor

Ok, sounds good.

1.6 is due today though, I'll try to delay the release by 1 day or so ;)

@iamsergio
Copy link
Contributor

Are you OK with using 1.6 branch instead of 1.6 tag ? There's quite some work involved in making a release, which we would have to duplicate

@hannescmarits
Copy link
Author

Hi Sergio,
at first i am very happy to hear that you can provide the needed functionality. This will help us a lot.
One of the development team will answer your question.
Thanks again and kind regards
Hannes

@tlaemmlein
Copy link

Yes. !.6 branch is ok. We already use this branch.

@hannescmarits
Copy link
Author

Hi Sergio,
does the currently released version 1.6 contain this feature?
Kind regards
Hannes

@iamsergio
Copy link
Contributor

I does not. I'm trying to implement it this week.

@tlaemmlein Which exact "settings" need to be per-window ? Would the window flags be enough (Qt::Window vs Qt::Tool) ?

@winterz
Copy link

winterz commented Sep 15, 2022

this new feature will be added into the new 1.7 branch, btw

@tlaemmlein
Copy link

@iamsergio We need the internal functionality of Flag_TitleBarHasMinimizeButton which is Qt::Window and Qt::Tool (after checking the source code). Hence I'm very sure that Qt::Window and Qt::Tool are enough.

To be more sure you can create an dev branch, where I can test the feature.

@iamsergio iamsergio added the enhancement New feature or request label Sep 16, 2022
iamsergio added a commit that referenced this issue Sep 16, 2022
@iamsergio
Copy link
Contributor

See DockWidgetBase::setFloatingWindowFlags(flags) and set your needed flags, per dock widget.
Call it first thing after creating the dock widget. Needs to be done before show.
I wrote some tests but will appreciate feedback. I'll be back on the 26th

@iamsergio
Copy link
Contributor

Branch is 1.7. Which is exactly the same as 1.6 but with this feature on top.

@tlaemmlein
Copy link

Hi @iamsergio ,
many thanks for implementing this feature. I have two things.
1.
To have the same behaviour like Config::Flag_TitleBarHasMinimizeButton
(See https://github.com/KDAB/KDDockWidgets/blob/1.7/src/Config.h)
I have to set (See https://github.com/KDAB/KDDockWidgets/blob/1.7/src/KDDockWidgets.h)
auto flags = pSubWnd->floatingWindowFlags();
flags = KDDockWidgets::FloatingWindowFlag::TitleBarHasMinimizeButton;
flags |= KDDockWidgets::FloatingWindowFlag::DontUseParentForFloatingWindows;
flags |= KDDockWidgets::FloatingWindowFlag::UseQtWindow;
In my eyes I would like to set the 'floating' flag also only with FloatingWindowFlag::TitleBarHasMinimizeButton.

Hence it is ok to hide Qt::Tool and Qt::Window. So I think FloatingWindowFlag::UseQtTool and FloatingWindowFlag::UseQtWindow could be removed.

The minimize action doesn't work if the (floating) window is set by the floating flags.
We figure out that TitleBar::onMinimizeClicked (https://github.com/KDAB/KDDockWidgets/blob/1.7/src/private/TitleBar.cpp) is responsible for minimize action.
It would be great to have here a bug fix.

Kind Regards,

Thomas

iamsergio added a commit that referenced this issue Sep 25, 2022
…ow.cpp

No behaviour change for now, just moving.
Its usage is tricky, so it should only be used in one place, so we
can honour FloatingWindow::m_flags overrides too.

For issue #314
iamsergio added a commit that referenced this issue Sep 25, 2022
If the user has passed custom per-window flags then we shouldn't
use the global ones.

Fixes minimize problem in #314
iamsergio added a commit that referenced this issue Sep 25, 2022
Still, one redundant flag was removed, but now, the one with
the long name.

For #314
@iamsergio
Copy link
Contributor

  1. I've added the extra verbosity/granularity to the API on purpose, in case other users will want different things
  2. Is fixed.

@hannescmarits
Copy link
Author

hannescmarits commented Oct 11, 2022 via email

iamsergio added a commit that referenced this issue Jan 28, 2023
If the user has passed custom per-window flags then we shouldn't
use the global ones.

Fixes minimize problem in #314

(cherry-picked from commit 9a74839)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants