Skip to content

Commit d23caf6

Browse files
committed
Made find panel responsive to width. When too narrow control text turns to icons.
1 parent 8213913 commit d23caf6

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

Sources/CodeEditSourceEditor/Find/PanelView/FindControls.swift

Whitespace-only changes.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
struct FindPanelContent: View {
2+
@ObservedObject var viewModel: FindPanelViewModel
3+
@FocusState.Binding var focus: FindPanelView.FindPanelFocus?
4+
var findModePickerWidth: Binding<CGFloat>
5+
var condensed: Bool
6+
7+
var body: some View {
8+
HStack(spacing: 5) {
9+
VStack(alignment: .leading, spacing: 4) {
10+
FindSearchField(
11+
viewModel: viewModel,
12+
focus: $focus,
13+
findModePickerWidth: findModePickerWidth,
14+
condensed: condensed
15+
)
16+
if viewModel.mode == .replace {
17+
ReplaceSearchField(
18+
viewModel: viewModel,
19+
focus: $focus,
20+
findModePickerWidth: findModePickerWidth,
21+
condensed: condensed
22+
)
23+
}
24+
}
25+
VStack(alignment: .leading, spacing: 4) {
26+
FindControls(viewModel: viewModel, condensed: condensed)
27+
if viewModel.mode == .replace {
28+
Spacer(minLength: 0)
29+
ReplaceControls(viewModel: viewModel, condensed: condensed)
30+
}
31+
}
32+
.fixedSize()
33+
}
34+
}
35+
}

Sources/CodeEditSourceEditor/Find/PanelView/ReplaceControls.swift

Whitespace-only changes.

0 commit comments

Comments
 (0)