Skip to content

Commit

Permalink
Move the keytip layer to cover the whole ribbon window
Browse files Browse the repository at this point in the history
For #56
  • Loading branch information
kirill-grouchnikov committed Sep 22, 2023
1 parent 130ece4 commit cfe5603
Showing 1 changed file with 48 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -603,62 +603,64 @@ private fun AuroraWindowScope.RibbonWindowInnerContent(
val ribbonSelectedButtonTopLeftOffset = remember { RibbonOffset(0.0f, 0.0f) }
val ribbonSelectedButtonSize = remember { mutableStateOf(IntSize(0, 0)) }

Column(Modifier.fillMaxSize()) {
RibbonBox(Modifier.fillMaxWidth()) {
Column(Modifier.fillMaxWidth().ribbonContextMenu(ribbon)) {
RibbonWindowTitlePane(
title, icon, iconFilterStrategy, ribbon, contextualTaskGroupSpans,
windowTitlePaneConfiguration
)
AuroraDecorationArea(decorationAreaType = DecorationAreaType.Header) {
CompositionLocalProvider(
LocalRibbonTrackBounds provides true,
LocalRibbonTrackKeyTips provides true
) {
Column(Modifier.fillMaxWidth().auroraBackground()) {
RibbonPrimaryBar(
modifier = Modifier.ribbonElementLocator(
ribbonPrimaryBarTopLeftOffset,
ribbonPrimaryBarSize
),
ribbon = ribbon,
onContextualTaskGroupSpansUpdated = {
if (!areSpansSame(contextualTaskGroupSpans, it)) {
contextualTaskGroupSpans.clear()
contextualTaskGroupSpans.addAll(it)
}
},
selectedTaskButtonModifier = Modifier.ribbonElementLocator(
ribbonSelectedButtonTopLeftOffset,
ribbonSelectedButtonSize
),
showSelectedTaskInPopup = showSelectedTaskInPopup,
onUpdateShowSelectedTaskInPopup = {
if (ribbon.isMinimized) {
showSelectedTaskInPopup = it
Box(Modifier.fillMaxSize()) {
Column(Modifier.fillMaxSize()) {
RibbonBox(Modifier.fillMaxWidth()) {
Column(Modifier.fillMaxWidth().ribbonContextMenu(ribbon)) {
RibbonWindowTitlePane(
title, icon, iconFilterStrategy, ribbon, contextualTaskGroupSpans,
windowTitlePaneConfiguration
)
AuroraDecorationArea(decorationAreaType = DecorationAreaType.Header) {
CompositionLocalProvider(
LocalRibbonTrackBounds provides true,
LocalRibbonTrackKeyTips provides true
) {
Column(Modifier.fillMaxWidth().auroraBackground()) {
RibbonPrimaryBar(
modifier = Modifier.ribbonElementLocator(
ribbonPrimaryBarTopLeftOffset,
ribbonPrimaryBarSize
),
ribbon = ribbon,
onContextualTaskGroupSpansUpdated = {
if (!areSpansSame(contextualTaskGroupSpans, it)) {
contextualTaskGroupSpans.clear()
contextualTaskGroupSpans.addAll(it)
}
},
selectedTaskButtonModifier = Modifier.ribbonElementLocator(
ribbonSelectedButtonTopLeftOffset,
ribbonSelectedButtonSize
),
showSelectedTaskInPopup = showSelectedTaskInPopup,
onUpdateShowSelectedTaskInPopup = {
if (ribbon.isMinimized) {
showSelectedTaskInPopup = it
}
}
)

if (!ribbon.isMinimized) {
RibbonBands(ribbonTask = selectedTask)
}
)

if (!ribbon.isMinimized) {
RibbonBands(ribbonTask = selectedTask)
Spacer(modifier = Modifier.fillMaxWidth().height(1.dp))
}

Spacer(modifier = Modifier.fillMaxWidth().height(1.dp))
}
}
}
RibbonOverlay(Modifier, DecoratedBorderThickness)
}
RibbonOverlay(Modifier, DecoratedBorderThickness)
RibbonKeyTipOverlay(Modifier, DecoratedBorderThickness)
}
Box(modifier = Modifier.fillMaxWidth().weight(1.0f)) {
// Wrap the entire content in NONE decoration area. App code can set its
// own decoration area types on specific parts.
AuroraDecorationArea(decorationAreaType = DecorationAreaType.None) {
content()
Box(modifier = Modifier.fillMaxWidth().weight(1.0f)) {
// Wrap the entire content in NONE decoration area. App code can set its
// own decoration area types on specific parts.
AuroraDecorationArea(decorationAreaType = DecorationAreaType.None) {
content()
}
}
}
RibbonKeyTipOverlay(Modifier.fillMaxSize(), DecoratedBorderThickness)
}

val density = LocalDensity.current
Expand Down

0 comments on commit cfe5603

Please sign in to comment.