Skip to content

Commit 34c3f78

Browse files
committed
use a two column layout for the summary dialog
1 parent da5d358 commit 34c3f78

File tree

1 file changed

+49
-26
lines changed

1 file changed

+49
-26
lines changed

ui/summaryView.go

Lines changed: 49 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -56,35 +56,58 @@ func newSummaryView(controller SummaryController) *summaryView {
5656
result.root.SetMarginStart(5)
5757
result.root.SetMarginEnd(5)
5858

59-
result.contestNameEntry = buildLabeledEntry(result.root, 0, "Contest Name", nil)
60-
result.cabrilloNameEntry = buildLabeledEntry(result.root, 1, "Cabrillo Name", nil)
61-
result.startTimeEntry = buildLabeledEntry(result.root, 2, "Start Time", nil)
62-
result.callsignEntry = buildLabeledEntry(result.root, 3, "Callsign", nil)
63-
result.myExchangesEntry = buildLabeledEntry(result.root, 4, "My Exchanges", nil)
64-
65-
buildSeparator(result.root, 5, 2)
66-
67-
result.operatorModeCombo = buildLabeledCombo(result.root, 6, "Operator Mode", false, result.controller.OperatorModes(), result.onOperatorModeChanged)
68-
result.overlayCombo = buildLabeledCombo(result.root, 7, "Overlay", false, result.controller.Overlays(), result.onOverlayChanged)
69-
result.powerModeCombo = buildLabeledCombo(result.root, 8, "Power", false, result.controller.PowerModes(), result.onPowerModeChanged)
70-
result.assistedCheckButton = buildCheckButtonInColumn(result.root, 9, 1, 1, "Assisted", result.onAssistedToggled)
71-
72-
buildSeparator(result.root, 10, 2)
73-
74-
result.workedModesEntry = buildLabeledEntry(result.root, 11, "Worked Modes", nil)
75-
result.workedBandsEntry = buildLabeledEntry(result.root, 12, "Worked Bands", nil)
76-
result.operatingTimeEntry = buildLabeledEntry(result.root, 13, "Operating Time", nil)
77-
result.breakTimeEntry = buildLabeledEntry(result.root, 14, "Break Time", nil)
78-
result.breaksEntry = buildLabeledEntry(result.root, 15, "Breaks", nil)
79-
80-
buildSeparator(result.root, 16, 2)
81-
59+
columns, _ := gtk.GridNew()
60+
columns.SetOrientation(gtk.ORIENTATION_HORIZONTAL)
61+
columns.SetHExpand(true)
62+
columns.SetVExpand(false)
63+
columns.SetColumnSpacing(20)
64+
result.root.Attach(columns, 0, 1, 1, 1)
65+
66+
leftColumn, _ := gtk.GridNew()
67+
leftColumn.SetOrientation(gtk.ORIENTATION_VERTICAL)
68+
leftColumn.SetHExpand(true)
69+
leftColumn.SetVExpand(false)
70+
leftColumn.SetColumnSpacing(5)
71+
leftColumn.SetRowSpacing(5)
72+
columns.Attach(leftColumn, 0, 0, 1, 1)
73+
74+
rightColumn, _ := gtk.GridNew()
75+
rightColumn.SetOrientation(gtk.ORIENTATION_VERTICAL)
76+
rightColumn.SetHExpand(true)
77+
rightColumn.SetVExpand(false)
78+
rightColumn.SetColumnSpacing(5)
79+
rightColumn.SetRowSpacing(5)
80+
columns.Attach(rightColumn, 1, 0, 1, 1)
81+
82+
// left
83+
84+
result.contestNameEntry = buildLabeledEntry(leftColumn, 0, "Contest Name", nil)
85+
result.cabrilloNameEntry = buildLabeledEntry(leftColumn, 1, "Cabrillo Name", nil)
86+
result.startTimeEntry = buildLabeledEntry(leftColumn, 2, "Start Time", nil)
87+
result.callsignEntry = buildLabeledEntry(leftColumn, 3, "Callsign", nil)
88+
result.myExchangesEntry = buildLabeledEntry(leftColumn, 4, "My Exchanges", nil)
89+
90+
buildHeaderLabel(leftColumn, 5, "Working Condition")
91+
result.operatorModeCombo = buildLabeledCombo(leftColumn, 6, "Operator Mode", false, result.controller.OperatorModes(), result.onOperatorModeChanged)
92+
result.overlayCombo = buildLabeledCombo(leftColumn, 7, "Overlay", false, result.controller.Overlays(), result.onOverlayChanged)
93+
result.powerModeCombo = buildLabeledCombo(leftColumn, 8, "Power", false, result.controller.PowerModes(), result.onPowerModeChanged)
94+
result.assistedCheckButton = buildCheckButtonInColumn(leftColumn, 9, 1, 1, "Assisted", result.onAssistedToggled)
95+
96+
//right
97+
98+
result.workedModesEntry = buildLabeledEntry(rightColumn, 0, "Worked Modes", nil)
99+
result.workedBandsEntry = buildLabeledEntry(rightColumn, 1, "Worked Bands", nil)
100+
result.operatingTimeEntry = buildLabeledEntry(rightColumn, 2, "Operating Time", nil)
101+
result.breakTimeEntry = buildLabeledEntry(rightColumn, 3, "Break Time", nil)
102+
result.breaksEntry = buildLabeledEntry(rightColumn, 4, "Breaks", nil)
103+
104+
buildHeaderLabel(rightColumn, 5, "Claimed Score")
82105
result.scoreTable = newScoreTable(nil)
83-
result.root.Attach(result.scoreTable.Table(), 0, 17, 2, 1)
106+
rightColumn.Attach(result.scoreTable.Table(), 0, 6, 2, 1)
84107

85-
buildSeparator(result.root, 18, 2)
108+
buildSeparator(result.root, 2, 1)
86109

87-
result.openAfterExportCheckButton = buildCheckButtonInColumn(result.root, 19, 0, 2, "Open the file after export", result.onOpenAfterExportToggled)
110+
result.openAfterExportCheckButton = buildCheckButton(result.root, 3, "Open the file after export", result.onOpenAfterExportToggled)
88111

89112
return result
90113
}

0 commit comments

Comments
 (0)