Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] Widget status bar #2464

Merged
merged 13 commits into from
Aug 18, 2017
Merged

[ENH] Widget status bar #2464

merged 13 commits into from
Aug 18, 2017

Conversation

ales-erjavec
Copy link
Contributor

Issue

The OWWidget's 'message_bar' is placed in an inappropriate position above the rest of the GUI causing frequent re-layouts which both flicker the GUI and change the position of controls under the mouse from the unsuspecting user.

Description of changes
  • Replace the top message area with a summary in a (permanent) status bar at the bottom.
  • Also add a progress bar widget, mirroring the progressBarValue state.
Includes
  • Code changes
  • Tests
  • Documentation

@codecov-io
Copy link

codecov-io commented Jul 11, 2017

Codecov Report

Merging #2464 into master will increase coverage by 0.39%.
The diff coverage is 88.93%.

@@            Coverage Diff             @@
##           master    #2464      +/-   ##
==========================================
+ Coverage   74.68%   75.07%   +0.39%     
==========================================
  Files         320      323       +3     
  Lines       56444    56838     +394     
==========================================
+ Hits        42157    42673     +516     
+ Misses      14287    14165     -122

@ales-erjavec ales-erjavec force-pushed the widget-status-bar branch 2 times, most recently from 1a70dbe to 7861908 Compare July 18, 2017 08:40
if messages:
self.message_bar.setMessages(
(m, msg(m)) for i, m in enumerate(messages)
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why enumerate and i?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leftovers from intermediate implementation

device.close()
data = bytes(device.data())
payload = base64.b64encode(data).decode("ascii")
return "data:image/png;base64," + payload
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be also useful elsewhere. Do we have a suitable place for such functions? (If not, ignore.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know. Orange.widgets.utils??


def standard_pixmap(severity):
# type: (Severity) -> QStyle.StandardPixmap
maping = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mapping?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

@janezd
Copy link
Contributor

janezd commented Jul 21, 2017

I'm eager to merge it, except for one (maybe two) small things.

Before, the "summary" in the message bar showed the text up to the first line break, and the entire message was shown in the tooltip.

screen shot 2017-07-21 at 10 49 06

Now, it shows the entire message.

screen shot 2017-07-21 at 10 51 46

I'd prefer if the text in the bar was limited to a single line.

You may not need to fix this: as I understand, the message can now include a short text, a more detailed text ... This is certainly better than splitting by \n --- except that the Msg class doesn't yet accept this attributes. Instead of reimplementing the old functionality (which is used only by a few widgets), you could add the necessary arguments to UnboundMsg.__new__ (and _BoundMsg.__call__ to allow string formatting).

The other thing - also visible in these screenshots - is the width of the tooltip, which used to resize to content.

@ales-erjavec ales-erjavec force-pushed the widget-status-bar branch 2 times, most recently from d07775c to 60404e7 Compare July 21, 2017 11:25
@ales-erjavec
Copy link
Contributor Author

I restored the previous line splitting behavior, and tooltip wrapping.
_BoundMsg.__call__ also has a new exc_info parameter to include exception traceback in the message.

@ales-erjavec ales-erjavec force-pushed the widget-status-bar branch 2 times, most recently from 14d0b73 to 27eec1c Compare July 24, 2017 10:48
@ales-erjavec ales-erjavec mentioned this pull request Aug 3, 2017
3 tasks
@ales-erjavec ales-erjavec force-pushed the widget-status-bar branch 3 times, most recently from 535dd57 to d845e2c Compare August 11, 2017 09:37
@ales-erjavec ales-erjavec changed the title [RFC][ENH] Widget status bar [ENH] Widget status bar Aug 11, 2017
@ales-erjavec ales-erjavec force-pushed the widget-status-bar branch 3 times, most recently from f699cec to d2670fd Compare August 14, 2017 17:25
@ales-erjavec ales-erjavec force-pushed the widget-status-bar branch 3 times, most recently from 3df1f8d to 8b87b4f Compare August 16, 2017 12:29
Better styling w.r.t enabled/active state.
Make the overlay positioning independent of global screen coordinates
when the overlay and the target widget are contained within the same
window.

When the window is resized (on OSX 10.11) PyQt4 only reports resize
events, even when the actual window position (top left corner of the window)
changes (e.g. by dragging the top window border).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants