Hi Prasanta,

This time I am sending you correction in diff format, because webrev.zip
with .js file inside is blocked by gmail filters.
I removed .js last time manually from webrev, but it should not be done
this way I think.

Please let me know if webrev.zip without .js is ok for you, because that`s
all I can do.
A year ago my sponsor uploaded webrev for me, cause I have no rights to do
it.

best regards,
Martin

po 1. 10. 2018 o 12:10 Prasanta Sadhukhan <prasanta.sadhuk...@oracle.com>
napísal(a):

> BTW, I saw that you have
> 379 , arrowButton.getPrefrredSize().width which will cause build failure.
> Did you actually build this code and test? Regards Prasanta
> On 01-Oct-18 11:24 AM, Prasanta Sadhukhan wrote:
>
> Thanks Martin. Can you please send the webrev in proper format like you
> did for 6490753 as in below?
>
> http://cr.openjdk.java.net/~alexsch/mraz.martin/6490753/webrev.00/
> Regards
> Prasanta
> On 29-Sep-18 1:53 AM, Martin M wrote:
>
> Hi Prasanta,
>
> As I understand, your solution sets default XPFillBorder to combobox in
> newer versions of windows except vista.
> But then animated native border is not visible in win7 or win10.
> I propose to add EmptyBorder 1px thick to see native border and calculate
> new size and position of arrow button.
>
> please see my attached webrev
>
> br,
> Martin
>
> pi 28. 9. 2018 o 6:27 Prasanta Sadhukhan <prasanta.sadhuk...@oracle.com>
> napísal(a):
>
>> Hi Martin,
>>
>> On 08-Sep-18 3:06 PM, Martin M wrote:
>>
>> Hi Prasanta,
>>
>> As far as I know, there are only 2 options in swing on windows.
>> WindowsLookAndFeel (includes XP theme, aero for Vista, Win7, Win10...) and
>> WindowsClassicLookAndFeel (includes classic theme for win95, win98).
>> The fix was done for WindowsLookAndFeel, so it affects not only Vista
>> version but also win7 aero and win10.
>>
>> I think that EmptyBorder(0,0,0,0) should be replaced by
>> EmptyBorder(1,1,1,1) to see animated native border and therefore
>> BasicComboboxEditor will not be placed over native border. But then
>> arrowbutton will be placed on wrong coordinates and also its size will not
>> be ok.
>> I will create webrev with needed changes.
>>
>> ok, but what is the problem with my webrev? The oldest supported platform
>> for jdk12, which is what my fix is targeted to, is windows 7 and the fix
>> seems to work for windows 7 and windows10 as far I have tested.
>> If you see any problem with my webrev, please let me know
>> or if you are ok, then please approve it
>> or if you still insist on sending your webrev, then please send it soon
>> as we are already 2 months since my webrev is out for review.
>>
>> Regards
>> Prasanta
>>
>> br,
>> Martin
>>
>> št 6. 9. 2018 o 19:34 Prasanta Sadhukhan <prasanta.sadhuk...@oracle.com>
>> napísal(a):
>>
>>> Ping? It's been a month.
>>>
>>> Even if JDK-6490753 fix is not only for Vista, but a portion of it
>>> [where I propose a fix] is causing issue in windows7, 10, so it is
>>> modified to make sure it works correctly in windows7-10. It will also
>>> not affect windows vista.
>>> Please provide comments on this.
>>>
>>> Regards
>>> Prasanta
>>> On 8/9/2018 3:09 PM, Prasanta Sadhukhan wrote:
>>> > Gentle reminder.
>>> >
>>> > I guess it's for vista as the bug description states it's for
>>> >
>>> > Vista Info:
>>> > ===========
>>> > Vista Build No: 5840
>>> > Vista Theme: Default Theme(Aero)
>>> >
>>> > Regards
>>> > Prasanta
>>> > On 8/2/2018 12:27 AM, Sergey Bylokhov wrote:
>>> >> Hi, Prasanta.
>>> >> I am not sure that previous fix[JDK-6490753] was implemented for
>>> >> Vista only.
>>> >> Maybe Martin (CC) can take a look to this?
>>> >>
>>> >> On 01/08/2018 10:11, Prasanta Sadhukhan wrote:
>>> >>> Hi All,
>>> >>>
>>> >>> Please review a fix for an issue where it is seen that combobox gets
>>> >>> an unwanted border around it.
>>> >>> This is a aftereffect of JDK-6490753
>>> >>> <https://bugs.openjdk.java.net/browse/JDK-6490753> where am empty
>>> >>> border is added to combobox to make it look like Vista native
>>> combobox.
>>> >>> Proposed fix is to make sure no empty border is drawn if windows
>>> >>> version is not vista.
>>> >>> Here's the combobox looks like before and after fix in windows 10
>>> >>> and 7.
>>> >>>
>>> >>> Before fix
>>> >>>
>>> >>> After Fix
>>> >>>
>>> >>> Bug: https://bugs.openjdk.java.net/browse/JDK-8203281
>>> >>> webrev: http://cr.openjdk.java.net/~psadhukhan/8203281/webrev.0/
>>> >>>
>>> >>> Regards
>>> >>> Prasanta
>>> >>
>>> >>
>>> >
>>>
>>>
>>
>
>
diff -r 8b02303915bc src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsComboBoxUI.java
--- a/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsComboBoxUI.java	Wed Sep 26 14:56:10 2018 -0400
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsComboBoxUI.java	Mon Oct 01 21:08:08 2018 +0200
@@ -154,7 +154,7 @@
             comboBox.addMouseListener(rolloverListener);
             arrowButton.addMouseListener(rolloverListener);
             // set empty border as default to see vista animated border
-            comboBox.setBorder(new EmptyBorder(0,0,0,0));
+            comboBox.setBorder(new EmptyBorder(1,1,1,1));
         }
     }
 
@@ -366,12 +366,20 @@
                 if (XPStyle.getXP() != null && arrowButton != null) {
                     Dimension d = parent.getSize();
                     Insets insets = getInsets();
-                    int buttonWidth = arrowButton.getPreferredSize().width;
+
+                    int borderInsetsCorrection = 0;
+                    if (((JComboBox)parent).getBorder() instanceof EmptyBorder) {
+                        borderInsetsCorrection = 1;
+                    }
                     arrowButton.setBounds(WindowsGraphicsUtils.isLeftToRight((JComboBox)parent)
-                                          ? (d.width - insets.right - buttonWidth)
-                                          : insets.left,
-                                          insets.top,
-                                          buttonWidth, d.height - insets.top - insets.bottom);
+                                ? (d.width - (insets.right - borderInsetsCorrection)
+                                    - arrowButton.getPreferredSize().width)
+                                : insets.left - borderInsetsCorrection
+                            , insets.top - borderInsetsCorrection
+                            , arrowButton.getPreferredSize().width
+                            , d.height
+                                - (insets.top - borderInsetsCorrection)
+                                - (insets.bottom - borderInsetsCorrection));
                 }
             }
         };
diff -r 8b02303915bc src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java
--- a/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java	Wed Sep 26 14:56:10 2018 -0400
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java	Mon Oct 01 21:08:08 2018 +0200
@@ -672,8 +672,8 @@
             "ComboBox.buttonHighlight", ControlHighlightColor,
             "ComboBox.selectionBackground", SelectionBackgroundColor,
             "ComboBox.selectionForeground", SelectionTextColor,
-            "ComboBox.editorBorder", new XPValue(new EmptyBorder(1,4,1,1),
-                                                 new EmptyBorder(1,4,1,4)),
+            "ComboBox.editorBorder", new XPValue(new EmptyBorder(1,3,1,1),
+                                                 new EmptyBorder(1,3,1,4)),
             "ComboBox.disabledBackground",
                         new XPColorValue(Part.CP_COMBOBOX, State.DISABLED,
                         Prop.FILLCOLOR, DisabledTextBackground),

Reply via email to