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 736343 - popupMenu: Adjust submenu arrows to RTL icon changes
popupMenu: Adjust submenu arrows to RTL icon changes
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2014-09-09 17:21 UTC by Florian Müllner
Modified: 2014-09-09 18:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
popupMenu: Adjust submenu arrows to RTL icon changes (3.41 KB, patch)
2014-09-09 17:21 UTC, Florian Müllner
committed Details | Review

Description Florian Müllner 2014-09-09 17:21:20 UTC
See patch.
Comment 1 Florian Müllner 2014-09-09 17:21:23 UTC
Created attachment 285758 [details] [review]
popupMenu: Adjust submenu arrows to RTL icon changes

Since commit e04e507659027, we will already get the right icon for the
submenu arrow, so we must not mirror it again. However we do need to
take the text direction into account for the rotation now (but that's
not actually too bad - the resulting code gets quite a bit easier).
Comment 2 Yosef Or Boczko 2014-09-09 17:27:24 UTC
It look ok with your patch, thanks!
Comment 3 Carlos Soriano 2014-09-09 17:35:39 UTC
Review of attachment 285758 [details] [review]:

LGTM overall

::: js/ui/popupMenu.js
@@ +925,3 @@
+        let targetAngle = 90;
+        if (this.actor.text_direction == Clutter.TextDirection.RTL)
+            targetAngle *= -1;

Personal preference, but looks clearer in this way maybe? Feel free to skip my proposal tho.
let targetAngle = this.actor.text_direction == Clutter.TextDirection.RTL ? -90 : 90

@@ -1058,3 @@
         this._triangleBin.add_child(this._triangle);
-        if (this._triangleBin.get_text_direction() == Clutter.TextDirection.RTL)
-            this._triangleBin.set_scale(-1.0, 1.0);

This is a drive-by change right?
Comment 4 Florian Müllner 2014-09-09 18:15:30 UTC
Attachment 285758 [details] pushed as 6823bad - popupMenu: Adjust submenu arrows to RTL icon changes

(In reply to comment #3)
> Review of attachment 285758 [details] [review]:
> Personal preference, but looks clearer in this way maybe? Feel free to skip my
> proposal tho.
> let targetAngle = this.actor.text_direction == Clutter.TextDirection.RTL ? -90
> : 90

I tend to fit code into 80-character lines, but yeah, that's a fairly old-fashioned and outdated convention :-)
Changed.


> @@ -1058,3 @@
>          this._triangleBin.add_child(this._triangle);
> -        if (this._triangleBin.get_text_direction() ==
> Clutter.TextDirection.RTL)
> -            this._triangleBin.set_scale(-1.0, 1.0);
> 
> This is a drive-by change right?

Not at all - that's how we used to handle the RTL case: always use the LTR icon, mirror it horizontally, and use relative angles for rotation.
Now that we no longer use the LTR icon unconditionally, mirroring it becomes plain wrong, and we can no longer use the same rotation for both cases. (However we could still use relative angles for the rotation, but now that we no longer have to, it makes sense to simplify that code - though you could consider that part a drive-by change ...)
Comment 5 Carlos Soriano 2014-09-09 18:20:39 UTC
(In reply to comment #4)
> Attachment 285758 [details] pushed as 6823bad - popupMenu: Adjust submenu arrows to RTL
> icon changes
> 
> (In reply to comment #3)
> > Review of attachment 285758 [details] [review] [details]:
> > Personal preference, but looks clearer in this way maybe? Feel free to skip my
> > proposal tho.
> > let targetAngle = this.actor.text_direction == Clutter.TextDirection.RTL ? -90
> > : 90
> 
> I tend to fit code into 80-character lines, but yeah, that's a fairly
> old-fashioned and outdated convention :-)
> Changed.
> 
ah yeah, me too. Still more clear in this way I think =)
> 
> > @@ -1058,3 @@
> >          this._triangleBin.add_child(this._triangle);
> > -        if (this._triangleBin.get_text_direction() ==
> > Clutter.TextDirection.RTL)
> > -            this._triangleBin.set_scale(-1.0, 1.0);
> > 
> > This is a drive-by change right?
> 
> Not at all - that's how we used to handle the RTL case: always use the LTR
> icon, mirror it horizontally, and use relative angles for rotation.
> Now that we no longer use the LTR icon unconditionally, mirroring it becomes
> plain wrong, and we can no longer use the same rotation for both cases.
> (However we could still use relative angles for the rotation, but now that we
> no longer have to, it makes sense to simplify that code - though you could
> consider that part a drive-by change ...)
Ah yeah, I though it was only the animation that was wrong.