Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
fairblue
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hosting
chat
fairblue
Commits
84f77a5e
Commit
84f77a5e
authored
7 years ago
by
Ghazi Triki
Browse files
Options
Downloads
Patches
Plain Diff
Fix PopUpButtonSkin to follow component life-cycle guidelines.
parent
196d77bc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bigbluebutton-client/branding/default/style/css/org/bigbluebutton/skins/PopUpButtonSkin.as
+199
-192
199 additions, 192 deletions
...ault/style/css/org/bigbluebutton/skins/PopUpButtonSkin.as
with
199 additions
and
192 deletions
bigbluebutton-client/branding/default/style/css/org/bigbluebutton/skins/PopUpButtonSkin.as
+
199
−
192
View file @
84f77a5e
...
...
@@ -37,250 +37,257 @@
////////////////////////////////////////////////////////////////////////////////
package
org
.
bigbluebutton
.
skins
{
import
flash
.
display
.
DisplayObject
;
import
mx
.
core
.
IFlexDisplayObject
;
import
mx
.
core
.
IProgrammaticSkin
;
import
mx
.
core
.
UIComponent
;
import
mx
.
core
.
mx_internal
;
import
mx
.
skins
.
halo
.
PopUpIcon
;
use
namespace
mx_internal
;
public
class
PopUpButtonSkin
extends
UIComponent
implements
IProgrammaticSkin
{
//--------------------------------------------------------------------------
//
// Constructor
//
//--------------------------------------------------------------------------
/**
* Constructor.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public
function
PopUpButtonSkin
()
{
super
()
;
mouseEnabled
=
false
;
}
//--------------------------------------------------------------------------
//
// Overridden properties
//
//--------------------------------------------------------------------------
//----------------------------------
// measuredWidth
//----------------------------------
import
flash
.
display
.
DisplayObject
;
import
mx
.
core
.
IFlexDisplayObject
;
import
mx
.
core
.
IProgrammaticSkin
;
import
mx
.
core
.
UIComponent
;
import
mx
.
core
.
mx_internal
;
import
mx
.
skins
.
halo
.
PopUpIcon
;
use
namespace
mx_internal
;
public
class
PopUpButtonSkin
extends
UIComponent
implements
IProgrammaticSkin
{
//--------------------------------------------------------------------------
//
// Constructor
//
//--------------------------------------------------------------------------
private
var
popUpIcon
:
IFlexDisplayObject
;
/**
* Constructor.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public
function
PopUpButtonSkin
()
{
super
()
;
mouseEnabled
=
false
;
}
//--------------------------------------------------------------------------
//
// Overridden properties
//
//--------------------------------------------------------------------------
//----------------------------------
// measuredWidth
//----------------------------------
/**
* @private
*/
override
public
function
get
measuredWidth
()
:
Number
{
return
DEFAULT_MEASURED_MIN_WIDTH
;
}
//----------------------------------
// measuredHeight
//----------------------------------
/**
* @private
*/
override
public
function
get
measuredHeight
()
:
Number
{
return
DEFAULT_MEASURED_MIN_HEIGHT
;
}
/**
* @private
*/
override
public
function
get
measuredWidth
()
:
Number
{
return
DEFAULT_MEASURED_MIN_WIDTH
;
}
//--------------------------------------------------------------------------
//
// Overridden methods
//
//--------------------------------------------------------------------------
//----------------------------------
// measuredHeight
//----------------------------------
/**
* Create resize handles and window controls.
*/
override
protected
function
createChildren
()
:
void
{
popUpIcon
=
IFlexDisplayObject
(
getChildByName
(
"popUpIcon"
))
;
/**
* @private
*/
override
public
function
get
measuredHeight
()
:
Number
{
return
DEFAULT_MEASURED_MIN_HEIGHT
;
}
if
(
!
popUpIcon
)
{
var
popUpIconClass
:
Class
=
Class
(
getStyle
(
"popUpIcon"
))
;
popUpIcon
=
new
popUpIconClass
()
;
DisplayObject
(
popUpIcon
).
name
=
"popUpIcon"
;
addChild
(
DisplayObject
(
popUpIcon
))
;
DisplayObject
(
popUpIcon
).
visible
=
true
;
}
}
//--------------------------------------------------------------------------
//
// Overridden methods
//
//--------------------------------------------------------------------------
/**
* @private
*/
override
protected
function
updateDisplayList
(
w
:
Number
,
h
:
Number
)
:
void
{
super
.
updateDisplayList
(
w
,
h
)
;
/**
* @private
*/
override
protected
function
updateDisplayList
(
w
:
Number
,
h
:
Number
)
:
void
{
super
.
updateDisplayList
(
w
,
h
)
;
var
borderColorUp
:
uint
=
getStyle
(
"borderColorUp"
)
;
var
borderColorOver
:
uint
=
getStyle
(
"borderColorOver"
)
;
var
borderColorDown
:
uint
=
getStyle
(
"borderColorDown"
)
;
var
borderColorDisabled
:
uint
=
getStyle
(
"borderColorDisabled"
)
;
var
borderColorUp
:
uint
=
getStyle
(
"borderColorUp"
)
;
var
borderColorOver
:
uint
=
getStyle
(
"borderColorOver"
)
;
var
borderColorDown
:
uint
=
getStyle
(
"borderColorDown"
)
;
var
borderColorDisabled
:
uint
=
getStyle
(
"borderColorDisabled"
)
;
var
borderThickness
:
uint
=
getStyle
(
"borderThickness"
)
;
var
borderThickness
:
uint
=
getStyle
(
"borderThickness"
)
;
var
fillColorUp
:
uint
=
getStyle
(
"fillColorUp"
)
;
var
fillColorOver
:
uint
=
getStyle
(
"fillColorOver"
)
;
var
fillColorDown
:
uint
=
getStyle
(
"fillColorDown"
)
;
var
fillColorDisabled
:
uint
=
getStyle
(
"fillColorDisabled"
)
;
var
fillColorUp
:
uint
=
getStyle
(
"fillColorUp"
)
;
var
fillColorOve
r
:
uint
=
getStyle
(
"
fillColorOve
r"
)
;
var
fill
Color
Down
:
uint
=
getStyle
(
"
fill
Color
Down
"
)
;
var
fillColorDisabled
:
uint
=
getStyle
(
"
fill
ColorD
isabled
"
)
;
// User-defined styles.
var
arrowColo
r
:
uint
=
getStyle
(
"
iconColo
r"
)
;
var
arrow
Color
Over
:
uint
=
getStyle
(
"
icon
Color
Over
"
)
;
var
arrowColorDown
:
uint
=
getStyle
(
"
icon
ColorD
own
"
)
;
// User-defined styles.
var
arrowColor
:
uint
=
getStyle
(
"iconColor"
)
;
var
arrowColorOver
:
uint
=
getStyle
(
"iconColorOver"
)
;
var
arrowColorDown
:
uint
=
getStyle
(
"iconColorDown"
)
;
var
cornerRadius
:
Number
=
getStyle
(
"cornerRadius"
)
;
var
cornerRadius
:
Number
=
getStyle
(
"
cornerRadius"
)
;
var
arrowButtonWidth
:
Number
=
Math
.
max
(
getStyle
(
"
arrowButtonWidth"
),
popUpIcon
.
width
+
3
+
borderThickness
)
;
var
popUpIcon
:
IFlexDisplayObject
=
IFlexDisplayObject
(
getChildByName
(
"popUpIcon"
))
;
var
dividerPosX
:
Number
=
w
-
arrowButtonWidth
;
if
(
!
popUpIcon
)
{
var
popUpIconClass
:
Class
=
Class
(
getStyle
(
"popUpIcon"
))
;
popUpIcon
=
new
popUpIconClass
()
;
DisplayObject
(
popUpIcon
).
name
=
"popUpIcon"
;
addChild
(
DisplayObject
(
popUpIcon
))
;
DisplayObject
(
popUpIcon
).
visible
=
true
;
}
popUpIcon
.
move
(
w
-
(
arrowButtonWidth
+
popUpIcon
.
width
)
/
2
,
(
h
-
popUpIcon
.
height
)
/
2
)
;
var
arrowButtonWidth
:
Number
=
Math
.
max
(
getStyle
(
"arrowButtonWidth"
),
popUpIcon
.
width
+
3
+
borderThickness
)
;
// Corner radius
var
cr
:
Number
=
Math
.
max
(
0
,
cornerRadius
)
;
var
cr1
:
Number
=
Math
.
max
(
0
,
cornerRadius
-
borderThickness
)
;
var
dividerPosX
:
Number
=
w
-
arrowButtonWidth
;
graphics
.
clear
()
;
popUpIcon
.
move
(
w
-
(
arrowButtonWidth
+
popUpIcon
.
width
)
/
2
,
(
h
-
popUpIcon
.
height
)
/
2
)
;
switch
(
name
)
{
case
"upSkin"
:
{
// button border/edge
drawRoundRect
(
0
,
0
,
w
,
h
,
cr
,
borderColorUp
,
1
)
;
// Corner radius
var
cr
:
Number
=
Math
.
max
(
0
,
cornerRadius
)
;
var
cr1
:
Number
=
Math
.
max
(
0
,
cornerRadius
-
borderThickness
)
;
// button fill
drawRoundRect
(
borderThickness
,
borderThickness
,
w
-
(
borderThickness
*
2
),
h
-
(
borderThickness
*
2
),
cr1
,
fillColorUp
,
1
)
;
graphics
.
clear
()
;
// Separator
drawRoundRect
(
dividerPosX
,
borderThickness
,
borderThickness
,
h
-
(
borderThickness
*
2
),
cr
,
borderColorUp
,
1
)
;
switch
(
name
)
{
case
"upSkin"
:
{
// button border/edge
drawRoundRect
(
0
,
0
,
w
,
h
,
cr
,
borderColorUp
,
1
)
;
break
;
}
case
"overSkin"
:
// for hover on the main button (left) side
{
// button border/edge
drawRoundRect
(
0
,
0
,
w
,
h
,
cr
,
borderColorOver
,
1
)
;
// button fill
drawRoundRect
(
borderThickness
,
borderThickness
,
w
-
(
borderThickness
*
2
),
h
-
(
borderThickness
*
2
),
cr1
,
fillColorUp
,
1
)
;
drawRoundRect
(
dividerPosX
,
borderThickness
,
borderThickness
,
h
-
(
borderThickness
*
2
),
0
,
borderColorOver
,
1
)
;
// Separator
drawRoundRect
(
dividerPosX
,
borderThickness
,
borderThickness
,
h
-
(
borderThickness
*
2
),
cr
,
border
ColorUp
,
1
)
;
// button fill
drawRoundRect
(
borderThickness
,
borderThickness
,
w
-
(
borderThickness
*
2
)
,
h
-
(
borderThickness
*
2
),
cr
1
,
fill
ColorUp
,
1
)
;
break
;
}
case
"overSkin"
:
// for hover on the main button (left) side
{
// button border/edge
drawRoundRect
(
0
,
0
,
w
,
h
,
cr
,
borderColorOver
,
1
)
;
// left/main button fill
drawRoundRect
(
borderThickness
,
borderThickness
,
w
-
arrowButtonWidth
-
borderThickness
,
h
-
(
borderThickness
*
2
),
getRadius
(
cr1
,
true
),
fillColorOver
,
1
)
;
drawRoundRect
(
dividerPosX
,
borderThickness
,
borderThickness
,
h
-
(
borderThickness
*
2
),
0
,
borderColorOver
,
1
)
;
// Separator
drawRoundRect
(
dividerPosX
,
borderThickness
,
borderThickness
,
h
-
(
borderThickness
*
2
),
cr
,
borderColorOver
,
1
)
;
// button fill
drawRoundRect
(
borderThickness
,
borderThickness
,
w
-
(
borderThickness
*
2
),
h
-
(
borderThickness
*
2
),
cr1
,
fillColorUp
,
1
)
;
break
;
}
// left/main button fill
drawRoundRect
(
borderThickness
,
borderThickness
,
w
-
arrowButtonWidth
-
borderThickness
,
h
-
(
borderThickness
*
2
),
getRadius
(
cr1
,
true
),
fillColorOver
,
1
)
;
case
"popUpOverSkin"
:
// for hover on the arrow-button (right) side
{
arrowColor
=
arrowColorOver
;
// Separator
drawRoundRect
(
dividerPosX
,
borderThickness
,
borderThickness
,
h
-
(
borderThickness
*
2
)
,
cr
,
borderColorOver
,
1
)
;
// button border/edge
drawRoundRect
(
0
,
0
,
w
,
h
,
cr
,
borderColorOver
,
1
)
;
break
;
}
drawRoundRect
(
dividerPosX
,
borderThickness
,
borderThickness
,
h
-
(
borderThickness
*
2
),
0
,
borderColorOver
,
1
)
;
case
"popUpOverSkin"
:
// for hover on the arrow-button (right) side
{
arrowColor
=
arrowColorOver
;
// button fill
drawRoundRect
(
borderThickness
,
borderThickness
,
w
-
(
borderThickness
*
2
),
h
-
(
borderThickness
*
2
),
getRadius
(
cr1
,
true
),
fillColorUp
,
1
)
;
// button border/edge
drawRoundRect
(
0
,
0
,
w
,
h
,
cr
,
border
ColorOver
,
1
)
;
// right button fill
drawRoundRect
(
dividerPosX
+
borderThickness
,
borderThickness
,
arrowButtonWidth
-
(
borderThickness
*
2
),
h
-
(
borderThickness
*
2
),
getRadius
(
cr1
,
false
),
fill
ColorOver
,
1
)
;
drawRoundRect
(
dividerPosX
,
borderThickness
,
borderThickness
,
h
-
(
borderThickness
*
2
),
0
,
borderColorOver
,
1
)
;
// Separator
drawRoundRect
(
dividerPosX
,
borderThickness
,
borderThickness
,
h
-
(
borderThickness
*
2
),
cr
,
borderColorUp
,
1
)
;
// button fill
drawRoundRect
(
borderThickness
,
borderThickness
,
w
-
(
borderThickness
*
2
),
h
-
(
borderThickness
*
2
),
getRadius
(
cr1
,
true
),
fillColorUp
,
1
)
;
break
;
}
// right button fill
drawRoundRect
(
dividerPosX
+
borderThickness
,
borderThickness
,
arrowButtonWidth
-
(
borderThickness
*
2
),
h
-
(
borderThickness
*
2
),
getRadius
(
cr1
,
false
),
fillColorOver
,
1
)
;
case
"downSkin"
:
// for press on the main button (left) side
{
// button border/ddge
drawRoundRect
(
0
,
0
,
w
,
h
,
cr
,
borderColorDown
,
1
)
;
// Separator
drawRoundRect
(
dividerPosX
,
borderThickness
,
borderThickness
,
h
-
(
borderThickness
*
2
),
cr
,
borderColorUp
,
1
)
;
drawRoundRect
(
dividerPosX
,
borderThickness
,
borderThickness
,
h
-
(
borderThickness
*
2
),
0
,
borderColorDown
,
1
)
;
break
;
}
// button fill
drawRoundRect
(
borderThickness
,
borderThickness
,
w
-
(
borderThickness
*
2
),
h
-
(
borderThickness
*
2
),
cr1
,
fillColorUp
,
1
)
;
case
"downSkin"
:
// for press on the main button (left) side
{
// button border/ddge
drawRoundRect
(
0
,
0
,
w
,
h
,
cr
,
borderColorDown
,
1
)
;
// left/main button fill
drawRoundRect
(
borderThickness
,
borderThickness
,
w
-
arrowButtonWidth
-
borderThickness
,
h
-
(
borderThickness
*
2
),
getRadius
(
cr1
,
true
),
fillColorDown
,
1
)
;
drawRoundRect
(
dividerPosX
,
borderThickness
,
borderThickness
,
h
-
(
borderThickness
*
2
),
0
,
borderColorDown
,
1
)
;
// Separator
drawRoundRect
(
dividerPosX
,
borderThickness
,
borderThickness
,
h
-
(
borderThickness
*
2
),
cr
,
borderColorDown
,
1
)
;
// button fill
drawRoundRect
(
borderThickness
,
borderThickness
,
w
-
(
borderThickness
*
2
),
h
-
(
borderThickness
*
2
),
cr1
,
fillColorUp
,
1
)
;
break
;
}
// left/main button fill
drawRoundRect
(
borderThickness
,
borderThickness
,
w
-
arrowButtonWidth
-
borderThickness
,
h
-
(
borderThickness
*
2
),
getRadius
(
cr1
,
true
),
fillColorDown
,
1
)
;
case
"popUpDownSkin"
:
// for press on the arrow-button (right) side
{
arrowColor
=
arrowColorDown
;
// Separator
drawRoundRect
(
dividerPosX
,
borderThickness
,
borderThickness
,
h
-
(
borderThickness
*
2
)
,
cr
,
borderColorDown
,
1
)
;
// button border/edge
drawRoundRect
(
0
,
0
,
w
,
h
,
cr
,
borderColorDown
,
1
)
;
break
;
}
drawRoundRect
(
dividerPosX
,
borderThickness
,
borderThickness
,
h
-
(
borderThickness
*
2
),
0
,
borderColorDown
,
1
)
;
case
"popUpDownSkin"
:
// for press on the arrow-button (right) side
{
arrowColor
=
arrowColorDown
;
// button fill
drawRoundRect
(
borderThickness
,
borderThickness
,
w
-
(
borderThickness
*
2
),
h
-
(
borderThickness
*
2
),
cr1
,
fillColorUp
,
1
)
;
// button border/edge
drawRoundRect
(
0
,
0
,
w
,
h
,
cr
,
border
ColorDown
,
1
)
;
// right button fill
drawRoundRect
(
dividerPosX
+
borderThickness
,
borderThickness
,
arrowButtonWidth
-
(
borderThickness
*
2
),
h
-
(
borderThickness
*
2
),
getRadius
(
cr1
,
false
),
fill
ColorDown
,
1
)
;
drawRoundRect
(
dividerPosX
,
borderThickness
,
borderThickness
,
h
-
(
borderThickness
*
2
),
0
,
borderColorDown
,
1
)
;
// Separator
drawRoundRect
(
dividerPosX
,
borderThickness
,
borderThickness
,
h
-
(
borderThickness
*
2
),
cr
,
borderColorDown
,
1
)
;
// button fill
drawRoundRect
(
borderThickness
,
borderThickness
,
w
-
(
borderThickness
*
2
),
h
-
(
borderThickness
*
2
),
cr1
,
fillColorUp
,
1
)
;
break
;
}
// right button fill
drawRoundRect
(
dividerPosX
+
borderThickness
,
borderThickness
,
arrowButtonWidth
-
(
borderThickness
*
2
),
h
-
(
borderThickness
*
2
),
getRadius
(
cr1
,
false
),
fillColorDown
,
1
)
;
case
"disabledSkin"
:
{
arrowColor
=
getStyle
(
"disabledIconColor"
)
;
// Separator
drawRoundRect
(
dividerPosX
,
borderThickness
,
borderThickness
,
h
-
(
b
or
d
er
Thickness
*
2
),
cr
,
borderColorDown
,
1
)
;
// outer edge
drawRoundRect
(
0
,
0
,
w
,
h
,
c
or
n
er
Radius
,
fillColorDisabled
,
1
)
;
break
;
}
drawRoundRect
(
dividerPosX
,
borderThickness
,
borderThickness
,
h
-
(
borderThickness
*
2
),
0
,
borderColorDisabled
,
1
)
;
case
"disabledSkin"
:
{
arrowColor
=
getStyle
(
"disabledIconColor"
)
;
// button fill
drawRoundRect
(
borderThickness
,
borderThickness
,
w
-
(
borderThickness
*
2
),
h
-
(
borderThickness
*
2
),
cr1
,
fillColorDisabled
,
1
)
;
// outer edge
drawRoundRect
(
0
,
0
,
w
,
h
,
c
or
n
er
Radius
,
fill
ColorDisabled
,
1
)
;
// Separator
drawRoundRect
(
dividerPosX
,
borderThickness
,
borderThickness
,
h
-
(
b
or
d
er
Thickness
*
2
),
cr
,
border
ColorDisabled
,
1
)
;
drawRoundRect
(
dividerPosX
,
borderThickness
,
borderThickness
,
h
-
(
borderThickness
*
2
),
0
,
borderColorDisabled
,
1
)
;
// Separator
drawRoundRect
(
dividerPosX
,
borderThickness
,
borderThickness
,
h
-
(
borderThickness
*
2
),
cr
,
borderColorDisabled
,
1
)
;
// button fill
drawRoundRect
(
borderThickness
,
borderThickness
,
w
-
(
borderThickness
*
2
),
h
-
(
borderThickness
*
2
),
cr1
,
fillColorDisabled
,
1
)
;
break
;
}
// Separator
drawRoundRect
(
dividerPosX
,
borderThickness
,
borderThickness
,
h
-
(
borderThickness
*
2
),
cr
,
borderColorDisabled
,
1
)
;
}
// Separator
drawRoundRect
(
dividerPosX
,
borderThickness
,
borderThickness
,
h
-
(
borderThickness
*
2
),
cr
,
borderColorDisabled
,
1
)
;
if
(
popUpIcon
is
PopUpIcon
)
PopUpIcon
(
popUpIcon
).
arrowColor
=
arrowColor
;
}
break
;
}
//--------------------------------------------------------------------------
//
// Methods
//
//--------------------------------------------------------------------------
}
if
(
popUpIcon
is
PopUpIcon
)
PopUpIcon
(
popUpIcon
).
arrowColor
=
arrowColor
;
}
//--------------------------------------------------------------------------
//
// Methods
//
//--------------------------------------------------------------------------
/**
* @private
*/
private
function
getRadius
(
r
:
Number
,
left
:
Boolean
)
:
Object
{
return
left
?
{
br
:
0
,
bl
:
r
,
tr
:
0
,
tl
:
r
}
:
{
br
:
r
,
bl
:
0
,
tr
:
r
,
tl
:
0
}
;
}
}
/**
* @private
*/
private
function
getRadius
(
r
:
Number
,
left
:
Boolean
)
:
Object
{
return
left
?
{
br
:
0
,
bl
:
r
,
tr
:
0
,
tl
:
r
}
:
{
br
:
r
,
bl
:
0
,
tr
:
r
,
tl
:
0
}
;
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment