Added logo, title and placement to the window

main
Cemal Odabasioglu 2023-11-16 09:33:30 +01:00
parent 45f9385bc8
commit 93cce95884
2 changed files with 37 additions and 4 deletions

View File

@ -1,9 +1,8 @@
import androidx.compose.desktop.ui.tooling.preview.Preview import androidx.compose.desktop.ui.tooling.preview.Preview
import androidx.compose.foundation.hoverable
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember import androidx.compose.runtime.remember
import androidx.compose.ui.window.Window
import androidx.compose.ui.window.application
import androidx.compose.foundation.layout.* import androidx.compose.foundation.layout.*
import androidx.compose.material.* import androidx.compose.material.*
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
@ -14,13 +13,31 @@ import androidx.compose.material.icons.filled.Check
import androidx.compose.material.icons.filled.Close import androidx.compose.material.icons.filled.Close
import java.awt.FileDialog import java.awt.FileDialog
import java.awt.Frame import java.awt.Frame
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.drawscope.DrawScope
import androidx.compose.ui.unit.dp
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Button
import androidx.compose.material.MaterialTheme
import androidx.compose.material.lightColors
import androidx.compose.runtime.*
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.input.pointer.pointerMoveFilter
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.window.*
@OptIn(ExperimentalComposeUiApi::class)
@Composable @Composable
fun HomePage( fun HomePage(
onGlossaireClick: () -> Unit, onGlossaireClick: () -> Unit,
onCodeAVerifierClick: () -> Unit onCodeAVerifierClick: () -> Unit
) { ) {
var isHover by remember { mutableStateOf(false) }
Column( Column(
modifier = Modifier.fillMaxSize(), modifier = Modifier.fillMaxSize(),
verticalArrangement = Arrangement.Center, verticalArrangement = Arrangement.Center,
@ -34,7 +51,9 @@ fun HomePage(
Row( Row(
horizontalArrangement = Arrangement.spacedBy(16.dp) horizontalArrangement = Arrangement.spacedBy(16.dp)
) { ) {
Button(onClick = onGlossaireClick) { Button(
onClick = onGlossaireClick
) {
Text("Glossaire") Text("Glossaire")
} }
@ -334,7 +353,21 @@ fun FormulairePage(onAnnulerClick: () -> Unit) {
} }
fun main() = application { fun main() = application {
Window(onCloseRequest = ::exitApplication) { val state = rememberWindowState(
placement = WindowPlacement.Floating,
position = WindowPosition(Alignment.Center),
isMinimized = false,
width = 800.dp,
height = 600.dp
)
Window(
title = "Quali'Nomme",
resizable = true,
state = state,
icon = painterResource("assets/logo/logo.png"),
onCloseRequest = ::exitApplication
) {
App() App()
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB