Add showFloatingMessage to the View Python API
Needs RevisionPublic

Authored by NMaghfurUsman on Feb 2 2019, 1:37 PM.


Group Reviewers

This patch adds the showFloatingMessage() function to the libkis View python API, and uses it in the Ten Brushes plugin so that the plugin's mechanism to activate the previous preset can behave and appear just like the Switch to Previous Brush Preset action (a native Krita action).

showFloatingMessage could be useful for other python plugins that implement actions.

Attached is a picture of showFloatingMessage:

Diff Detail

R37 Krita
Lint Skipped
Unit Tests Skipped
NMaghfurUsman created this revision.Feb 2 2019, 1:37 PM
Restricted Application added a reviewer: Krita. · View Herald TranscriptFeb 2 2019, 1:37 PM
Restricted Application added a project: Krita. · View Herald Transcript
NMaghfurUsman requested review of this revision.Feb 2 2019, 1:37 PM
rbreu requested changes to this revision.Feb 10 2019, 10:23 AM
rbreu added a subscriber: rbreu.

I'm not sure how strict we are with this stuff in the C++ code, but you introduced a couple of trailing whitespaces:

> git apply /tmp/D18668.diff
/tmp/D18668.diff:13: trailing whitespace.
     * @param priority: 0 = High, 1 = Medium, 2 = Low. Higher priority 
/tmp/D18668.diff:33: trailing whitespace.
    p = static_cast<KisFloatingMessage::Priority>(priority); 
warning: 2 lines add whitespace errors.

Otherwise this looks like a useful feature to me. What do other people think?


The floating messegage needs to be called in this else-branch, too. Otherwise you only get it when you switch back to the previous brush by hitting a shortcut a second time.

This revision now requires changes to proceed.Feb 10 2019, 10:23 AM
rempt accepted this revision.Feb 11 2019, 11:46 AM
rempt added a subscriber: rempt.

It would be good to fix the whitespace issues, but I think it's a useful feature.