Skip to content

Commit

Permalink
Merge branch 'main' of github.com:leandroBorgesFerreira/Writeopia
Browse files Browse the repository at this point in the history
  • Loading branch information
CI Bot committed Feb 14, 2025
2 parents 7fd651c + 4647923 commit 8306b04
Show file tree
Hide file tree
Showing 29 changed files with 666 additions and 320 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.*
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
Expand Down Expand Up @@ -80,6 +84,7 @@ fun DesktopApp(
coroutineScope: CoroutineScope,
isUndoKeyEvent: (KeyEvent) -> Boolean,
selectColorTheme: (ColorThemeOption) -> Unit,
toggleMaxScreen: () -> Unit,
startDestination: String = startDestination(),
) {
val authCoreInjection = remember { KmpAuthCoreInjection() }
Expand Down Expand Up @@ -107,6 +112,7 @@ fun DesktopApp(
configurationInjector = notesInjector
)
}

val accountInjector = remember { AccountMenuKmpInjector(authCoreInjection) }

val notesMenuInjection = remember {
Expand Down Expand Up @@ -198,11 +204,16 @@ fun DesktopApp(
expandFolder = globalShellViewModel::expandFolder,
searchClick = globalShellViewModel::showSearch,
highlightContent = {},
changeIcon = globalShellViewModel::changeIcons
changeIcon = globalShellViewModel::changeIcons,
toggleMaxScreen = toggleMaxScreen
)

Column {
GlobalHeader(navigationController, globalShellViewModel.folderPath)
GlobalHeader(
navigationController,
globalShellViewModel.folderPath,
toggleMaxScreen
)

Box(
modifier = Modifier
Expand All @@ -220,7 +231,8 @@ fun DesktopApp(
navController = navigationController
) {}

val folderEdit = globalShellViewModel.editFolderState.collectAsState().value
val folderEdit =
globalShellViewModel.editFolderState.collectAsState().value

if (folderEdit != null) {
EditFileScreen(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.writeopia.notes.desktop.components

import androidx.compose.foundation.combinedClickable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
Expand All @@ -12,6 +14,7 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.font.FontWeight
Expand All @@ -25,10 +28,18 @@ import kotlinx.coroutines.flow.StateFlow
@Composable
fun GlobalHeader(
navigationController: NavHostController,
pathState: StateFlow<List<String>>
pathState: StateFlow<List<String>>,
toggleMaxScreen: () -> Unit,
) {
Row(
modifier = Modifier.fillMaxWidth().padding(6.dp),
modifier = Modifier.fillMaxWidth()
.padding(6.dp)
.combinedClickable(
interactionSource = remember { MutableInteractionSource() },
indication = null,
onDoubleClick = toggleMaxScreen,
onClick = {}
),
verticalAlignment = Alignment.CenterVertically
) {
Icon(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ suspend fun startApp(
selectColorTheme = {},
selectionState = MutableStateFlow(false),
keyboardEventFlow = MutableStateFlow(KeyboardEvent.IDLE),
toggleMaxScreen = {}
)
}
}

This file was deleted.

Loading

0 comments on commit 8306b04

Please sign in to comment.