-
Notifications
You must be signed in to change notification settings - Fork 42
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
Create and place auth widget #278
Conversation
9d6e091
to
253ddd9
Compare
d69a0c4
to
5f845dc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks amazing! 🚀 just a couple of questions/comments inline
self.user_state.setText(_('Signed out.')) | ||
self.login.setVisible(True) | ||
self.logout.setVisible(False) | ||
self.refresh.setVisible(False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think when we log out we want the refresh button to be hidden no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@creviera asked me about where the Offline icon was, yesterday—did you want to put that in on a separate PR or were you waiting for me to respond to your Slack, Allie? All icons are in table on this Issue: freedomofpress/securedrop-ux#17
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah that's right! The new offline icon will be in the pr for this issue: #279. As I understand it, there will be three icons which are in this inventory list: freedomofpress/securedrop-ux#17. There you'll see an icon labeled "offline", the static refresh icon, and the active refresh icon.
@redshiftzero - Realizing now that when I moved the refresh icon to the StatusBar class, I didn't move this check, so yeah I didn't catch that I changed the behavior. Good catch. However, I'm working on a follow-up PR to change and test the new behavior of refresh, so if you're cool with leaving this as is for now, I'm cool with it. 😎
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed this and decided that since the refresh icon appearing when not logged in is a regression it would be good to resolve as part of this PR
''') | ||
arrow = load_image("dropdown_arrow.svg") | ||
self.setIcon(QIcon(arrow)) | ||
self.setMinimumSize(20, 20) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blarg—is that crappy art on my part, @creviera? If so, happy to re-rip another one... 🤢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ninavizz - Some higher fidelity images would be great! I'm currently using the svgs provided in the inventory list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ninavizz and @redshiftzero - In a follow-up PR I was able to improve the look of the refresh icon by changing this (which looked pixely/blocky):
refresh_pixmap = load_image('refresh.svg')
self.refresh.setIcon(QIcon(refresh_pixmap))
To the following code:
pixmap = load_image('refresh.svg')
scaled = pixmap.scaled(18, 18, Qt.KeepAspectRatio, transformMode=Qt.SmoothTransformation)
icon.addPixmap(scaled, QIcon.Normal)
But I think I need to do more research into how to work with SVGs and QIcons. I may need to create a QSvgWidget
which are used to display the contents of SVG files: https://doc.qt.io/archives/qt-5.10/qtsvg-module.html
tb.user_state.setText.assert_called_once_with('Signed out.') | ||
tb.login.setVisible.assert_called_once_with(True) | ||
tb.logout.setVisible.assert_called_once_with(False) | ||
tb.refresh.setVisible.assert_called_once_with(False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(and we should keep this assert in the test once we hide the refresh button after logout)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same response as my other comment about the upcoming PR. But now that I'm thinking about this more, I can switch the behavior back so this is a completely tested PR, and then just update the tests later.
5f845dc
to
229a0d3
Compare
@redshiftzero - refresh behavior is the same as it used to be with new tests Current and old behavior:
|
229a0d3
to
2bd3f33
Compare
4d53856
to
e2ba31a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good now, thanks!
Description
First iteration of #264
What changed?
13 securedrop_client/gui/main.py
main.py
into its ownStatusBar
class insidewidgets.py
187 securedrop_client/gui/widgets.py
StatusBar
class and moved refresh logic into here. Currently the refresh button is on the right side of the status bar. Will need to write our onQStatusBar
class in order to have a permanent left-side widget in a status bar.QStatusBar
only provldes a way to have a right-side status bar widget that doesn't get replaced by messages. This is work that can be done as part of the Refresh Widget Styles documented here: UX parity between prototypes & coded client #261JournalistMenu
class to provide a sign-out optionJournalistMenuButton
class to display the journalist menu when clicked11 securedrop_client/resources/images/dropdown_arrow.svg
359 securedrop_client/resources/images/hexes.svg
BIN +17.7 KB securedrop_client/resources/images/logo.png
What's left?