-
-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
65 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,35 @@ | ||
// Copyright (c) 2010-2024 Contributors to the openHAB project | ||
// | ||
// FrameCellView.swift | ||
// openHAB | ||
// See the NOTICE file(s) distributed with this work for additional | ||
// information. | ||
// | ||
// Created by Tim on 29.08.24. | ||
// Copyright © 2024 openHAB e.V. All rights reserved. | ||
// This program and the accompanying materials are made available under the | ||
// terms of the Eclipse Public License 2.0 which is available at | ||
// http://www.eclipse.org/legal/epl-2.0 | ||
// | ||
// SPDX-License-Identifier: EPL-2.0 | ||
|
||
import OpenHABCore | ||
import SwiftUI | ||
|
||
struct FrameCellView: View { | ||
@ObservedObject var widget: OpenHABWidget | ||
let gray = Color(UIColor.darkGray) | ||
|
||
var body: some View { | ||
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) | ||
Text(widget.label.uppercased()) | ||
.font(.system(.callout)) | ||
.lineLimit(1) | ||
.foregroundColor(Color(.ohSecondaryLabel)) | ||
.padding() | ||
.background(gray.edgesIgnoringSafeArea(.all)) | ||
.listRowInsets(EdgeInsets()) // Equivalent to separatorInset | ||
.frame(maxWidth: .infinity, alignment: .leading) | ||
} | ||
} | ||
|
||
#Preview { | ||
FrameCellView() | ||
let widget = OpenHABWidget() | ||
widget.label = "??" | ||
return FrameCellView(widget: widget) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters