From fbe4b3d439aa10c2ab800cd4dbb6a1c3ef193c32 Mon Sep 17 00:00:00 2001 From: daboe01 Date: Sun, 18 Jan 2026 14:43:28 +0100 Subject: [PATCH] fixed: HUD combobox --- AppKit/Themes/Aristo3/ThemeDescriptors.j | 9 +++--- AppKit/_CPPopUpList.j | 38 +++++++++++++++++++----- 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/AppKit/Themes/Aristo3/ThemeDescriptors.j b/AppKit/Themes/Aristo3/ThemeDescriptors.j index 7d67dbc13..57d50ceb0 100644 --- a/AppKit/Themes/Aristo3/ThemeDescriptors.j +++ b/AppKit/Themes/Aristo3/ThemeDescriptors.j @@ -8681,9 +8681,11 @@ var themedButtonValues = nil, } size:CGSizeMake(40, 24)], + // Define the HUD Window style (The container) + // Dark background (95% opaque black) + Light Gray Border (30% opaque white) menuWindowPopUpBackgroundStyleColorHUD = [CPColor colorWithCSSDictionary:@{ - @"background-color": @"rgba(30, 30, 30, 0.95)", // Dark background - @"border-color": @"rgba(255, 255, 255, 0.3)", // Light border + @"background-color": @"rgba(30, 30, 30, 0.95)", + @"border-color": @"rgba(255, 255, 255, 0.3)", @"border-style": @"solid", @"border-width": @"1px", @"border-radius": @"6px", @@ -8691,7 +8693,6 @@ var themedButtonValues = nil, @"box-sizing": @"border-box" }], - // Placeholder generic icons generalIconNew = [CPImage imageWithCSSDictionary:@{"background-color": A3ColorActiveText} size:CGSizeMake(16,16)], menuWindowPopUpBackgroundStyleColor = [CPColor colorWithCSSDictionary:@{ @@ -8775,8 +8776,8 @@ var themedButtonValues = nil, [@"menu-general-icon-new", generalIconNew], - // HUD [@"menu-window-pop-up-background-style-color", menuWindowPopUpBackgroundStyleColorHUD, CPThemeStateHUD], + [@"menu-bar-text-color", [CPColor whiteColor], CPThemeStateHUD], [@"menu-window-more-above-image", menuWindowMoreAboveImageHUD, CPThemeStateHUD], [@"menu-window-more-below-image", menuWindowMoreBelowImageHUD, CPThemeStateHUD] diff --git a/AppKit/_CPPopUpList.j b/AppKit/_CPPopUpList.j index 014ddcb97..603cafcd2 100644 --- a/AppKit/_CPPopUpList.j +++ b/AppKit/_CPPopUpList.j @@ -248,9 +248,9 @@ var ListColumnIdentifier = @"1"; [[_panel contentView] addSubview:_scrollView]; [_panel setInitialFirstResponder:_tableView]; - // fixme: this really should be properly themed + // Ensure table is transparent in HUD mode so Panel background shows through if ([_dataSource respondsToSelector:@selector(hasThemeState:)] && [_dataSource hasThemeState:CPThemeStateHUD]) - [_tableView setBackgroundColor:[CPColor blackColor]]; + [_tableView setBackgroundColor:[CPColor clearColor]]; if ([_dataSource numberOfItemsInList:self] > 0) [_tableView selectRowIndexes:[CPIndexSet indexSetWithIndex:0] byExtendingSelection:NO]; @@ -268,17 +268,36 @@ var ListColumnIdentifier = @"1"; { var panel = [[_CPPopUpPanel alloc] initWithContentRect:aFrame styleMask:CPBorderlessWindowMask]; - // Check if the data source (e.g. CPComboBox) is in HUD mode. - // hack to set the HUD background mask to the panel but using the standard WindowView class (not the HUD one). + // HUD Theme Styling if ([_dataSource respondsToSelector:@selector(hasThemeState:)] && [_dataSource hasThemeState:CPThemeStateHUD]) + { + // hack to set the HUD background mask to the panel but using the standard WindowView class (not the HUD one). panel._styleMask |= CPHUDBackgroundWindowMask; + // Create the custom HUD background with dark fill, light border, and shadow + var hudBackgroundColor = [CPColor colorWithCSSDictionary:@{ + @"background-color": @"rgba(30, 30, 30, 0.95)", + @"border-color": @"rgba(255, 255, 255, 0.3)", + @"border-style": @"solid", + @"border-width": @"1px", + @"border-radius": @"6px", + @"box-shadow": @"0 5px 15px rgba(0,0,0,0.6)", + @"box-sizing": @"border-box" + }]; + + [panel setBackgroundColor:hudBackgroundColor]; + } + else + { + // Standard Styling + [panel setHasShadow:YES]; + [panel setShadowStyle:CPMenuWindowShadowStyle]; + } + [panel setTitle:@""]; [panel setFloatingPanel:YES]; [panel setBecomesKeyOnlyIfNeeded:YES]; [panel setLevel:CPPopUpMenuWindowLevel]; - [panel setHasShadow:YES]; - [panel setShadowStyle:CPMenuWindowShadowStyle]; [panel setDelegate:self]; return panel; @@ -322,7 +341,12 @@ var ListColumnIdentifier = @"1"; { var scroll = [[CPScrollView alloc] initWithFrame:aFrame]; - [scroll setBorderType:CPLineBorder]; + // Remove border for HUD to avoid double borders (Window Border + ScrollView Border) + if ([_dataSource respondsToSelector:@selector(hasThemeState:)] && [_dataSource hasThemeState:CPThemeStateHUD]) + [scroll setBorderType:CPNoBorder]; + else + [scroll setBorderType:CPLineBorder]; + [scroll setAutohidesScrollers:NO]; [scroll setHasVerticalScroller:YES]; [scroll setHasHorizontalScroller:NO];