MODEL : Fix feedback width/height for size adjustment. 98/20998/1
authornakyoung2.choi <nakyoung2.choi@samsung.com>
Wed, 14 May 2014 11:18:40 +0000 (20:18 +0900)
committernakyoung2.choi <nakyoung2.choi@samsung.com>
Wed, 14 May 2014 11:18:40 +0000 (20:18 +0900)
Change-Id: I7a17509bc4385190ec7821376ed692426fd0c8a2
Signed-off-by: nakyoung2.choi <nakyoung2.choi@samsung.com>
org.tizen.webuibuilder/res/descriptors/Tizen-web-ui-fw/widget/html.image.widget.xml
org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/editparts/HoverViewerEditPart.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/model/io/ModelSerializer.java

index e4a2bb3..6fc5729 100644 (file)
@@ -6,7 +6,7 @@
        description="This widget is a standard HTML widget."
        helpCategory="Tizen_Html"
        helpContents=""
-       feedbackHeight="100" feedbackWidth="100" borderVisible="true" feedbackCondition="src,width,height"
+       feedbackHeight="100" feedbackWidth="100" borderVisible="true" feedbackCondition="src"
        uiSelector="#%id%"
        xpath="//img">
 
index 20fbc67..5093a6d 100644 (file)
@@ -239,11 +239,11 @@ public class HoverViewerEditPart extends AbstractGraphicalEditPart implements IP
     @Override
     public void cssPropertyChanged(CssEvent event) {
         // called cssPropertyChanged(e) in HoverBrowserViewer()
+        ((HoverBrowserViewer) getViewer()).updateStyle();
         String key = event.getPropertyKey();
         if (key.equals(BuilderConstants.ATTRIBUTE_VALUE_WIDTH) || key.equals(BuilderConstants.ATTRIBUTE_VALUE_HEIGHT)) {
             ((HoverBrowserViewer) getViewer()).updateModel();
         }
-        ((HoverBrowserViewer) getViewer()).updateStyle();
     }
 
     @Override
index 613b1bd..24d623f 100644 (file)
@@ -61,7 +61,11 @@ public class ModelSerializer {
                 if (heightString != null && !heightString.isEmpty()) {
                     String widthString = descriptor.getFeedbackWidth();
                     String widthValue = BuilderConstants.EMPTY;
-                    if (widthString != null && !widthString.isEmpty()) {
+                    String widthStyle =
+                            part.getSelectorPropertyValue(part.getDefaultSelectorName(),
+                                                          BuilderConstants.ATTRIBUTE_VALUE_WIDTH);
+                    if (widthString != null && !widthString.isEmpty()
+                            && (widthStyle == null || widthStyle.isEmpty())) {
                         int width = Integer.valueOf(widthString);
                         widthValue =
                                 BuilderConstants.ATTRIBUTE_VALUE_WIDTH + BuilderConstants.COLON
@@ -69,11 +73,17 @@ public class ModelSerializer {
                                         + BuilderConstants.SEMICOLON;
                     }
 
-                    int height = Integer.valueOf(heightString).intValue();
-                    String value =
-                            widthValue + BuilderConstants.ATTRIBUTE_VALUE_HEIGHT
-                                    + BuilderConstants.COLON + height
-                                    + BuilderConstants.ATTRIBUTE_VALUE_PX;
+                    String heightStyle =
+                            part.getSelectorPropertyValue(part.getDefaultSelectorName(),
+                                                          BuilderConstants.ATTRIBUTE_VALUE_HEIGHT);
+                    String value = widthValue;
+                    if (heightStyle == null || heightStyle.isEmpty()) {
+                        int height = Integer.valueOf(heightString).intValue();
+                        value =
+                                widthValue + BuilderConstants.ATTRIBUTE_VALUE_HEIGHT
+                                        + BuilderConstants.COLON + height
+                                        + BuilderConstants.ATTRIBUTE_VALUE_PX;
+                    }
                     elem.setAttribute(BuilderConstants.ATTRIBUTE_STYLE, value);
 
                     Element textElem = doc.createElement(BuilderConstants.PART_TEXT);