[SRADA-74] Fixed blinking tab button issue
authordongkyu6 lee <dongkyu6.lee@samsung.com>
Mon, 22 Feb 2016 05:46:31 +0000 (14:46 +0900)
committerdongkyu6 lee <dongkyu6.lee@samsung.com>
Mon, 22 Feb 2016 05:46:31 +0000 (14:46 +0900)
Blinking tab button when "mouse enter" and "mouse exit" events are occured

Change-Id: Ic634ae561e82a2608d41186b825b6c4f0880ccd5
Signed-off-by: dongkyu6 lee <dongkyu6.lee@samsung.com>
org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/widgets/da/view/DATabButton.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/button/DACustomButton.java [changed mode: 0644->0755]

index 109f69c..ef05cca 100755 (executable)
@@ -56,7 +56,8 @@ public class DATabButton extends DACustomButton {
                                ColorResources.TAB_NORMAL_COLOR_START,
                                ColorResources.TAB_NORMAL_COLOR_START,
                                ColorResources.TAB_SELECTED_COLOR_START,
-                               ColorResources.TAB_SELECTED_COLOR_START);
+                               ColorResources.TAB_SELECTED_COLOR_START,
+                               true);
                if(isImageTab) {
                        this.setImages(ImageResources.TAB_NORMAL,
                                ImageResources.TAB_SELECTED,
old mode 100644 (file)
new mode 100755 (executable)
index 4c1e70d..dd49bd6
@@ -61,6 +61,8 @@ public class DACustomButton extends Canvas {
        protected DACustomButtonAttribute attr;
        protected IDACustomButtonRenderer buttonRenderer = null;
 
+       private boolean isTapbutton = false;
+
        /**
         * Constructs a new instance of this class given its parent and style value
         * describing its behavior and appearance.
@@ -190,6 +192,47 @@ public class DACustomButton extends Canvas {
        }
 
        /**
+        * Construct a new instance of this class. it makes gradation button.
+        * 
+        * @param parent
+        *            a composite control which will be the parent of the new
+        *            instance (cannot be bull)
+        * @param normalStart
+        *            the start color of normal state gradation
+        * @param normalEnd
+        *            the end color of normal state gradation
+        * @param pushStart
+        *            the start color of push state gradation
+        * @param pushEnd
+        *            the end color of push state gradation
+        * @param hoverStart
+        *            the start color of hover state gradation
+        * @param hoverEnd
+        *            the end color of hover state gradation
+        * @param disableStart
+        *            the start color of disable state gradation
+        * @param disableEnd
+        *            the end color of disable state gradation
+        * @param istapbutton
+        *            check tap button
+        */
+       public DACustomButton(Composite parent, Color normalStart, Color normalEnd,
+                       Color pushStart, Color pushEnd, Color hoverStart, Color hoverEnd,
+                       Color disableStart, Color disableEnd, boolean istapbutton) {
+               this(parent, SWT.NONE);
+               attr.setColor(0, normalStart);
+               attr.setColor(1, normalEnd);
+               attr.setColor(2, pushStart);
+               attr.setColor(3, pushEnd);
+               attr.setColor(4, hoverStart);
+               attr.setColor(5, hoverEnd);
+               attr.setColor(6, disableStart);
+               attr.setColor(7, disableEnd);
+               attr.setDrawType(TYPE_GRADATION);
+               isTapbutton = istapbutton;
+       }
+
+       /**
         * add mouse listeners - enter, exit, mouse down, mouse up
         */
        protected void addListeners() {
@@ -218,11 +261,11 @@ public class DACustomButton extends Canvas {
                                return;
                        }
 
-                       if (event.type == SWT.MouseEnter) {
+                       if (event.type == SWT.MouseEnter && isTapbutton == false) {
                                changeButtonState(STATE_HOVER);
                        }
 
-                       if (event.type == SWT.MouseExit) {
+                       if (event.type == SWT.MouseExit && isTapbutton == false) {
                                changeButtonState(STATE_NORMAL);
                        }