fixed: HUD combobox

This commit is contained in:
daboe01
2026-01-18 14:43:28 +01:00
parent aa72c9e081
commit fbe4b3d439
2 changed files with 36 additions and 11 deletions
+5 -4
View File
@@ -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]
+31 -7
View File
@@ -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];