desktop: ellipsize long file names in the library list
This commit is contained in:
parent
5b4a111960
commit
e7610d3901
1 changed files with 4 additions and 1 deletions
|
|
@ -31,6 +31,7 @@ import androidx.compose.runtime.setValue
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import javax.swing.JFileChooser
|
import javax.swing.JFileChooser
|
||||||
|
|
||||||
|
|
@ -170,7 +171,9 @@ fun LibraryScreen(state: DesktopState) {
|
||||||
verticalAlignment = Alignment.CenterVertically) {
|
verticalAlignment = Alignment.CenterVertically) {
|
||||||
Column(Modifier.weight(1f)) {
|
Column(Modifier.weight(1f)) {
|
||||||
Text(e.file.nameWithoutExtension,
|
Text(e.file.nameWithoutExtension,
|
||||||
style = MaterialTheme.typography.titleSmall)
|
style = MaterialTheme.typography.titleSmall,
|
||||||
|
maxLines = 1,
|
||||||
|
overflow = TextOverflow.Ellipsis)
|
||||||
Text(
|
Text(
|
||||||
"%.1f MB • %s".format(
|
"%.1f MB • %s".format(
|
||||||
e.file.length() / 1e6,
|
e.file.length() / 1e6,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue