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/03/29 22:54:09 UTC

[GitHub] [netbeans] eirikbakke commented on a change in pull request #2051: [NETBEANS-3428] FlatLaf: hover in multi-tabs

eirikbakke commented on a change in pull request #2051: [NETBEANS-3428] FlatLaf: hover in multi-tabs
URL: https://github.com/apache/netbeans/pull/2051#discussion_r399865952
 
 

 ##########
 File path: platform/core.multitabs/src/org/netbeans/core/multitabs/impl/TabTableUI.java
 ##########
 @@ -173,6 +193,28 @@ public void mouseDragged( MouseEvent e ) {
             @Override
             public void mouseMoved( MouseEvent e ) {
                 orig.mouseMoved( e );
+
+                if (hoverSupport) {
+                    Point p = e.getPoint();
+                    int row = table.rowAtPoint( p );
+                    int column = table.columnAtPoint( p );
+                    setHover(row, column);
+                }
+            }
+
+            private void setHover( int row, int column ) {
+                if (row == hoverRow && column == hoverColumn) {
+                    return;
+                }
+
+                if (hoverRow != -1 && hoverColumn != -1) {
+                    table.repaint(table.getCellRect(hoverRow, hoverColumn, true));
+                }
+                if (row != -1 && column != -1) {
+                    table.repaint(table.getCellRect(row, column, true));
+                }
+                hoverRow = row;
+                hoverColumn = column;
 
 Review comment:
   Don't you need to set these _before_ calling repaint? The repaint typically ends up being scheduled for later, but it's cleaner to not assume this.

----------------------------------------------------------------
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