-
Notifications
You must be signed in to change notification settings - Fork 5.7k
[JEWEL-954] Implement ad text in popups #3358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[JEWEL-954] Implement ad text in popups #3358
Conversation
platform/jewel/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/PopupContainer.kt
Outdated
Show resolved
Hide resolved
b0a454a to
9ecf162
Compare
faogustavo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that you are missing the LaF styles loading. Also, make sure to get values to match the theme.
For more details in the AdText styles, check the JBUI.CurrentTheme.Advertiser type. You can find its usage to use as baseline on this function public void setAdText(@NotNull @NlsContexts.PopupAdvertisement String s, int alignment)
4356525 to
c4d0b61
Compare
...el/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/theme/IntUiBridgePopupAdText.kt
Outdated
Show resolved
Hide resolved
...el/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/theme/IntUiBridgePopupAdText.kt
Outdated
Show resolved
Hide resolved
c4d0b61 to
91fba7f
Compare
ecf2915 to
20db336
Compare
faogustavo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to update API Dumps after updating public apis. Run the 'apiChecks' task in the IDE for it :)
...lone/src/main/kotlin/org/jetbrains/jewel/intui/standalone/styling/IntUiPopupAdTextStyling.kt
Outdated
Show resolved
Hide resolved
...i/int-ui-standalone/src/main/kotlin/org/jetbrains/jewel/intui/standalone/theme/IntUiTheme.kt
Outdated
Show resolved
Hide resolved
20db336 to
259bd6b
Compare
...i/int-ui-standalone/src/main/kotlin/org/jetbrains/jewel/intui/standalone/theme/IntUiTheme.kt
Show resolved
Hide resolved
platform/jewel/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/ComboBox.kt
Show resolved
Hide resolved
platform/jewel/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/ListComboBox.kt
Show resolved
Hide resolved
platform/jewel/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/PopupContainer.kt
Show resolved
Hide resolved
platform/jewel/ui/src/main/kotlin/org/jetbrains/jewel/ui/DefaultComponentStyling.kt
Outdated
Show resolved
Hide resolved
779db91 to
60a6e3f
Compare
faogustavo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
platform/jewel/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/PopupAdText.kt
Outdated
Show resolved
Hide resolved
platform/jewel/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/ComboBox.kt
Outdated
Show resolved
Hide resolved
platform/jewel/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/PopupContainer.kt
Outdated
Show resolved
Hide resolved
60a6e3f to
932f1b6
Compare
platform/jewel/ui/src/main/kotlin/org/jetbrains/jewel/ui/DefaultComponentStyling.kt
Outdated
Show resolved
Hide resolved
platform/jewel/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/styling/PopupAdStyle.kt
Outdated
Show resolved
Hide resolved
932f1b6 to
2d55cab
Compare
platform/jewel/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/Menu.kt
Show resolved
Hide resolved
platform/jewel/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/PopupAd.kt
Show resolved
Hide resolved
2d55cab to
5df0e71
Compare
platform/jewel/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/PopupContainer.kt
Show resolved
Hide resolved
1d5e506 to
68e45ea
Compare
platform/jewel/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/Menu.kt
Show resolved
Hide resolved
faogustavo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one minor comment. No blockers
.../jewel/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/theme/IntUiBridgePopupAd.kt
Show resolved
Hide resolved
platform/jewel/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/PopupContainer.kt
Show resolved
Hide resolved
68e45ea to
0f276f5
Compare
0f276f5 to
a0ba6e9
Compare
Summary
This PR introduces a new component called
PopupAd, which is designed to be used inside a popup container to give a more informative description to that menu. To use that, you can pass a composable to theadContentparameter introduced to theMenuandPopupContainerpublic API. This API is designed to be simpler as we have inAbstractPopup#setAdTextmethod in the legacy Swing implementation, but in a "composey" way.Additionally, a new
Menussection was introduced to the sample app to showcase menus, including a dedicated sample for menu with ad content.Release notes
PopupAdcomponentPopupAdStyleto theJewelThemeand to theIntUiThemeadContentparameter toPopupContainerandMenucomponents.New features
Note
Adds a bottom "ad" area to popups with a new component and theme styling.
PopupAdcomponent and styling types:PopupAdStyle,PopupAdColors,PopupAdMetrics; exposed viaJewelTheme.popupAdStylePopupMenuandPopupContainergain optionaladContentslot (new overloads); internal menu layout updated to render itDefaultComponentStylingextended withpopupAdStyle;IntUiTheme/JewelThemeupdated to provide/consume itreadPopupAdStyle()and suppliespopupAdStylePopupAddefaultsMenussection (icons +Menus.kt) demonstrating basic, icons, submenus, and ad contentWritten by Cursor Bugbot for commit a0ba6e9. This will update automatically on new commits. Configure here.