mirror of
https://github.com/praktimarc/kst4contest.git
synced 2026-10-26 16:15:51 +01:00
The cluster and QSO monitor split its two tables at half the height, fixed: the Compose port had left the JavaFX SplitPane out until a splitter existed. SplitterPane exists now, so the monitor uses it and reads and writes the same profile value the SplitPane did (GUIpnl_directedMSGWin_dividerpositionDefault, default 0.8), so a profile gets its old position back. Each heading now sits in the pane of its table, and the "DX cluster" heading is translated (monitor.dxCluster). Fixes #144. Claude-Session: https://claude.ai/code/session_01AaorTymXfkXPm8yb4Btva7 Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
d38b385166
commit
4642d658a3
5 files changed
+76
-28
No files matched your search
@@ -4,7 +4,6 @@ import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material3.HorizontalDivider
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
@@ -17,10 +16,11 @@ import kst4contest.model.ClusterMessage
|
||||
/**
|
||||
* The cluster and QSO monitor.
|
||||
*
|
||||
* Two live tables, one above the other. This is the first window in which the table
|
||||
* carries data that changes while the operator watches, which is why the row identity
|
||||
* rules in DataTableState matter here and not in the settings window: in Etappe 2 the
|
||||
* visible defects all came from that coupling, not from the table itself.
|
||||
* Two live tables, one above the other, with a divider the operator can drag. This
|
||||
* is the first window in which the table carries data that changes while the operator
|
||||
* watches, which is why the row identity rules in DataTableState matter here and not in
|
||||
* the settings window: in Etappe 2 the visible defects all came from that coupling, not
|
||||
* from the table itself.
|
||||
*/
|
||||
object MonitorWindow {
|
||||
|
||||
@@ -44,6 +44,8 @@ object MonitorWindow {
|
||||
fun show(
|
||||
clusterTable: DataTableState<ClusterMessage>,
|
||||
qsoTable: DataTableState<ChatMessage>,
|
||||
/** The divider between the two tables, remembered in the profile (#144). */
|
||||
splitter: SplitterState,
|
||||
darkMode: Boolean,
|
||||
baseFontSizeSp: Float,
|
||||
/**
|
||||
@@ -70,7 +72,7 @@ object MonitorWindow {
|
||||
heightDp = heightDp,
|
||||
onResized = onResized,
|
||||
) { _ ->
|
||||
MonitorContent(clusterTable, qsoTable)
|
||||
MonitorContent(clusterTable, qsoTable, splitter)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -80,29 +82,31 @@ object MonitorWindow {
|
||||
internal fun MonitorContent(
|
||||
clusterTable: DataTableState<ClusterMessage>,
|
||||
qsoTable: DataTableState<ChatMessage>,
|
||||
splitter: SplitterState,
|
||||
) {
|
||||
val strings = kst4contest.view.i18n.LocalStrings.current
|
||||
|
||||
Surface(modifier = Modifier.fillMaxSize()) {
|
||||
Column(modifier = Modifier.fillMaxSize().padding(4.dp)) {
|
||||
Text("DX cluster", style = MaterialTheme.typography.titleSmall)
|
||||
/*
|
||||
* Each heading sits in the pane of its table, so dragging the divider moves the
|
||||
* heading with the table it names rather than leaving it stranded above the other.
|
||||
*/
|
||||
SplitterPane(
|
||||
state = splitter,
|
||||
orientation = SplitterOrientation.VERTICAL,
|
||||
modifier = Modifier.fillMaxSize().padding(4.dp),
|
||||
panes = listOf(
|
||||
{ MonitorPane(strings.monitorDxCluster, clusterTable) },
|
||||
{ MonitorPane(strings.messagesQsoOfTheOther, qsoTable) },
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Half each, fixed. The JavaFX window used a SplitPane whose divider the
|
||||
* operator could drag, and that position was stored; reproducing the
|
||||
* gesture belongs with the station list of Etappe 5, where a split pane is
|
||||
* unavoidable. Until then an even split is honest rather than a broken
|
||||
* handle.
|
||||
*/
|
||||
DataTableView(clusterTable, modifier = Modifier.weight(1f).fillMaxWidth())
|
||||
|
||||
HorizontalDivider(thickness = Density.HAIRLINE)
|
||||
|
||||
Text(
|
||||
kst4contest.view.i18n.LocalStrings.current.messagesQsoOfTheOther,
|
||||
style = MaterialTheme.typography.titleSmall,
|
||||
modifier = Modifier.padding(top = 4.dp),
|
||||
)
|
||||
|
||||
DataTableView(qsoTable, modifier = Modifier.weight(1f).fillMaxWidth())
|
||||
}
|
||||
@Composable
|
||||
private fun <T> MonitorPane(heading: String, table: DataTableState<T>) {
|
||||
Column(modifier = Modifier.fillMaxSize()) {
|
||||
Text(heading, style = MaterialTheme.typography.titleSmall, modifier = Modifier.padding(top = 4.dp))
|
||||
DataTableView(table, modifier = Modifier.weight(1f).fillMaxWidth())
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user