cleanup: Avoid unnecessary parentheses
Extra parentheses usually add noise rather than clarity, so avoid them. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/805
This commit is contained in:

committed by
Georges Basile Stavracas Neto

parent
ebf77748a8
commit
e44adb92cf
@ -72,7 +72,7 @@ var BoxPointer = GObject.registerClass({
|
||||
open(animate, onComplete) {
|
||||
let themeNode = this.get_theme_node();
|
||||
let rise = themeNode.get_length('-arrow-rise');
|
||||
let animationTime = (animate & PopupAnimation.FULL) ? POPUP_ANIMATION_TIME : 0;
|
||||
let animationTime = animate & PopupAnimation.FULL ? POPUP_ANIMATION_TIME : 0;
|
||||
|
||||
if (animate & PopupAnimation.FADE)
|
||||
this.opacity = 0;
|
||||
@ -120,8 +120,8 @@ var BoxPointer = GObject.registerClass({
|
||||
let translationY = 0;
|
||||
let themeNode = this.get_theme_node();
|
||||
let rise = themeNode.get_length('-arrow-rise');
|
||||
let fade = (animate & PopupAnimation.FADE);
|
||||
let animationTime = (animate & PopupAnimation.FULL) ? POPUP_ANIMATION_TIME : 0;
|
||||
let fade = animate & PopupAnimation.FADE;
|
||||
let animationTime = animate & PopupAnimation.FULL ? POPUP_ANIMATION_TIME : 0;
|
||||
|
||||
if (animate & PopupAnimation.SLIDE) {
|
||||
switch (this._arrowSide) {
|
||||
@ -473,7 +473,7 @@ var BoxPointer = GObject.registerClass({
|
||||
let borderWidth = themeNode.get_length('-arrow-border-width');
|
||||
let arrowBase = themeNode.get_length('-arrow-base');
|
||||
let borderRadius = themeNode.get_length('-arrow-border-radius');
|
||||
let margin = (4 * borderRadius + borderWidth + arrowBase);
|
||||
let margin = 4 * borderRadius + borderWidth + arrowBase;
|
||||
|
||||
let gap = themeNode.get_length('-boxpointer-gap');
|
||||
let padding = themeNode.get_length('-arrow-rise');
|
||||
@ -524,11 +524,11 @@ var BoxPointer = GObject.registerClass({
|
||||
arrowOrigin = sourceCenterX - resX;
|
||||
if (arrowOrigin <= (x1 + (borderRadius + halfBase))) {
|
||||
if (arrowOrigin > x1)
|
||||
resX += (arrowOrigin - x1);
|
||||
resX += arrowOrigin - x1;
|
||||
arrowOrigin = x1;
|
||||
} else if (arrowOrigin >= (x2 - (borderRadius + halfBase))) {
|
||||
if (arrowOrigin < x2)
|
||||
resX -= (x2 - arrowOrigin);
|
||||
resX -= x2 - arrowOrigin;
|
||||
arrowOrigin = x2;
|
||||
}
|
||||
break;
|
||||
@ -543,11 +543,11 @@ var BoxPointer = GObject.registerClass({
|
||||
arrowOrigin = sourceCenterY - resY;
|
||||
if (arrowOrigin <= (y1 + (borderRadius + halfBase))) {
|
||||
if (arrowOrigin > y1)
|
||||
resY += (arrowOrigin - y1);
|
||||
resY += arrowOrigin - y1;
|
||||
arrowOrigin = y1;
|
||||
} else if (arrowOrigin >= (y2 - (borderRadius + halfBase))) {
|
||||
if (arrowOrigin < y2)
|
||||
resX -= (y2 - arrowOrigin);
|
||||
resX -= y2 - arrowOrigin;
|
||||
arrowOrigin = y2;
|
||||
}
|
||||
break;
|
||||
|
Reference in New Issue
Block a user