improved the way we calculate the dimension of the cancel button in the audio test dialog

This commit is contained in:
Felipe Cecagno 2015-03-26 15:50:51 -03:00
parent 3c307490ef
commit cef741937b

View File

@ -100,6 +100,11 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
if (testState == Constants.DO_ECHO_TEST) {
webRTCEchoTestStarted();
}
cancelButton.width = cancelButton.measureText(genCancelButtonLabel(TIMEOUT)).width
+ cancelButton.getStyle("paddingRight")
+ cancelButton.getStyle("paddingLeft")
+ 8; // 8 is magic number
}
private function startTimers():void {
@ -115,12 +120,16 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
if (dotTimer.running) dotTimer.stop();
if (cancelTimer.running) cancelTimer.stop();
}
private function genCancelButtonLabel(countdown:Number):String {
return cancelButtonLabel + " (" + countdown.toString() + ")";
}
private function timeout(e:TimerEvent):void {
if (countdown > 0) {
if (!cancelButton.visible && countdown < CANCEL_BUTTON)
cancelButton.visible = true;
cancelButton.label = cancelButtonLabel + " (" + countdown.toString() + ")";
cancelButton.label = genCancelButtonLabel(countdown);
countdown--;
} else {
noButtonClicked();
@ -259,8 +268,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
label="{cancelButtonLabel}"
styleName="micSettingsWindowPlaySoundButtonStyle"
click="noButtonClicked()"
toolTip=""
width="90" />
toolTip="" />
</mx:HBox>
</mx:VBox>
</mx:AddChild>