qt: Ensure that ModalOverlay is resized properly #17968

pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:20200120-fix-modaloverlay changing 2 files +17 −11
  1. hebasto commented at 6:04 PM on January 20, 2020: member

    In certain circumstances the ModalOverlay widget is not sized properly:

    On master (f018d0c9cd7f408dac016b6bfc873670de713d27) this bug looks like this: DeepinScreenshot_bitcoin-qt_20200120193402

    With this PR the wallet frame looks ok: DeepinScreenshot_bitcoin-qt_20200120195241

    Fix #17269 Fix #17967

  2. fanquake added the label GUI on Jan 20, 2020
  3. emilengler commented at 2:04 PM on January 21, 2020: contributor

    utACK f3bac3a1874313796cf2d7acea2d3da74f36a2b0

  4. MarkLTZ referenced this in commit c795fd2e1b on Jan 21, 2020
  5. promag commented at 11:26 AM on January 30, 2020: member

    Unrelated but while we are here you can notice that if the window height is increased while the modal is hiding then it will stay a little visible like:

    <img width="949" alt="Screenshot 2020-01-30 at 11 20 42" src="https://user-images.githubusercontent.com/3534524/73445461-9e462d80-4352-11ea-9331-cf45e3cb13a0.png">

    because the animation end value doesn't track the new height.

    Honestly why not drop the animation and eventually make it a modal dialog instead of being embedded?

  6. hebasto commented at 11:43 AM on January 30, 2020: member

    @promag

    Unrelated but while we are here you can notice that if the window height is increased while the modal is hiding then it will stay a little visible...

    With this PR?

  7. promag commented at 11:48 AM on January 30, 2020: member

    @hebasto here and master. You can check more easily by increasing the animation duration.

  8. hebasto force-pushed on Feb 12, 2020
  9. hebasto commented at 9:32 PM on February 12, 2020: member

    Reworked and rebased. @promag

    Unrelated but while we are here you can notice that if the window height is increased while the modal is hiding then it will stay a little visible like: ... because the animation end value doesn't track the new height.

    Fixed.

  10. hebasto requested review from jonasschnelli on Feb 12, 2020
  11. hebasto requested review from promag on Feb 12, 2020
  12. MarkLTZ referenced this in commit e730006104 on Feb 13, 2020
  13. in src/qt/modaloverlay.h:49 in 14f68ecdc2 outdated
      45 | @@ -45,6 +46,7 @@ public Q_SLOTS:
      46 |      QVector<QPair<qint64, double> > blockProcessTime;
      47 |      bool layerIsVisible;
      48 |      bool userClosed;
      49 | +    QPropertyAnimation animation{};
    


    promag commented at 11:22 PM on April 26, 2020:

    nit, m_animation, m_slide_animation or something like that. Also, could drop {}?


    hebasto commented at 11:39 PM on April 26, 2020:

    Sure! Going to fix.


    hebasto commented at 6:54 PM on April 29, 2020:
  14. in src/qt/modaloverlay.cpp:56 in 14f68ecdc2 outdated
      52 | @@ -48,6 +53,9 @@ bool ModalOverlay::eventFilter(QObject * obj, QEvent * ev) {
      53 |              if (!layerIsVisible)
      54 |                  setGeometry(0, height(), width(), height());
      55 |  
      56 | +            if (animation.state() != QAbstractAnimation::Stopped && animation.endValue().toPoint().y()) {
    


    promag commented at 11:36 PM on April 26, 2020:

    nit, == QPropertyAnimation::Running? Also add > 0 or maybe a comment giving some context.


    hebasto commented at 11:46 PM on April 26, 2020:

    According to the enum QAbstractAnimation::State docs, state != QAbstractAnimation::Stopped does not imply state == QAbstractAnimation::Running :)

    Going to add >0.


    promag commented at 12:08 AM on April 27, 2020:

    We don't pause right? Oh well, just drop it and always update when > 0 🙈


    hebasto commented at 6:54 PM on April 29, 2020:
  15. promag commented at 11:37 PM on April 26, 2020: member

    Code review ACK 14f68ecdc22e96011e53b6aea5672c853e2c648b.

  16. qt: Track QEvent::Resize during animation 4fc1df41d5
  17. hebasto force-pushed on Apr 29, 2020
  18. hebasto commented at 6:54 PM on April 29, 2020: member

    Updated 14f68ecdc22e96011e53b6aea5672c853e2c648b -> 4fc1df41d570ab631a8b47e4427a0b84305e37d1 (pr17968.02 -> pr17968.03, diff):

    • addressed @promag's comments
    • added comment for clarity
  19. promag commented at 10:35 PM on May 4, 2020: member

    Code review ACK 4fc1df41d570ab631a8b47e4427a0b84305e37d1.

  20. jonasschnelli commented at 8:30 AM on May 29, 2020: contributor

    utACK 4fc1df41d570ab631a8b47e4427a0b84305e37d1

  21. jonasschnelli merged this on May 29, 2020
  22. jonasschnelli closed this on May 29, 2020

  23. hebasto deleted the branch on May 29, 2020
  24. MarkLTZ referenced this in commit d0c74bd90a on May 29, 2020
  25. sidhujag referenced this in commit e674ac7566 on May 31, 2020
  26. Fabcien referenced this in commit ba5e86e76d on Aug 25, 2021
  27. DrahtBot locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-21 18:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me