Skip to content

Commit

Permalink
Resolution clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
nczakaria committed Jul 27, 2015
1 parent c29ff7d commit 20ece29
Show file tree
Hide file tree
Showing 16 changed files with 84 additions and 114 deletions.
2 changes: 1 addition & 1 deletion KSKApp_Air/src/KSketch_Portable.mxml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
<s:ViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:canvas="sg.edu.smu.ksketch2.canvas.*"
firstView="sg.edu.smu.ksketch2.canvas.components.view.KSketch_SplashView" runtimeDPIProvider="OverrideRuntimeDPIProvider">
firstView="sg.edu.smu.ksketch2.canvas.components.view.KSketch_SplashView">

</s:ViewNavigatorApplication>
31 changes: 0 additions & 31 deletions KSKApp_Air/src/OverrideRuntimeDPIProvider.as

This file was deleted.

13 changes: 12 additions & 1 deletion KSKInterface/src/sg/edu/smu/ksketch2/KSketchStyles.as
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/
package sg.edu.smu.ksketch2
{
import flash.system.Capabilities;

public class KSketchStyles
{
Expand Down Expand Up @@ -84,9 +85,19 @@ package sg.edu.smu.ksketch2
public static var NUMBER_1100:Number = 1100;
public static var NUMBER_1200:Number = 1200;

public static function setView():void
{
//trace("Screen X: " + Capabilities.screenResolutionX);
//trace("Screen Y: " + Capabilities.screenResolutionY);

if(Capabilities.screenResolutionX > 1024 && Capabilities.screenResolutionY > 768)
{
KSketchStyles.scale(2);
}
}

public static function scale(scale:int):void
{
trace("Scaling by " + scale);
FONT_SIZE_14 = 14 * scale;
FONT_SIZE_18 = 18 * scale;
FONT_SIZE_26 = 26 * scale;
Expand Down
2 changes: 1 addition & 1 deletion KSKInterface/src/sg/edu/smu/ksketch2/KSketchWebLinks.as
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ package sg.edu.smu.ksketch2
public static const url:String = KSketch_Config.host_name+"/app/login.html"; //Page displayed on stagewebview
public static const jsonurlUser:String = KSketch_Config.host_name+"/user/getuser"; //To retrieve user information after login
public static const jsonurlUserMobile:String = KSketch_Config.host_name+"/user/getusermobile"; //To retrieve user information after login using ID
public static const urlUser:String = KSketch_Config.host_name+"/user/urlUserV2"; //To retrieve user id through URL
public static const urlUser:String = KSketch_Config.host_name+"/user/urlUser"; //To retrieve user id through URL

public static const login_success:String = KSketch_Config.host_name+"/app/login_successful";
public static const redirecturl_login:String = KSketch_Config.host_name+"/app/profile.html"; //Indicates successful login
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@
<s:DropShadowFilter
color="{KSketchStyles.COLOR_BLACK}" angle="{KSketchStyles.ANGLE_50}"
alpha="{KSketchStyles.ALPHA_06}"
strength="{KSketchStyles.NUMBER_02}"
blurX="{KSketchStyles.NUMBER_10}"
blurY="{KSketchStyles.NUMBER_10}"/>
strength="{KSketchStyles.NUMBER_01}"
blurX="{KSketchStyles.NUMBER_12}"
blurY="{KSketchStyles.NUMBER_12}"/>
</s:filters>
<s:Rect width="100%" height="100%" radiusX="{KSketchStyles.NUMBER_05}" radiusY="{KSketchStyles.NUMBER_05}">
<s:fill>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@
<s:DropShadowFilter
color="{KSketchStyles.COLOR_BLACK}" angle="{KSketchStyles.ANGLE_50}"
alpha="{KSketchStyles.ALPHA_06}"
strength="{KSketchStyles.NUMBER_02}"
blurX="{KSketchStyles.NUMBER_10}"
blurY="{KSketchStyles.NUMBER_10}"/>
strength="{KSketchStyles.NUMBER_01}"
blurX="{KSketchStyles.NUMBER_12}"
blurY="{KSketchStyles.NUMBER_12}"/>
</s:filters>
<s:Rect width="100%" height="100%" radiusX="{KSketchStyles.NUMBER_05}" radiusY="{KSketchStyles.NUMBER_05}">
<s:fill>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@
<s:DropShadowFilter
color="{KSketchStyles.COLOR_BLACK}" angle="{KSketchStyles.ANGLE_50}"
alpha="{KSketchStyles.ALPHA_06}"
strength="{KSketchStyles.NUMBER_02}"
blurX="{KSketchStyles.NUMBER_10}"
blurY="{KSketchStyles.NUMBER_10}"/>
strength="{KSketchStyles.NUMBER_01}"
blurX="{KSketchStyles.NUMBER_12}"
blurY="{KSketchStyles.NUMBER_12}"/>
</s:filters>
<s:Rect width="100%" height="100%" radiusX="{KSketchStyles.NUMBER_05}" radiusY="{KSketchStyles.NUMBER_05}">
<s:fill>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,9 @@
<s:DropShadowFilter
color="{KSketchStyles.COLOR_BLACK}" angle="{KSketchStyles.ANGLE_50}"
alpha="{KSketchStyles.ALPHA_06}"
strength="{KSketchStyles.NUMBER_02}"
blurX="{KSketchStyles.NUMBER_10}"
blurY="{KSketchStyles.NUMBER_10}"/>
strength="{KSketchStyles.NUMBER_01}"
blurX="{KSketchStyles.NUMBER_12}"
blurY="{KSketchStyles.NUMBER_12}"/>
</s:filters>
<s:Rect width="100%" height="100%" radiusX="{KSketchStyles.NUMBER_05}" radiusY="{KSketchStyles.NUMBER_05}">
<s:fill>
Expand Down Expand Up @@ -389,7 +389,7 @@
<s:layout>
<s:VerticalLayout paddingLeft="{KSketchStyles.NUMBER_10}" horizontalAlign="right"/>
</s:layout>
<s:Button id="closeButton" label="Close" click="close()" height="{KSketchStyles.NUMBER_25}"/>
<s:Button id="closeButton" label="Close" click="close()" height="{KSketchStyles.NUMBER_50}"/>
</s:Group>
</s:Group>
</s:SkinnablePopUpContainer>
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@
<s:DropShadowFilter
color="{KSketchStyles.COLOR_BLACK}" angle="{KSketchStyles.ANGLE_50}"
alpha="{KSketchStyles.ALPHA_06}"
strength="{KSketchStyles.NUMBER_02}"
blurX="{KSketchStyles.NUMBER_10}"
blurY="{KSketchStyles.NUMBER_10}"/>
strength="{KSketchStyles.NUMBER_01}"
blurX="{KSketchStyles.NUMBER_12}"
blurY="{KSketchStyles.NUMBER_12}"/>
</s:filters>
<s:Group id="overwriteSketch" visible="true">
<s:Rect width="100%" height="100%" radiusX="{KSketchStyles.NUMBER_05}" radiusY="{KSketchStyles.NUMBER_05}">
Expand All @@ -98,8 +98,8 @@
<s:layout>
<s:HorizontalLayout paddingLeft="{KSketchStyles.NUMBER_10}" horizontalAlign="right"/>
</s:layout>
<s:Button id="saveButton" label="Save Anyway" click="save()" height="{KSketchStyles.NUMBER_25}"/>
<s:Button id="cancelButton" label="Cancel" click="cancel()" height="{KSketchStyles.NUMBER_25}"/>
<s:Button id="saveButton" label="Save Anyway" click="save()" height="{KSketchStyles.NUMBER_50}"/>
<s:Button id="cancelButton" label="Cancel" click="cancel()" height="{KSketchStyles.NUMBER_50}"/>
</s:Group>
</s:Group>
</s:Group>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,9 +459,9 @@
<s:DropShadowFilter
color="{KSketchStyles.COLOR_BLACK}" angle="{KSketchStyles.ANGLE_50}"
alpha="{KSketchStyles.ALPHA_06}"
strength="{KSketchStyles.NUMBER_02}"
blurX="{KSketchStyles.NUMBER_10}"
blurY="{KSketchStyles.NUMBER_10}"/>
strength="{KSketchStyles.NUMBER_01}"
blurX="{KSketchStyles.NUMBER_12}"
blurY="{KSketchStyles.NUMBER_12}"/>
</s:filters>
<s:Rect width="100%" height="100%" radiusX="{KSketchStyles.NUMBER_05}" radiusY="{KSketchStyles.NUMBER_05}">
<s:fill>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@
private function initStyle():void {
this.removeEventListener(FlexEvent.INITIALIZE, initStyle);
header.setStyle("fontSize", KSketchStyles.DIALOG_BUTTON_HEADER);
title.setStyle("fontSize", KSketchStyles.DIALOG_BUTTON_NORMAL_FONT);
saveAsWarning.setStyle("fontSize", KSketchStyles.DIALOG_BUTTON_SMALL_FONT);
saveButton.setStyle("fontSize", KSketchStyles.DIALOG_BUTTON_SIZE);
discardButton.setStyle("fontSize", KSketchStyles.DIALOG_BUTTON_SIZE);
cancelButton.setStyle("fontSize", KSketchStyles.DIALOG_BUTTON_SIZE);
header.setStyle("fontSize", KSketchStyles.FONT_SIZE_26);
title.setStyle("fontSize", KSketchStyles.FONT_SIZE_18);
saveAsWarning.setStyle("fontSize", KSketchStyles.FONT_SIZE_14);
saveButton.setStyle("fontSize", KSketchStyles.FONT_SIZE_14);
discardButton.setStyle("fontSize", KSketchStyles.FONT_SIZE_14);
cancelButton.setStyle("fontSize", KSketchStyles.FONT_SIZE_14);
}
override public function open(owner:DisplayObjectContainer, modal:Boolean = false):void {
Expand Down Expand Up @@ -377,39 +377,39 @@
</fx:Script>
<s:filters>
<s:DropShadowFilter
color="{KSketchStyles.CANVAS_SHADOW_COLOR}" angle="{KSketchStyles.CANVAS_SHADOW_ANGLE}"
alpha="{KSketchStyles.CANVAS_SHADOW_ALPHA * 0.5}"
strength="{KSketchStyles.CANVAS_SHADOW_STRENGTH}"
blurX="{KSketchStyles.CANVAS_SHADOW_X_DISTANCE * 0.75}"
blurY="{KSketchStyles.CANVAS_SHADOW_Y_DISTANCE * 0.75}"/>
color="{KSketchStyles.COLOR_BLACK}" angle="{KSketchStyles.ANGLE_50}"
alpha="{KSketchStyles.ALPHA_06}"
strength="{KSketchStyles.NUMBER_01}"
blurX="{KSketchStyles.NUMBER_12}"
blurY="{KSketchStyles.NUMBER_12}"/>
</s:filters>
<s:Group id="saveNewSketch" visible="true">
<s:Rect id="saveBox" width="100%" height="100%" radiusX="{KSketchStyles.MENU_CORNER_RADIUS}" radiusY="{KSketchStyles.MENU_CORNER_RADIUS}">
<s:Rect width="100%" height="100%" radiusX="{KSketchStyles.NUMBER_05}" radiusY="{KSketchStyles.NUMBER_05}">
<s:fill>
<s:SolidColor color="{KSketchStyles.MENU_BACKGROUND_COLOR}"/>
<s:SolidColor color="{KSketchStyles.COLOR_GREY_MEDIUM}"/>
</s:fill>
</s:Rect>
<s:Group>
<s:layout>
<s:VerticalLayout gap="{KSketchStyles.DIALOG_PADDING_10}" paddingLeft="{KSketchStyles.DIALOG_PADDING_5}" paddingRight="{KSketchStyles.DIALOG_PADDING_5}" paddingTop="{KSketchStyles.DIALOG_PADDING_5}" paddingBottom="{KSketchStyles.DIALOG_PADDING_5}"/>
<s:VerticalLayout gap="{KSketchStyles.NUMBER_10}" paddingLeft="{KSketchStyles.NUMBER_05}" paddingRight="{KSketchStyles.NUMBER_05}" paddingTop="{KSketchStyles.NUMBER_05}" paddingBottom="{KSketchStyles.NUMBER_05}"/>
</s:layout>
<s:Label id="header" text="Save this sketch?"/>

<s:Group>
<s:layout>
<s:VerticalLayout paddingLeft="{KSketchStyles.DIALOG_PADDING_10}"/>
<s:VerticalLayout paddingLeft="{KSketchStyles.NUMBER_10}"/>
</s:layout>
<s:Label id="title" text="Sketch Name"/>
<s:TextArea id="sketchName" height="{KSketchStyles.DIALOG_MEASUREMENT_50}" width="{KSketchStyles.DIALOG_MEASUREMENT_300}"/>
<s:TextArea id="sketchName" height="{KSketchStyles.NUMBER_50}" width="{KSketchStyles.NUMBER_300}"/>
<s:Label id="saveAsWarning" text="A different filename will save this sketch as a new copy" visible="false"/>
</s:Group>
<s:Group width="100%">
<s:layout>
<s:HorizontalLayout gap="{KSketchStyles.DIALOG_PADDING_10}" horizontalAlign="right"/>
<s:HorizontalLayout gap="{KSketchStyles.NUMBER_10}" horizontalAlign="right"/>
</s:layout>
<s:Button id="saveButton" label="Save" click="save()" height="{KSketchStyles.DIALOG_MEASUREMENT_25}"/>
<s:Button id="discardButton" label="Discard" click="discardSketch()" height="{KSketchStyles.DIALOG_MEASUREMENT_25}"/>
<s:Button id="cancelButton" label="Cancel" click="cancel()" height="{KSketchStyles.DIALOG_MEASUREMENT_25}"/>
<s:Button id="saveButton" label="Save" click="save()" height="{KSketchStyles.NUMBER_50}"/>
<s:Button id="discardButton" label="Discard" click="discardSketch()" height="{KSketchStyles.NUMBER_50}"/>
<s:Button id="cancelButton" label="Cancel" click="cancel()" height="{KSketchStyles.NUMBER_50}"/>
</s:Group>
</s:Group>
</s:Group>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@
<s:DropShadowFilter
color="{KSketchStyles.COLOR_BLACK}" angle="{KSketchStyles.ANGLE_50}"
alpha="{KSketchStyles.ALPHA_06}"
strength="{KSketchStyles.NUMBER_02}"
blurX="{KSketchStyles.NUMBER_10}"
blurY="{KSketchStyles.NUMBER_10}"/>
strength="{KSketchStyles.NUMBER_01}"
blurX="{KSketchStyles.NUMBER_12}"
blurY="{KSketchStyles.NUMBER_12}"/>
</s:filters>
<s:Rect width="100%" height="100%" radiusX="{KSketchStyles.NUMBER_05}" radiusY="{KSketchStyles.NUMBER_05}">
<s:fill>
Expand Down Expand Up @@ -152,7 +152,7 @@
<s:layout>
<s:VerticalLayout paddingLeft="{KSketchStyles.NUMBER_10}" horizontalAlign="right"/>
</s:layout>
<s:Button id="closeButton" label="Close" click="close()" height="{KSketchStyles.NUMBER_25}"/>
<s:Button id="closeButton" label="Close" click="close()" height="{KSketchStyles.NUMBER_50}"/>
</s:Group>
</s:Group>
</s:SkinnablePopUpContainer>
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,9 @@
<s:DropShadowFilter
color="{KSketchStyles.COLOR_BLACK}" angle="{KSketchStyles.ANGLE_50}"
alpha="{KSketchStyles.ALPHA_06}"
strength="{KSketchStyles.NUMBER_02}"
blurX="{KSketchStyles.NUMBER_10}"
blurY="{KSketchStyles.NUMBER_10}"/>
strength="{KSketchStyles.NUMBER_01}"
blurX="{KSketchStyles.NUMBER_12}"
blurY="{KSketchStyles.NUMBER_12}"/>
</s:filters>
<s:Rect width="100%" height="100%" radiusX="{KSketchStyles.NUMBER_05}" radiusY="{KSketchStyles.NUMBER_05}">
<s:fill>
Expand All @@ -334,8 +334,8 @@
<s:HorizontalLayout paddingLeft="{KSketchStyles.NUMBER_10}" horizontalAlign="right"/>
</s:layout>

<s:Button id="syncWeb" label="Sync to Web" click="checkConnection()" height="{KSketchStyles.NUMBER_25}"/>
<s:Button id="discardAll" label="Discard all" click="discard()" height="{KSketchStyles.NUMBER_25}"/>
<s:Button id="syncWeb" label="Sync to Web" click="checkConnection()" height="{KSketchStyles.NUMBER_50}"/>
<s:Button id="discardAll" label="Discard all" click="discard()" height="{KSketchStyles.NUMBER_50}"/>

</s:Group>
</s:Group>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -531,13 +531,13 @@
private function scaleView():void
{
if(Capabilities.screenResolutionX > 1280 && Capabilities.screenResolutionY > 1500)
{
KSketchStyles.scale(2);
}
else if(Capabilities.screenResolutionX > 1280 && Capabilities.screenResolutionY < 1500)
KSketchStyles.setView();
if(Capabilities.screenResolutionX > 1024)
{
KSketchStyles.scale(2);
trace("init drawing stage");
drawing_stage.percentHeight = 80;
drawing_stage.width = drawing_stage.height/9*16;
}
}
Expand All @@ -553,9 +553,9 @@
<s:filters>
<s:DropShadowFilter color="{KSketchStyles.COLOR_BLACK}" angle="{KSketchStyles.ANGLE_50}"
alpha="{KSketchStyles.ALPHA_06}"
strength="{KSketchStyles.NUMBER_02}"
blurX="{KSketchStyles.NUMBER_10}"
blurY="{KSketchStyles.NUMBER_10}"/>
strength="{KSketchStyles.NUMBER_01}"
blurX="{KSketchStyles.NUMBER_12}"
blurY="{KSketchStyles.NUMBER_12}"/>
</s:filters>
<s:Rect width="100%" height="100%">
<s:fill>
Expand Down Expand Up @@ -629,7 +629,7 @@
<s:VerticalLayout horizontalAlign="center" verticalAlign="middle"/>
</s:layout>
<s:Group id="drawing_stage" height="92%" maxHeight="{Capabilities.screenResolutionX*0.7}"
width="{drawing_stage.height/10*16}">
width="{drawing_stage.height/9*16}">
<s:Rect width="100%" height="100%">
<s:fill>
<s:SolidColor color="{KSketchStyles.COLOR_WHITE}"/>
Expand All @@ -642,9 +642,9 @@
<s:DropShadowFilter
color="{KSketchStyles.COLOR_BLACK}" angle="{KSketchStyles.ANGLE_50}"
alpha="{KSketchStyles.ALPHA_06}"
strength="{KSketchStyles.NUMBER_02}"
blurX="{KSketchStyles.NUMBER_10}"
blurY="{KSketchStyles.NUMBER_10}"/>
strength="{KSketchStyles.NUMBER_01}"
blurX="{KSketchStyles.NUMBER_12}"
blurY="{KSketchStyles.NUMBER_12}"/>
</s:filters>
</s:Rect>
<!-- The model display displays the objects in the model -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
xmlns:buttons="sg.edu.smu.ksketch2.canvas.components.buttons.*"
xmlns:popup="sg.edu.smu.ksketch2.canvas.components.popup.*"
initialize="init(true)"
addedToStage="scaleView()"
destructionPolicy="auto"
>
<fx:Declarations>
Expand Down Expand Up @@ -93,6 +92,9 @@
private var itemRender:IFactory = new ClassFactory(KSketch_HomeView_IconItemRenderer);
private function init(isMobile:Boolean):void {
KSketchStyles.setView();
//Check for mobile version. Set false to export for Desktop version
if (isMobile) {
mainButtons.removeElementAt(2);
Expand Down Expand Up @@ -486,18 +488,6 @@
public function kSketchItemRendererFuntion(item:*):IFactory {
return itemRender;
}
private function scaleView():void
{
if(Capabilities.screenResolutionX > 1280 && Capabilities.screenResolutionY > 1500)
{
KSketchStyles.scale(2);
}
else if(Capabilities.screenResolutionX > 1280 && Capabilities.screenResolutionY < 1500)
{
KSketchStyles.scale(2);
}
}
]]>
</fx:Script>
<s:Group width="100%" height="100%">
Expand Down
Loading

0 comments on commit 20ece29

Please sign in to comment.