Skip to content

Commit

Permalink
optimize mouseEnabled
Browse files Browse the repository at this point in the history
  • Loading branch information
kutu committed Jun 18, 2013
1 parent 4ff6ee3 commit e196fa0
Show file tree
Hide file tree
Showing 17 changed files with 99 additions and 13 deletions.
1 change: 1 addition & 0 deletions src/GrindPlayer.mxml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
xmlns:components="ru.kutu.grindplayer.views.components.*"
preloader="ru.kutu.grindplayer.views.components.Preloader"
frameRate="25"
mouseEnabled="false"
tabChildren="false"
>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ package ru.kutu.grindplayer.views.components {

public function ControlBarMenuButton() {
super();
mouseEnabled = false;
dropDownController = new DropDownController();
dropDownController.rollOverOpenDelay = 0;
dropDownController.addEventListener(DropDownEvent.OPEN, onDropDownOpen);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<s:List xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
minWidth="50"
mouseEnabled="false"
requireSelection="true"
borderVisible="false"
contentBackgroundColor="{getStyle('menuBackgroundColor')}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
xmlns:s="library://ns.adobe.com/flex/spark"
bottom="0"
bottom.hiddenGroup="{-height}"
mouseEnabled="false"
implements="ru.kutu.grind.views.api.IControlBarView, ru.kutu.grind.views.api.IFullScreenState"
>
<fx:Script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
xmlns:s="library://ns.adobe.com/flex/spark"
skinClass.normal="ru.kutu.grindplayer.views.skins.NormalScreenButtonSkin"
skinClass.fullscreen="ru.kutu.grindplayer.views.skins.FullScreenButtonSkin"
mouseChildren="false"
visible.unavailable="false" includeInLayout.unavailable="false"
implements="ru.kutu.grind.views.api.IFullScreenButton, ru.kutu.grind.views.api.IFullScreenState"
>
Expand Down
65 changes: 62 additions & 3 deletions src/ru/kutu/grindplayer/views/components/MainView.mxml
Original file line number Diff line number Diff line change
@@ -1,4 +1,63 @@
<?xml version="1.0" encoding="utf-8"?><s:Group xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:components="ru.kutu.grindplayer.views.components.*" implements="ru.kutu.grind.views.api.IMainView" > <fx:Script> <![CDATA[ public function set errorText(value:String):void {
<?xml version="1.0" encoding="utf-8"?>
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:components="ru.kutu.grindplayer.views.components.*"
mouseEnabled="false"
implements="ru.kutu.grind.views.api.IMainView"
>

<fx:Script>
<![CDATA[
public function set errorText(value:String):void {
errorDisplay.text = value;
} public function initializing():void { currentState = "initializing"; } public function ready():void { currentState = "ready";
} public function error():void { currentState = "error"; } ]]> </fx:Script> <s:states> <s:State name="initializing" /> <s:State name="ready" /> <s:State name="error" /> </s:states> <s:Label verticalCenter="0" horizontalCenter="0" text="{resourceManager.getString('Main', 'initializing')}" includeIn="initializing" /> <components:PlayerView left="0" right="0" top="0" bottom="0" visible="false" visible.ready="true" /> <s:Label id="errorDisplay" width="80%" verticalCenter="0" horizontalCenter="0" includeIn="error" itemCreationPolicy="immediate" /> </s:Group>
}
public function initializing():void {
currentState = "initializing";
}
public function ready():void {
currentState = "ready";
}
public function error():void {
currentState = "error";
}
]]>
</fx:Script>

<s:states>
<s:State name="initializing" />
<s:State name="ready" />
<s:State name="error" />
</s:states>

<s:Label
mouseEnabled="false"
verticalCenter="0"
horizontalCenter="0"
text="{resourceManager.getString('Main', 'initializing')}"
includeIn="initializing"
/>

<components:PlayerView
left="0" right="0"
top="0" bottom="0"
visible="false"
visible.ready="true"
/>

<s:Label
id="errorDisplay"
width="80%"
mouseEnabled="false"
verticalCenter="0"
horizontalCenter="0"
includeIn="error"
itemCreationPolicy="immediate"
/>

</s:Group>
2 changes: 2 additions & 0 deletions src/ru/kutu/grindplayer/views/components/PlayerView.mxml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:components="ru.kutu.grindplayer.views.components.*"
mouseEnabled="false"
resize="dispatchResizeEvent()"
implements="ru.kutu.grind.views.api.IPlayerView"
>
Expand Down Expand Up @@ -36,6 +37,7 @@
id="mpc"
left="0" right="0"
top="0"
mouseEnabled="false"
/>

<components:Subtitles
Expand Down
1 change: 1 addition & 0 deletions src/ru/kutu/grindplayer/views/components/ScrubBar.as
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ package ru.kutu.grindplayer.views.components {

public function ScrubBar() {
super();
mouseEnabled = false;
addEventListener(FlexEvent.CHANGE_START, onSliderChangeStart);
addEventListener(FlexEvent.CHANGE_END, onSliderChangeEnd);
addEventListener(Event.CHANGE, onSliderChange);
Expand Down
2 changes: 2 additions & 0 deletions src/ru/kutu/grindplayer/views/components/TimeInfo.mxml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
xmlns:s="library://ns.adobe.com/flex/spark"
skinClass="ru.kutu.grindplayer.views.skins.TimeInfoNormalSkin"
skinClass.live="ru.kutu.grindplayer.views.skins.TimeInfoLiveSkin"
mouseEnabled="false"
mouseChildren="false"
implements="ru.kutu.grind.views.api.ITimeInfo"
>

Expand Down
12 changes: 10 additions & 2 deletions src/ru/kutu/grindplayer/views/components/VolumeComponent.mxml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:components="ru.kutu.grindplayer.views.components.*"
mouseEnabled="false"
initialize="init(event)"
implements="ru.kutu.grind.views.api.IVolumeComponent"
>
Expand Down Expand Up @@ -138,6 +139,7 @@

<s:HGroup
top="0" bottom="0"
mouseEnabled="false"
verticalAlign="contentJustify"
gap="0"
>
Expand All @@ -147,9 +149,13 @@
width="28"
/>

<s:Group>
<s:Group
mouseEnabled="false"
>
<s:mask>
<s:Group>
<s:Group
mouseEnabled="false"
>
<s:Rect
width="{volumeSliderCont.width}"
height="{volumeSliderCont.height}"
Expand All @@ -165,12 +171,14 @@
id="volumeSliderCont"
top="0" bottom="0"
x.closed="{-volumeSliderCont.width}"
mouseEnabled="false"
>
<components:ClickAndDragHSlider
id="volumeSlider"
width="50"
top="0" bottom="0"
left="8"
mouseEnabled="false"
maximum="1"
stepSize=".01"
slideDuration="0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
minHeight="22"
mouseChildren="false"
autoDrawBackground="false"
dataChange="onDataChange()"
>
Expand Down
3 changes: 3 additions & 0 deletions src/ru/kutu/grindplayer/views/skins/AlternateMenuSkin.mxml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:components="ru.kutu.grindplayer.views.components.*"
mouseEnabled="false"
>

<fx:Metadata>
Expand All @@ -28,11 +29,13 @@

<s:Group
id="dropDown"
mouseEnabled="false"
>

<s:VGroup
left="0" right="0"
top="0" bottom="0"
mouseEnabled="false"
gap="0"
>

Expand Down
9 changes: 5 additions & 4 deletions src/ru/kutu/grindplayer/views/skins/ControlBarSkin.mxml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:components="ru.kutu.grindplayer.views.components.*"
blendMode="layer"
mouseEnabled="false"
>

<s:layout>
Expand Down Expand Up @@ -34,6 +35,7 @@

<s:Group
width="100%"
mouseEnabled="false"
>

<s:Rect
Expand All @@ -52,6 +54,7 @@
id="controlPanel"
left="0" right="0"
top="0" bottom="0"
mouseEnabled="false"
verticalAlign="contentJustify"
gap="0"
>
Expand All @@ -60,13 +63,11 @@
width="55"
/>

<components:VolumeComponent
/>
<components:VolumeComponent />

<s:Spacer width="10" />

<components:TimeInfo
/>
<components:TimeInfo />

<s:Spacer width="100%" />

Expand Down
3 changes: 3 additions & 0 deletions src/ru/kutu/grindplayer/views/skins/QualityMenuSkin.mxml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:components="ru.kutu.grindplayer.views.components.*"
mouseEnabled="false"
>

<fx:Metadata>
Expand All @@ -28,11 +29,13 @@

<s:Group
id="dropDown"
mouseEnabled="false"
>

<s:VGroup
left="0" right="0"
top="0" bottom="0"
mouseEnabled="false"
gap="0"
>

Expand Down
3 changes: 3 additions & 0 deletions src/ru/kutu/grindplayer/views/skins/SubtitlesMenuSkin.mxml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:components="ru.kutu.grindplayer.views.components.*"
mouseEnabled="false"
>

<fx:Metadata>
Expand All @@ -28,11 +29,13 @@

<s:Group
id="dropDown"
mouseEnabled="false"
>

<s:VGroup
left="0" right="0"
top="0" bottom="0"
mouseEnabled="false"
gap="0"
>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:components="ru.kutu.grindplayer.views.components.*"
mouseEnabled="false"
>

<fx:Metadata>
Expand Down Expand Up @@ -58,7 +59,6 @@
top="4"
top.minimizedGroup="9"
bottom="0"
tabEnabled="false"
skinClass="ru.kutu.grindplayer.views.skins.scrubbar.ScrubBarTrackSkin"
/>

Expand Down Expand Up @@ -108,7 +108,6 @@
id="thumb"
verticalCenter="1"
minimized.minimizedGroup="true"
tabEnabled="false"
skinClass="ru.kutu.grindplayer.views.skins.scrubbar.ScrubBarThumbSkin"
/>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
mouseEnabled="false"
>

<fx:Metadata>
Expand Down Expand Up @@ -28,7 +29,6 @@
id="track"
left="0" right="0"
top="0" bottom="0"
tabEnabled="false"
skinClass="ru.kutu.grindplayer.views.skins.volume.VolumeSliderTrackSkin"
/>

Expand All @@ -46,7 +46,6 @@
<s:Button
id="thumb"
verticalCenter="0"
tabEnabled="false"
skinClass="ru.kutu.grindplayer.views.skins.volume.VolumeSliderThumbSkin"
/>

Expand Down

0 comments on commit e196fa0

Please sign in to comment.