Skip to content

Commit

Permalink
extent to titlebar on macos
Browse files Browse the repository at this point in the history
  • Loading branch information
Tlaster committed Jan 2, 2025
1 parent d6364b2 commit cffa869
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
1 change: 1 addition & 0 deletions desktopApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ dependencies {
implementation(libs.ksoup)
implementation(platform(libs.koin.bom))
implementation(libs.koin.core)
implementation(libs.commons.lang3)
}

compose.desktop {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,23 @@ package dev.dimension.flare.ui.theme
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.ui.Modifier
import androidx.compose.ui.window.WindowScope
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.FrameWindowScope
import com.konyaco.fluent.ExperimentalFluentApi
import com.konyaco.fluent.FluentTheme
import com.konyaco.fluent.darkColors
import com.konyaco.fluent.lightColors
import com.mayakapps.compose.windowstyler.WindowFrameStyle
import com.mayakapps.compose.windowstyler.WindowStyleManager
import org.apache.commons.lang3.SystemUtils

@OptIn(ExperimentalFluentApi::class)
@Composable
internal fun WindowScope.FlareTheme(
internal fun FrameWindowScope.FlareTheme(
isDarkTheme: Boolean,
content: @Composable () -> Unit,
) {
Expand All @@ -40,11 +43,27 @@ internal fun WindowScope.FlareTheme(
),
)
}
if (SystemUtils.IS_OS_MAC) {
LaunchedEffect(window) {
window.rootPane.apply {
rootPane.putClientProperty("apple.awt.fullWindowContent", true)
rootPane.putClientProperty("apple.awt.transparentTitleBar", true)
rootPane.putClientProperty("apple.awt.windowTitleVisible", false)
}
}
}
Box(
modifier =
Modifier
.fillMaxSize()
.background(FluentTheme.colors.background.mica.base),
.background(FluentTheme.colors.background.mica.base)
.let {
if (SystemUtils.IS_OS_MAC) {
it.padding(top = 24.dp)
} else {
it
}
},
) {
content.invoke()
}
Expand Down

0 comments on commit cffa869

Please sign in to comment.