Skip to content

Commit

Permalink
Remove Unused UI (CodeEditApp#1272)
Browse files Browse the repository at this point in the history
  • Loading branch information
austincondiff authored May 22, 2023
1 parent 62faaf2 commit e180ab7
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 60 deletions.
2 changes: 1 addition & 1 deletion CodeEdit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3809,7 +3809,7 @@
repositoryURL = "https://github.com/CodeEditApp/CodeEditTextView.git";
requirement = {
kind = exactVersion;
version = 0.6.2;
version = 0.6.3;
};
};
58F2EB1C292FB954004A9BDE /* XCRemoteSwiftPackageReference "Sparkle" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/CodeEditApp/CodeEditTextView.git",
"state" : {
"revision" : "045bd359ef9c4addf2a5bf51e22ba660d69c5d10",
"version" : "0.6.2"
"revision" : "1dfd0b535e4d80fd8037298a30020bbfd7b5fb9c",
"version" : "0.6.3"
}
},
{
Expand All @@ -50,8 +50,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/krzyzanowskim/STTextView.git",
"state" : {
"revision" : "77a37aed80277467990c2c8d224ed951899446f0",
"version" : "0.6.0"
"revision" : "6c6243ae790247368aea258e4fb3642523759bec",
"version" : "0.5.3"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,26 @@ import SwiftUI
struct QuickHelpInspectorView: View {
var body: some View {
VStack(alignment: .leading) {

Text("Quick Help")
.foregroundColor(.secondary)
.fontWeight(.bold)
.font(.system(size: 13))
.frame(width: 250, alignment: .leading)

Text("No Quick Help")
.foregroundColor(.secondary)
.font(.system(size: 16))
.fontWeight(.medium)
.frame(width: 250, alignment: .center)
.padding(.top, 10)
.padding(.bottom, 10)

Button("Search Documentation") {

}.background(in: RoundedRectangle(cornerRadius: 4))
.frame(width: 250, alignment: .center)
.font(.system(size: 12))
VStack {
Text("No Quick Help")
.foregroundColor(.secondary)
.font(.system(size: 16))
.fontWeight(.medium)
.padding(.top, 10)
.padding(.bottom, 10)

Button("Search Documentation") {
// Open documentation
}
.controlSize(.small)
}
.frame(maxWidth: .infinity)
Divider().padding(.top, 15)

}.frame(maxWidth: 250).padding(5)
}
.frame(maxWidth: .infinity).padding(5)
}
}
20 changes: 10 additions & 10 deletions CodeEdit/Features/NavigatorSidebar/NavigatorSidebarTabBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ struct NavigatorSidebarTabBar: View {
SidebarDockIcon(imageName: "folder", title: "Project", id: 0),
SidebarDockIcon(imageName: "vault", title: "Version Control", id: 1),
SidebarDockIcon(imageName: "magnifyingglass", title: "Search", id: 2),
SidebarDockIcon(imageName: "shippingbox", title: "...", id: 3, disabled: true),
SidebarDockIcon(imageName: "play", title: "...", id: 4, disabled: true),
SidebarDockIcon(imageName: "exclamationmark.triangle", title: "...", id: 5, disabled: true),
SidebarDockIcon(imageName: "curlybraces.square", title: "...", id: 6, disabled: true),
SidebarDockIcon(imageName: "puzzlepiece.extension", title: "...", id: 7, disabled: true),
SidebarDockIcon(imageName: "square.grid.2x2", title: "...", id: 8, disabled: true)
// SidebarDockIcon(imageName: "shippingbox", title: "...", id: 3, disabled: true),
// SidebarDockIcon(imageName: "play", title: "...", id: 4, disabled: true),
// SidebarDockIcon(imageName: "exclamationmark.triangle", title: "...", id: 5, disabled: true),
// SidebarDockIcon(imageName: "curlybraces.square", title: "...", id: 6, disabled: true),
// SidebarDockIcon(imageName: "puzzlepiece.extension", title: "...", id: 7, disabled: true),
// SidebarDockIcon(imageName: "square.grid.2x2", title: "...", id: 8, disabled: true)
]
@State private var hasChangedLocation: Bool = false
@State private var draggingItem: SidebarDockIcon?
Expand Down Expand Up @@ -76,7 +76,7 @@ struct NavigatorSidebarTabBar: View {
: AnyLayout(VStackLayout(spacing: 0))
layout {
ForEach(icons) { icon in
makeIcon(named: icon.imageName, title: icon.title, id: icon.id, size: size)
makeIcon(named: icon.imageName, title: icon.title, id: icon.id, size: size, iconsCount: icons.count)
.opacity(draggingItem?.imageName == icon.imageName &&
hasChangedLocation &&
drugItemLocation != nil ? 0.0: icon.disabled ? 0.3 : 1.0)
Expand All @@ -103,7 +103,8 @@ struct NavigatorSidebarTabBar: View {
title: String,
id: Int,
scale: Image.Scale = .medium,
size: CGSize
size: CGSize,
iconsCount: Int
) -> some View {
Button {
selection = id
Expand All @@ -112,7 +113,7 @@ struct NavigatorSidebarTabBar: View {
.font(.system(size: 12.5))
.symbolVariant(id == selection ? .fill : .none)
.frame(
width: position == .side ? 40 : (size.width < 272 ? 24 : 30),
width: position == .side ? 40 : (size.width < 272 && iconsCount > 8 ? 24 : 30),
height: position == .side ? 28 : size.height,
alignment: .center
)
Expand Down Expand Up @@ -148,7 +149,6 @@ struct NavigatorSidebarTabBar: View {
func makeBody(configuration: Configuration) -> some View {
configuration.label
.foregroundColor(id == selection ? .accentColor : configuration.isPressed ? .primary : .secondary)
.opacity(activeState == .inactive ? 0.45 : 1)
}
}

Expand Down
10 changes: 5 additions & 5 deletions CodeEdit/Features/Settings/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ struct SettingsView: View {
private static let pages: [SettingsPage] = [
.init(.general, baseColor: .gray, icon: .system("gear")),
.init(.accounts, baseColor: .blue, icon: .system("at")),
.init(.behavior, baseColor: .red, icon: .system("flowchart.fill")),
.init(.navigation, baseColor: .green, icon: .system("arrow.triangle.turn.up.right.diamond.fill")),
// .init(.behaviors, baseColor: .red, icon: .system("flowchart.fill")),
// .init(.navigation, baseColor: .green, icon: .system("arrow.triangle.turn.up.right.diamond.fill")),
.init(.theme, baseColor: .pink, icon: .system("paintbrush.fill")),
.init(.textEditing, baseColor: .blue, icon: .system("pencil.line")),
.init(.terminal, baseColor: .blue, icon: .system("terminal.fill")),
.init(.keybindings, baseColor: .gray, icon: .system("keyboard.fill")),
// .init(.keybindings, baseColor: .gray, icon: .system("keyboard.fill")),
.init(.sourceControl, baseColor: .blue, icon: .symbol("vault")),
.init(.components, baseColor: .blue, icon: .system("puzzlepiece.fill")),
// .init(.components, baseColor: .blue, icon: .system("puzzlepiece.fill")),
.init(.location, baseColor: .green, icon: .system("externaldrive.fill")),
.init(.advanced, baseColor: .gray, icon: .system("gearshape.2.fill"))
// .init(.advanced, baseColor: .gray, icon: .system("gearshape.2.fill"))
]

/// Variables for the selected Page, the current search text and software updater
Expand Down
1 change: 0 additions & 1 deletion CodeEdit/Features/StatusBar/Views/StatusBarIcon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ struct IconButtonStyle: ButtonStyle {
)
.frame(width: size, height: size)
.contentShape(Rectangle())
.opacity(isEnabled ? 1 : 0.5)
.brightness(
configuration.isPressed
? colorScheme == .dark
Expand Down
4 changes: 2 additions & 2 deletions CodeEdit/Features/StatusBar/Views/StatusBarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ struct StatusBarView: View {
/// The actual status bar
var body: some View {
HStack(alignment: .center, spacing: 10) {
StatusBarBreakpointButton()
StatusBarDivider()
// StatusBarBreakpointButton()
// StatusBarDivider()
SegmentedControl($model.selectedTab, options: StatusBarTabType.allOptions)
.opacity(collapsed ? 0 : 1)
Spacer()
Expand Down
27 changes: 8 additions & 19 deletions CodeEdit/Features/Tabs/Views/TabBarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -537,23 +537,9 @@ struct TabBarView: View {

private var trailingAccessories: some View {
HStack(spacing: 2) {
TabBarAccessoryIcon(
icon: .init(systemName: "ellipsis.circle"),
action: {} // TODO: Implement
)
.foregroundColor(.secondary)
.buttonStyle(.plain)
.help("Options")
TabBarAccessoryIcon(
icon: .init(systemName: "arrow.left.arrow.right.square"),
action: {} // TODO: Implement
)
.foregroundColor(.secondary)
.buttonStyle(.plain)
.help("Enable Code Review")
splitviewButton
}
.padding(.horizontal, 5)
.padding(.horizontal, 10)
.opacity(activeState != .inactive ? 1.0 : 0.5)
.frame(maxHeight: .infinity) // Fill out vertical spaces.
.background {
Expand All @@ -567,23 +553,26 @@ struct TabBarView: View {
Group {
switch (tabgroup.parent?.axis, modifierKeys.contains(.option)) {
case (.horizontal, true), (.vertical, false):
TabBarAccessoryIcon(icon: Image(systemName: "square.split.1x2")) {
Button {
split(edge: .bottom)
} label: {
Image(systemName: "square.split.1x2")
}
.help("Split Vertically")

case (.vertical, true), (.horizontal, false):
TabBarAccessoryIcon(icon: Image(systemName: "square.split.2x1")) {
Button {
split(edge: .trailing)
} label: {
Image(systemName: "square.split.2x1")
}
.help("Split Horizontally")

default:
EmptyView()
}
}
.foregroundColor(.secondary)
.buttonStyle(.plain)
.buttonStyle(.icon)
}

func split(edge: Edge) {
Expand Down

0 comments on commit e180ab7

Please sign in to comment.