You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2020/01/11 19:26:03 UTC

[GitHub] [netbeans] eirikbakke commented on a change in pull request #1858: [NETBEANS-3428] Update FlatLaf from 0.23 to 0.24 and other fixes

eirikbakke commented on a change in pull request #1858: [NETBEANS-3428] Update FlatLaf from 0.23 to 0.24 and other fixes
URL: https://github.com/apache/netbeans/pull/1858#discussion_r365537645
 
 

 ##########
 File path: platform/openide.explorer/src/org/openide/explorer/view/OutlineView.java
 ##########
 @@ -269,24 +269,28 @@ public void keyReleased(KeyEvent e) {
             defaultTreeActionListener, KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0, false), JComponent.WHEN_FOCUSED
         );
 
-        final Color focusSelectionBackground = outline.getSelectionBackground();
-        final Color focusSelectionForeground = outline.getSelectionForeground();
-        outline.addFocusListener(new java.awt.event.FocusListener(){
-            @Override
-            public void focusGained(java.awt.event.FocusEvent ev) {
-                outline.setSelectionBackground(focusSelectionBackground);
-                outline.setSelectionForeground(focusSelectionForeground);
-            }
+        // toggle selection colors depending on whether table is focused or not
+        if (!UIManager.getLookAndFeel().getID().startsWith("FlatLaf")) {
 
 Review comment:
   The diff is a bit confusing here. Is this just skipping a bunch of code for the FlatLaf case?
   
   Why is the code not needed for FlatLaf? Shouldn't something rather be done so that focusSelectionBackground/focusSelectionForeground ends up being the right color?
   
   (If I remember correctly, there might very well be some bugs in OutlineView around this code; I implemented workarounds in my NetBeans Platform application many years ago. If the changes suggested here are really workarounds for bugs, then maybe the bugs should be fixed instead.)
   
   Maybe add a copy of the isFlatLaf() method for consistency with HtmlLabelUI. That will make it easier to grep for duplicated logic in the future.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists