From 157a236b07b88b34181c8a572991683b33c80dc2 Mon Sep 17 00:00:00 2001 From: Takayama Fumihiko Date: Sun, 29 Oct 2023 17:23:54 +0900 Subject: [PATCH] DeviceName.connectedDeviceSetting -> connectedDevice --- .../SettingsWindow/src/View/DevicesView.swift | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/apps/SettingsWindow/src/View/DevicesView.swift b/src/apps/SettingsWindow/src/View/DevicesView.swift index 71bc7de0c..8202af4a6 100644 --- a/src/apps/SettingsWindow/src/View/DevicesView.swift +++ b/src/apps/SettingsWindow/src/View/DevicesView.swift @@ -9,7 +9,7 @@ struct DevicesView: View { VStack(alignment: .leading, spacing: 0.0) { ForEach($settings.connectedDeviceSettings) { $connectedDeviceSetting in VStack(alignment: .leading, spacing: 0.0) { - DeviceName(connectedDeviceSetting: connectedDeviceSetting) + DeviceName(connectedDevice: connectedDeviceSetting.connectedDevice) VStack(alignment: .leading, spacing: 0.0) { ModifyEventsSetting(connectedDeviceSetting: $connectedDeviceSetting) @@ -50,28 +50,26 @@ struct DevicesView: View { } struct DeviceName: View { - let connectedDeviceSetting: LibKrbn.ConnectedDeviceSetting + let connectedDevice: LibKrbn.ConnectedDevice var body: some View { HStack(alignment: .center, spacing: 0) { HStack(spacing: 4.0) { Spacer() - if connectedDeviceSetting.connectedDevice.isKeyboard { + if connectedDevice.isKeyboard { Image(systemName: "keyboard") } - if connectedDeviceSetting.connectedDevice.isPointingDevice { + if connectedDevice.isPointingDevice { Image(systemName: "capsule.portrait") } - if connectedDeviceSetting.connectedDevice.isGamePad { + if connectedDevice.isGamePad { Image(systemName: "gamecontroller") } } .frame(width: 50.0) - Text( - "\(connectedDeviceSetting.connectedDevice.productName) (\(connectedDeviceSetting.connectedDevice.manufacturerName))" - ) - .padding(.leading, 12.0) + Text("\(connectedDevice.productName) (\(connectedDevice.manufacturerName))") + .padding(.leading, 12.0) Spacer() }