[RFC] Also animate the Cancel button
ClosedPublic

Authored by davidre on Jul 8 2019, 1:32 PM.

Details

Summary

Adds a new class ProgressButton which is a ToolButton that displays the
screenshot delay. This is achieved by first painting the button, then
a smaller transparent button on top. The width of this overlay is proportional
to the elapsed time and the color is provided by KColorScheme::PositiveText.
Finally the icon and text are drawn on top.

Test Plan



Diff Detail

Repository
R166 Spectacle
Branch
progressbutton (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 13739
Build 13757: arc lint + arc unit
davidre created this revision.Jul 8 2019, 1:32 PM
Restricted Application added a project: Spectacle. · View Herald TranscriptJul 8 2019, 1:32 PM
Restricted Application added a subscriber: Spectacle. · View Herald Transcript
davidre requested review of this revision.Jul 8 2019, 1:32 PM
davidre edited the test plan for this revision. (Show Details)Jul 8 2019, 1:41 PM
davidre added reviewers: Spectacle, broulik.
davidre edited the summary of this revision. (Show Details)Jul 8 2019, 1:49 PM

With MS Windows 9x as widget style the Button is missing it's border.

davidre added a reviewer: mart.Jul 8 2019, 1:57 PM
davidre added a reviewer: VDG.Jul 8 2019, 2:53 PM

Re that missing border, you're not painting CE_PushButtonBevel

src/Gui/ProgressButton.cpp
49

qFuzzyIsNull

src/Gui/ProgressButton.h
3

:)

However, this is a QToolButton, so this is probably to be expected.

davidre updated this revision to Diff 61399.Jul 9 2019, 10:02 AM
  • remove autogenerated line in license and superfluous NoPen call
  • Draw the button raised
davidre marked an inline comment as done.Jul 9 2019, 10:06 AM

MS Windows style only draws the border if the state of the toolbutton is raised. This is different compared to the other tyles I checked which draw them exactly the same for None, Enabled and Raised.

davidre edited the test plan for this revision. (Show Details)Jul 9 2019, 10:14 AM
davidre updated this revision to Diff 61400.Jul 9 2019, 10:21 AM
davidre marked an inline comment as done.
  • fuzzyisnull

Would love to have more feedback on this

ndavis added a subscriber: ndavis.Jul 19 2019, 5:10 PM

I think it looks pretty cool!

ngraham accepted this revision.Jul 19 2019, 6:26 PM
ngraham added a subscriber: ngraham.

Looks great and works great. Nice clean code too. Given that we're branched for 19.08, let's land this on master so we'll have a ton of time to tweak it if necessary.

This revision is now accepted and ready to land.Jul 19 2019, 6:26 PM
This revision was automatically updated to reflect the committed changes.