After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 593471 - Account Name menu should change background when opened
Account Name menu should change background when opened
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on: 593502 593503
Blocks:
 
 
Reported: 2009-08-29 09:23 UTC by Michael Monreal
Modified: 2009-08-29 19:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screenshot (11.02 KB, image/png)
2009-08-29 09:23 UTC, Michael Monreal
  Details
Simplify "toggle button" usage of Button class (9.34 KB, patch)
2009-08-29 11:35 UTC, Owen Taylor
none Details | Review
Simplify Button class by using ShellButtonBox (14.02 KB, patch)
2009-08-29 17:44 UTC, Owen Taylor
committed Details | Review

Description Michael Monreal 2009-08-29 09:23:29 UTC
Created attachment 141978 [details]
Screenshot

I think the Account Name menu (upper-right corner) should change the background
when open, similar to how the Activities button changes the background color.
Comment 1 Owen Taylor 2009-08-29 11:35:59 UTC
Created attachment 141979 [details] [review]
Simplify "toggle button" usage of Button class

for bug 593362 making sure that the button properly deactivated when the menu
failed to pop up, and never thought to check that it was staying active when
the menu did pop up. (Though it's not a regression - it wasn't staying active
before either.)

Here's a patch that changes Button around to work in an easier to understand
fashion, fixing this bug and allowing removing the ugly code that I added
yesterday.
Comment 2 Colin Walters 2009-08-29 14:36:05 UTC
Could I convince you to add this method to ShellButtonBox, and then we can gut the internals of button.js?
Comment 3 Owen Taylor 2009-08-29 17:44:09 UTC
Created attachment 141994 [details] [review]
Simplify Button class by using ShellButtonBox

Make Button class purely about adding visuals, and use ShellButtonBox
for behavior. API equivalences:

  shell.button => shell.actor [for consistency]

  staysPressed parameter to constructor => replaced by manually setting
   the 'active' property of button.actor as appropriate

  pressIn/release => button.actor.active = true/false

  enter-event/leave-event signals => button.actor notify::hover

Along the way, this fixes a bug with the user status menu where it was
not getting set to active because the button was getting a leave
(triggered by the menu popping up and grabbing the pointer) before for
button release, which disabled the staysPressed behavior.

Reported by Michael Meeks
Comment 4 Owen Taylor 2009-08-29 17:46:38 UTC
(In reply to comment #2)
> Could I convince you to add this method to ShellButtonBox, and then we can gut
> the internals of button.js?

Somehow, I didn't think it would be simple... we use Button in various not-completely-button-like ways. But it's done now. End effect is a good simplification.
Comment 5 Colin Walters 2009-08-29 18:53:13 UTC
Comment on attachment 141994 [details] [review]
Simplify Button class by using ShellButtonBox

Yep, looks great!  Definitely a good cleanup.
Comment 6 Owen Taylor 2009-08-29 19:33:19 UTC
Pushed