Don't show lock, collapse in floating docks
ClosedPublic

Authored by poke1024 on Oct 7 2017, 10:33 AM.

Details

Summary

Somehow related to D8004, this is a proposal to hide the lock and collapse buttons for docks that are floating. No changes happen if the dock is in docked mode.

Demo Screenshot:

Diff Detail

Repository
R37 Krita
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
poke1024 created this revision.Oct 7 2017, 10:33 AM
rempt accepted this revision.Oct 9 2017, 9:11 AM
rempt added a subscriber: rempt.

Yes, this looks much nicer. And collapsing a floating docker never really gave a good result anyway.

This revision is now accepted and ready to land.Oct 9 2017, 9:11 AM
This revision now requires review to proceed.Oct 9 2017, 10:07 AM
dkazakov requested changes to this revision.Oct 9 2017, 10:15 AM

There is a bug in implementation of showing the buttons after docking the dockers back

Steps to reproduce:

  1. Undock the docker
  2. The buttons are hidden as expected
  3. Dock the docker back
  4. [bug] The buttons are drawn in an incorrect offset. It looks as if QWidget::updateGeometry() is not called in time
  5. After you click on the button, it starts to be painted correctly again.

Here is demo video:

This revision now requires changes to proceed.Oct 9 2017, 10:15 AM
poke1024 updated this revision to Diff 20702.Oct 14 2017, 12:00 AM

Fixes the bug observed by @dkazakov.

Simplifies the code as updateButtons is not really needed and duplicates the functionality already available in updateIcons. The main button position logic happens inside resizeEvent.

Fixes a logic problem inside resizeEvent: lockRect depends on d->collapsable, but with the old code d->collapsable was set at the end of the function without updating the lockRect to be in sync with d->collapsable.

rempt accepted this revision.Oct 14 2017, 8:41 AM

Yes, that works fine now.

@rempt Is this ready to land now? For some reason, even though you accepted the revision, the item as whole still shows up as "Needs Review".

I guess phabricator wants me to rereview it after I marked it for changes. I'll do it no.

dkazakov accepted this revision.Oct 23 2017, 7:49 AM

The patch works perfectly fine now! Please push!

This revision is now accepted and ready to land.Oct 23 2017, 7:49 AM
This revision was automatically updated to reflect the committed changes.