Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Intellij Community
Commits
0d0b7050
Commit
0d0b7050
authored
9 years ago
by
Konstantin Bulenkov
Browse files
Options
Download
Email Patches
Plain Diff
add animation
parent
5bfeda90
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
platform/platform-impl/src/com/intellij/ide/actions/AboutPopup.java
+31
-4
...latform-impl/src/com/intellij/ide/actions/AboutPopup.java
with
31 additions
and
4 deletions
+31
-4
platform/platform-impl/src/com/intellij/ide/actions/AboutPopup.java
+
31
-
4
View file @
0d0b7050
...
@@ -39,6 +39,7 @@ import com.intellij.ui.JBColor;
...
@@ -39,6 +39,7 @@ import com.intellij.ui.JBColor;
import
com.intellij.ui.LicensingFacade
;
import
com.intellij.ui.LicensingFacade
;
import
com.intellij.ui.UI
;
import
com.intellij.ui.UI
;
import
com.intellij.ui.awt.RelativePoint
;
import
com.intellij.ui.awt.RelativePoint
;
import
com.intellij.util.Alarm
;
import
com.intellij.util.text.DateFormatUtil
;
import
com.intellij.util.text.DateFormatUtil
;
import
com.intellij.util.ui.GraphicsUtil
;
import
com.intellij.util.ui.GraphicsUtil
;
import
com.intellij.util.ui.JBUI
;
import
com.intellij.util.ui.JBUI
;
...
@@ -135,6 +136,8 @@ public class AboutPopup {
...
@@ -135,6 +136,8 @@ public class AboutPopup {
private
final
List
<
Link
>
myLinks
=
new
ArrayList
<
Link
>();
private
final
List
<
Link
>
myLinks
=
new
ArrayList
<
Link
>();
private
Link
myActiveLink
;
private
Link
myActiveLink
;
private
boolean
myShowCopy
=
false
;
private
boolean
myShowCopy
=
false
;
private
float
myShowCopyAlpha
;
private
Alarm
myAlarm
=
new
Alarm
();
public
InfoSurface
(
Icon
image
)
{
public
InfoSurface
(
Icon
image
)
{
ApplicationInfoImpl
appInfo
=
(
ApplicationInfoImpl
)
ApplicationInfoEx
.
getInstanceEx
();
ApplicationInfoImpl
appInfo
=
(
ApplicationInfoImpl
)
ApplicationInfoEx
.
getInstanceEx
();
...
@@ -208,11 +211,25 @@ public class AboutPopup {
...
@@ -208,11 +211,25 @@ public class AboutPopup {
}
}
}
}
final
static
double
maxAlpha
=
0.5
;
final
static
double
fadeStep
=
0.05
;
final
static
int
animationDelay
=
15
;
@Override
@Override
public
void
mouseEntered
(
MouseEvent
e
)
{
public
void
mouseEntered
(
MouseEvent
e
)
{
if
(!
myShowCopy
)
{
if
(!
myShowCopy
)
{
myShowCopy
=
true
;
myShowCopy
=
true
;
repaint
();
myAlarm
.
cancelAllRequests
();
myAlarm
.
addRequest
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(
myShowCopyAlpha
<
maxAlpha
)
{
myShowCopyAlpha
+=
fadeStep
;
repaint
();
myAlarm
.
addRequest
(
this
,
animationDelay
);
}
}
},
animationDelay
);
}
}
}
}
...
@@ -220,7 +237,17 @@ public class AboutPopup {
...
@@ -220,7 +237,17 @@ public class AboutPopup {
public
void
mouseExited
(
MouseEvent
e
)
{
public
void
mouseExited
(
MouseEvent
e
)
{
if
(
myShowCopy
)
{
if
(
myShowCopy
)
{
myShowCopy
=
false
;
myShowCopy
=
false
;
repaint
();
myAlarm
.
cancelAllRequests
();
myAlarm
.
addRequest
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(
myShowCopyAlpha
>
0
)
{
myShowCopyAlpha
-=
fadeStep
;
repaint
();
myAlarm
.
addRequest
(
this
,
animationDelay
);
}
}
},
animationDelay
);
}
}
}
}
});
});
...
@@ -351,7 +378,7 @@ public class AboutPopup {
...
@@ -351,7 +378,7 @@ public class AboutPopup {
x
=
indentX
;
x
=
indentX
;
y
=
indentY
;
y
=
indentY
;
ApplicationInfoEx
appInfo
=
(
ApplicationInfoEx
)
ApplicationInfo
.
getInstance
();
ApplicationInfoEx
appInfo
=
(
ApplicationInfoEx
)
ApplicationInfo
.
getInstance
();
boolean
showCopyButton
=
myShowCopy
;
boolean
showCopyButton
=
myShowCopy
||
myShowCopyAlpha
>
0
;
for
(
AboutBoxLine
line
:
lines
)
{
for
(
AboutBoxLine
line
:
lines
)
{
final
String
s
=
line
.
getText
();
final
String
s
=
line
.
getText
();
setFont
(
line
.
isBold
()
?
myBoldFont
:
myFont
);
setFont
(
line
.
isBold
()
?
myBoldFont
:
myFont
);
...
@@ -371,7 +398,7 @@ public class AboutPopup {
...
@@ -371,7 +398,7 @@ public class AboutPopup {
g2
.
setFont
(
myFont
);
g2
.
setFont
(
myFont
);
g2
.
setColor
(
myLinkColor
);
g2
.
setColor
(
myLinkColor
);
final
int
xOffset
=
myImage
.
getIconWidth
()
-
width
-
10
;
final
int
xOffset
=
myImage
.
getIconWidth
()
-
width
-
10
;
final
GraphicsConfig
config
=
GraphicsUtil
.
paintWithAlpha
(
g2
,
0.5f
);
final
GraphicsConfig
config
=
GraphicsUtil
.
paintWithAlpha
(
g2
,
myShowCopyAlpha
);
g2
.
drawString
(
copyString
,
xOffset
,
yBase
+
y
);
g2
.
drawString
(
copyString
,
xOffset
,
yBase
+
y
);
config
.
restore
();
config
.
restore
();
myLinks
.
add
(
new
Link
(
new
Rectangle
(
xOffset
,
yBase
+
y
-
fontAscent
,
width
,
fontHeight
),
COPY_URL
));
myLinks
.
add
(
new
Link
(
new
Rectangle
(
xOffset
,
yBase
+
y
-
fontAscent
,
width
,
fontHeight
),
COPY_URL
));
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment