From f4fc8cd91e4875700c101c63b65b32ae05ae382a Mon Sep 17 00:00:00 2001 From: parg Date: Fri, 20 Dec 2024 14:05:23 +0000 Subject: [PATCH] twoddling --- .../ui/skin/skin3_constants.properties | 2 ++ .../ui/swt/views/skin/sidebar/SideBar.java | 19 +++++++++++++++++++ .../views/skin/sidebar/SideBarEntrySWT.java | 14 ++++++++++---- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/uis/src/com/biglybt/ui/skin/skin3_constants.properties b/uis/src/com/biglybt/ui/skin/skin3_constants.properties index 26f2c0353f3..d50255384f2 100644 --- a/uis/src/com/biglybt/ui/skin/skin3_constants.properties +++ b/uis/src/com/biglybt/ui/skin/skin3_constants.properties @@ -112,8 +112,10 @@ color.sidebar.drag.bg=#d0deea color.sidebar.drag.fg=#2688aa color.sidebar.drag.bg._dark=COLOR_LIST_SELECTION color.sidebar.hover.bg=#d0deea +color.sidebar.hover.bg._windows._dark=#404040 color.sidebar.hover.bg._unix=#D0D0D0 color.sidebar.hover.bg._unix._dark=#113F4E +color.sidebar.hover.bg._mac._dark=#113F4E color.pieceview.alldone=BLUE.FADED.9 color.pieceview.notdone=#F0F0F0 diff --git a/uis/src/com/biglybt/ui/swt/views/skin/sidebar/SideBar.java b/uis/src/com/biglybt/ui/swt/views/skin/sidebar/SideBar.java index 3c571d3cf47..1d8b5b87180 100644 --- a/uis/src/com/biglybt/ui/swt/views/skin/sidebar/SideBar.java +++ b/uis/src/com/biglybt/ui/swt/views/skin/sidebar/SideBar.java @@ -912,6 +912,25 @@ public void handleEvent(final Event event) { return; } SideBarEntrySWT entry = (SideBarEntrySWT) treeItem.getData("MdiEntry"); + + if ( Constants.isOSX ){ + // need this as moving right-click menu from one + // entry to another doesn't result in any mouse move events + + if ( mousingOver != entry ){ + SideBarEntrySWT old = mousingOver; + + mousingOver = entry; + if ( old != null ){ + old.redraw(); + } + if ( entry != null ){ + + entry.redraw(); + } + } + } + if (entry != null ) { Point cursorLocation = tree.toControl(event.display.getCursorLocation()); if (lastCloseAreaClicked != null && lastCloseAreaClicked.contains(cursorLocation.x, cursorLocation.y)) { diff --git a/uis/src/com/biglybt/ui/swt/views/skin/sidebar/SideBarEntrySWT.java b/uis/src/com/biglybt/ui/swt/views/skin/sidebar/SideBarEntrySWT.java index a5a46bb23ff..b6405d7b3ea 100644 --- a/uis/src/com/biglybt/ui/swt/views/skin/sidebar/SideBarEntrySWT.java +++ b/uis/src/com/biglybt/ui/swt/views/skin/sidebar/SideBarEntrySWT.java @@ -650,7 +650,10 @@ protected void swt_paintSideBar(Event event) { if ( drawBounds.height > itemBounds.height ){ - itemBounds.height = drawBounds.height; + // -1 needed on parg's old test setup for some reason otherwise drag-over + // causes cheesing + + itemBounds.height = drawBounds.height-1; drawBounds = itemBounds; } @@ -1144,7 +1147,7 @@ protected Color swt_paintEntryBG(int detail, GC gc, Rectangle drawBounds) { boolean isDragging = sidebar.draggingOver == this; boolean isHovering = sidebar.mousingOver == this; - boolean hot = isHovering || (detail & SWT.HOT) > 0; + boolean hot = isHovering;// || (detail & SWT.HOT) > 0; if (selected) { attention_start = -1; }else{ @@ -1225,8 +1228,11 @@ protected Color swt_paintEntryBG(int detail, GC gc, Rectangle drawBounds) { if ( Utils.isDarkAppearanceNativeWindows()){ - c = Colors.getSystemColor( gc.getDevice(), isDragging?SWT.COLOR_WIDGET_NORMAL_SHADOW:SWT.COLOR_WIDGET_LIGHT_SHADOW ); - + if ( isDragging ){ + c = Colors.getSystemColor( gc.getDevice(), SWT.COLOR_WIDGET_NORMAL_SHADOW ); + }else{ + c = skin.getSkinProperties().getColor("color.sidebar.hover.bg"); + } }else{ if ( isDragging ){ c = skin.getSkinProperties().getColor("color.sidebar.drag.bg");