Skip to content

Commit 3221e33

Browse files
committed
gtk: Say when a machine is stopping
Report it while the device is torn down, and rest the button until it is over.
1 parent dd4019d commit 3221e33

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

‎LumaGtk/Sources/LumaGtk/VirtualMachinePanel.swift‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ private final class MachineRow {
232232
widget.append(child: summary)
233233

234234
screenHost = Box(orientation: .vertical, spacing: 0)
235-
screenHost.setSizeRequest(width: -1, height: 200)
236235
widget.append(child: screenHost)
237236

238237
disclosure.onClicked { [weak self] _ in
@@ -261,10 +260,15 @@ private final class MachineRow {
261260

262261
func refreshState() {
263262
let machine = self.machine
263+
let isStopping = engine?.virtualMachines.isStopping(record) ?? false
264264
let summary: String?
265-
switch machine?.state {
266-
case .running, .stopped, nil: summary = nil
267-
case .some(let state): summary = state.panelSummary
265+
if isStopping {
266+
summary = "Stopping…"
267+
} else {
268+
switch machine?.state {
269+
case .running, .stopped, nil: summary = nil
270+
case .some(let state): summary = state.panelSummary
271+
}
268272
}
269273

270274
if summary != lastSummary {
@@ -276,7 +280,7 @@ private final class MachineRow {
276280
if machine != nil {
277281
primaryButton.iconName = "media-playback-stop-symbolic"
278282
primaryButton.tooltipText = "Stop"
279-
primaryButton.sensitive = (machine?.state != .starting)
283+
primaryButton.sensitive = (machine?.state != .starting) && !isStopping
280284
} else {
281285
primaryButton.iconName = "media-playback-start-symbolic"
282286
primaryButton.tooltipText =

0 commit comments

Comments
 (0)