Previously the KMessageWidget was unconditionally hidden after 10 seconds after it became visible. Even if during
this timeframe a new message was shown. This correctly stops/resets the timer if another message should be
displayed while the widget is shown.
Details
Details
- Reviewers
ngraham - Group Reviewers
Spectacle - Commits
- R166:cd3f5562a7d5: Reset the hide timer if a new inline Message is displayed
- Click on "Copy to Clipboard"
- Wait 5 seconds
- Click on "Save"
- The widget hides after 10 seconds instead of previously 5
Diff Detail
Diff Detail
- Repository
- R166 Spectacle
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
src/Gui/KSMainWindow.cpp | ||
---|---|---|
372 | Just calling start() restarts the QTimer, no need to call stop() first |
Comment Actions
Buf if we want display a persistent inlinemessage (MessageDuration::Persistent) we don't want to unconditionally restart it.
Comment Actions
You call start() only from inside the check, so you can just remove your stop() call above?
Comment Actions
But that would have the same issue I'm trying to solve? There are two cases
- messageDuration == AutoHide: The widget should hide itself after 10 seconds => Start the Timer or reset it. For this is the call to start()
- messageDuration == Persistent: The widget should stay visible. If the widget is currently visible with a timer running we have to stop it. That is why I call stop()
Comment Actions
Ah, right, sorry, got confused there. Alright, but you can remove the isActive() check I guess :)