new ui
This commit is contained in:
@@ -44,18 +44,18 @@ struct MainView: View {
|
||||
HSplitView {
|
||||
navigator
|
||||
.frame(
|
||||
minWidth: 210,
|
||||
idealWidth: 265,
|
||||
minWidth: 180,
|
||||
idealWidth: 250,
|
||||
maxWidth: 420
|
||||
)
|
||||
|
||||
workspace
|
||||
.frame(minWidth: 600)
|
||||
.frame(minWidth: 480)
|
||||
}
|
||||
|
||||
statusBar
|
||||
}
|
||||
.frame(minWidth: 1100, minHeight: 720)
|
||||
.frame(minWidth: 800, minHeight: 520)
|
||||
.preferredColorScheme(
|
||||
UserDefaults.standard.string(
|
||||
forKey: "preferences.appearance"
|
||||
@@ -83,7 +83,7 @@ struct MainView: View {
|
||||
|
||||
Text("MySQL Workbench")
|
||||
.font(.system(size: 15, weight: .semibold))
|
||||
.foregroundStyle(.black)
|
||||
.foregroundStyle(.primary)
|
||||
|
||||
Rectangle()
|
||||
.fill(WB.border)
|
||||
@@ -152,7 +152,7 @@ struct MainView: View {
|
||||
Text(title)
|
||||
.font(.system(size: 10))
|
||||
}
|
||||
.foregroundStyle(.black)
|
||||
.foregroundStyle(.primary)
|
||||
.frame(minWidth: 65)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
@@ -455,32 +455,64 @@ struct MainView: View {
|
||||
|
||||
VSplitView {
|
||||
sqlEditor
|
||||
.frame(minHeight: 230)
|
||||
.frame(minHeight: 150)
|
||||
|
||||
bottomWorkspace
|
||||
.frame(minHeight: 230)
|
||||
.frame(minHeight: 150)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private var queryTabBar: some View {
|
||||
HStack(spacing: 0) {
|
||||
HStack(spacing: 8) {
|
||||
Image(systemName: "doc.text")
|
||||
.foregroundStyle(.blue)
|
||||
ScrollView(.horizontal) {
|
||||
HStack(spacing: 2) {
|
||||
ForEach(model.queryTabs) { tab in
|
||||
HStack(spacing: 8) {
|
||||
Button {
|
||||
model.activateQuery(tab.id)
|
||||
} label: {
|
||||
Label(tab.title, systemImage: "doc.text")
|
||||
.lineLimit(1)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
|
||||
Text("Query 1")
|
||||
.font(.system(size: 12, weight: .semibold))
|
||||
|
||||
Image(systemName: "xmark")
|
||||
.font(.system(size: 9))
|
||||
.foregroundStyle(.secondary)
|
||||
Button {
|
||||
model.closeQuery(tab.id)
|
||||
} label: {
|
||||
Image(systemName: "xmark")
|
||||
.font(.system(size: 9))
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
}
|
||||
.font(.system(size: 12))
|
||||
.padding(.horizontal, 10)
|
||||
.frame(height: 30)
|
||||
.background(
|
||||
model.activeQueryID == tab.id
|
||||
? Color(nsColor: .textBackgroundColor)
|
||||
: Color.clear
|
||||
)
|
||||
.clipShape(
|
||||
UnevenRoundedRectangle(
|
||||
topLeadingRadius: 5,
|
||||
topTrailingRadius: 5
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
.padding(.horizontal, 10)
|
||||
.frame(height: 29)
|
||||
.background(Color(nsColor: .textBackgroundColor))
|
||||
.scrollIndicators(.hidden)
|
||||
|
||||
Spacer()
|
||||
Button {
|
||||
model.newQueryTab()
|
||||
} label: {
|
||||
Image(systemName: "plus")
|
||||
}
|
||||
.buttonStyle(.borderless)
|
||||
.padding(.horizontal, 10)
|
||||
.help("New Query Tab")
|
||||
}
|
||||
.background(WB.header)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user