Skip to content

Commit

Permalink
Wire minimized mode in the ribbon demo
Browse files Browse the repository at this point in the history
For #56
  • Loading branch information
kirill-grouchnikov committed Jul 4, 2023
1 parent e0a43c9 commit 47522de
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,6 @@ class RibbonGalleryProjection(
}
}

class RibbonComponentProjection<out C : ContentModel, out P : PresentationModel>(
val projection: Projection<C, P>,
val ribbonComponentPresentationModel: RibbonComponentPresentationModel = RibbonComponentPresentationModel()
)

interface OnShowContextualMenuListener {
fun getContextualMenuContentModel(
ribbon: Ribbon,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ fun main() = auroraApplication {
)
)

var minimizedMode by remember { mutableStateOf(false) }
var contextualTaskGroup1Visible by remember { mutableStateOf(false) }
var contextualTaskGroup2Visible by remember { mutableStateOf(false) }

Expand All @@ -388,9 +389,11 @@ fun main() = auroraApplication {
taskbarElements = taskbarElements,
taskbarKeyTipPolicy = DefaultRibbonTaskbarKeyTipPolicy(),
anchoredCommands = builder.getAnchoredCommands(),
applicationMenuCommandButtonProjection = applicationMenuCommandButtonProjection
applicationMenuCommandButtonProjection = applicationMenuCommandButtonProjection,
isMinimized = minimizedMode
)

val vmf = MessageFormat(resourceBundle.getString("GroupVisibility.text"))
AuroraRibbonWindow(
skin = skin,
onCloseRequest = ::exitApplication,
Expand All @@ -408,7 +411,16 @@ fun main() = auroraApplication {
) {
CheckBoxProjection(
contentModel = SelectorContentModel(
text = "Group 1 visible",
text = resourceBundle.getString("Minimized.text"),
selected = minimizedMode,
onClick = {
minimizedMode = !minimizedMode
}
)
).project()
CheckBoxProjection(
contentModel = SelectorContentModel(
text = vmf.format(arrayOf("1")),
selected = contextualTaskGroup1Visible,
onClick = {
contextualTaskGroup1Visible = !contextualTaskGroup1Visible
Expand All @@ -417,7 +429,7 @@ fun main() = auroraApplication {
).project()
CheckBoxProjection(
contentModel = SelectorContentModel(
text = "Group 2 visible",
text = vmf.format(arrayOf("2")),
selected = contextualTaskGroup2Visible,
onClick = {
contextualTaskGroup2Visible = !contextualTaskGroup2Visible
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,3 +359,6 @@ Menu.help.helpCenter=Help Center
Menu.signIn=Sign In
Menu.syncAndSaveData=Sync and save data
Menu.managedBy=Managed by {0}
Minimized.text=Minimized mode
GroupVisibility.text=Group {0} visible
Original file line number Diff line number Diff line change
Expand Up @@ -355,3 +355,6 @@ Menu.help.helpCenter=\u05DE\u05E8\u05DB\u05D6 \u05E2\u05D6\u05E8\u05D4
Menu.signIn=\u05D4\u05D9\u05DB\u05E0\u05E1
Menu.syncAndSaveData=\u05E1\u05D9\u05E0\u05DB\u05E8\u05D5\u05DF \u05D5\u05E9\u05DE\u05D9\u05E8\u05EA \u05E0\u05EA\u05D5\u05E0\u05D9\u05DD
Menu.managedBy=\u05DE\u05E0\u05D5\u05D4\u05DC \u05E2\u05F4\u05D9 {0}
Minimized.text=\u05DE\u05E6\u05D1 \u05DE\u05DE\u05D5\u05D6\u05E2\u05E8
GroupVisibility.text=\u05E7\u05D1\u05D5\u05E6\u05D4 {0} \u05D2\u05DC\u05D5\u05D9\u05D4

0 comments on commit 47522de

Please sign in to comment.