[gnome-shell] boxpointer: don't draw the arrow overlapping the corners
- From: Dan Winship <danw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] boxpointer: don't draw the arrow overlapping the corners
- Date: Tue, 30 Nov 2010 12:19:42 +0000 (UTC)
commit 6adc12368cf09c2056606c10314de2d9674a2557
Author: Dan Winship <danw gnome org>
Date: Mon Nov 22 14:10:42 2010 -0500
boxpointer: don't draw the arrow overlapping the corners
In some circumstances, a boxpointer would draw itself with the arrow
partially overlapping the rounded corner, causing things to not line
up correctly. Don't do that.
And while we're at it, don't draw the pointer very very close to the
corner either, since it looks odd if the corner flows directly into
the arrow.
https://bugzilla.gnome.org/show_bug.cgi?id=635393
js/ui/boxpointer.js | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/js/ui/boxpointer.js b/js/ui/boxpointer.js
index 06977e8..450bed3 100644
--- a/js/ui/boxpointer.js
+++ b/js/ui/boxpointer.js
@@ -11,7 +11,7 @@ const POPUP_ANIMATION_TIME = 0.15;
/**
* BoxPointer:
- * @side: A St.Side type; currently only St.Side.TOP is implemented
+ * @side: side to draw the arrow on
* @binProperties: Properties to set on contained bin
*
* An actor which displays a triangle "arrow" pointing to a given
@@ -272,7 +272,9 @@ BoxPointer.prototype = {
// edge by the same distance as the main part of the box is
// separated from its sourceActor
let primary = global.get_primary_monitor();
- let arrowRise = this.actor.get_theme_node().get_length('-arrow-rise');
+ let themeNode = this.actor.get_theme_node();
+ let arrowRise = themeNode.get_length('-arrow-rise');
+ let borderRadius = themeNode.get_length('-arrow-border-radius');
let resX, resY;
@@ -298,13 +300,13 @@ BoxPointer.prototype = {
case St.Side.BOTTOM:
switch (alignment) {
case St.Align.START:
- resX = sourceX;
+ resX = sourceX - 2 * borderRadius;
break;
case St.Align.MIDDLE:
resX = sourceX - Math.floor((natWidth - sourceWidth) / 2);
break;
case St.Align.END:
- resX = sourceX - (natWidth - sourceWidth);
+ resX = sourceX - (natWidth - sourceWidth) + 2 * borderRadius;
break;
}
@@ -318,13 +320,13 @@ BoxPointer.prototype = {
case St.Side.RIGHT:
switch (alignment) {
case St.Align.START:
- resY = sourceY;
+ resY = sourceY - 2 * borderRadius;
break;
case St.Align.MIDDLE:
resY = sourceY - Math.floor((natHeight - sourceHeight) / 2);
break;
case St.Align.END:
- resY = sourceY - (natHeight - sourceHeight);
+ resY = sourceY - (natHeight - sourceHeight) + 2 * borderRadius;
break;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]