Skip to content

Commit

Permalink
Expose PopupProperties in PopupMenu (#531)
Browse files Browse the repository at this point in the history
* Expose PopupProperties in PopupMenu

* Add ui.api changes

---------

Co-authored-by: Francisco Noriega <[email protected]>
  • Loading branch information
francisconoriega and Francisco Noriega authored Aug 8, 2024
1 parent c7868b8 commit dca6945
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ui/api/ui.api
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ public final class org/jetbrains/jewel/ui/component/MenuItemState$Companion {
public final class org/jetbrains/jewel/ui/component/MenuKt {
public static final fun MenuSeparator (Landroidx/compose/ui/Modifier;Lorg/jetbrains/jewel/ui/component/styling/MenuItemMetrics;Lorg/jetbrains/jewel/ui/component/styling/MenuItemColors;Landroidx/compose/runtime/Composer;II)V
public static final fun MenuSubmenuItem (Landroidx/compose/ui/Modifier;ZZLjava/lang/String;Ljava/lang/Class;Landroidx/compose/foundation/interaction/MutableInteractionSource;Lorg/jetbrains/jewel/ui/component/styling/MenuStyle;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;II)V
public static final fun PopupMenu (Lkotlin/jvm/functions/Function1;Landroidx/compose/ui/Alignment$Horizontal;Landroidx/compose/ui/Modifier;Lorg/jetbrains/jewel/ui/component/styling/MenuStyle;Lkotlin/jvm/functions/Function1;Landroidx/compose/runtime/Composer;II)V
public static final fun PopupMenu (Lkotlin/jvm/functions/Function1;Landroidx/compose/ui/Alignment$Horizontal;Landroidx/compose/ui/Modifier;Lorg/jetbrains/jewel/ui/component/styling/MenuStyle;Landroidx/compose/ui/window/PopupProperties;Lkotlin/jvm/functions/Function1;Landroidx/compose/runtime/Composer;II)V
public static final fun items (Lorg/jetbrains/jewel/ui/component/MenuScope;ILkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;)V
public static final fun items (Lorg/jetbrains/jewel/ui/component/MenuScope;Ljava/util/List;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;)V
public static final fun separator (Lorg/jetbrains/jewel/ui/component/MenuScope;)V
Expand Down
3 changes: 2 additions & 1 deletion ui/src/main/kotlin/org/jetbrains/jewel/ui/component/Menu.kt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public fun PopupMenu(
horizontalAlignment: Alignment.Horizontal,
modifier: Modifier = Modifier,
style: MenuStyle = JewelTheme.menuStyle,
popupProperties: PopupProperties = PopupProperties(focusable = true),
content: MenuScope.() -> Unit,
) {
val density = LocalDensity.current
Expand All @@ -110,7 +111,7 @@ public fun PopupMenu(
Popup(
popupPositionProvider = popupPositionProvider,
onDismissRequest = { onDismissRequest(InputMode.Touch) },
properties = PopupProperties(focusable = true),
properties = popupProperties,
onPreviewKeyEvent = { false },
onKeyEvent = {
val currentFocusManager = checkNotNull(focusManager) { "FocusManager must not be null" }
Expand Down

0 comments on commit dca6945

Please sign in to comment.