Skip to content

Commit

Permalink
Merge pull request #97 from zenangst/bugfixes/and-improvements
Browse files Browse the repository at this point in the history
Bug fixes and improvements
  • Loading branch information
zenangst authored May 21, 2019
2 parents be03f2c + 577d876 commit 8970423
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 49 deletions.
4 changes: 2 additions & 2 deletions Gray.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@
BD30ED4B216C010400FD2D91 /* Features */ = {
isa = PBXGroup;
children = (
BD299EB62242148200098B39 /* Import */,
BD987B2822418BB500783BE6 /* Export */,
BD9D3D79215C2D3F00233333 /* Applications */,
BD987B2822418BB500783BE6 /* Export */,
BD299EB62242148200098B39 /* Import */,
BD9F0C3F216675AB00608FD9 /* Main */,
BD9F0C40216675D200608FD9 /* SystemPreferences */,
);
Expand Down
18 changes: 9 additions & 9 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
PODS:
- Blueprints (0.10.2)
- Differific (0.7.1)
- Family (0.14.8)
- Sourcery (0.15.0)
- Blueprints (0.11.0)
- Differific (0.8.0)
- Family (0.15.0)
- Sourcery (0.16.1)
- UserInterface (0.5.0)

DEPENDENCIES:
Expand All @@ -21,12 +21,12 @@ SPEC REPOS:
- UserInterface

SPEC CHECKSUMS:
Blueprints: b40cceab2d6f03d2ccb764cafffda470a490caef
Differific: 8624df953dd5254fb7708ce28529fdda11b08e3b
Family: 7fda93c45b8bea5d48cc2916221e7fbb83be4e0c
Sourcery: 5895672cae353cdbfa95f3f4aaeb75a664d76f6a
Blueprints: 19b347c8783ca86f527b7f818320b0e32827ff51
Differific: b54449d41410dbca7c76858f28cf3a94a581c195
Family: 2efd722ed3d2ea4847d89c70f3a88ea5dce1bbb5
Sourcery: 16779170d35ee204666843b09031f36721a84bcc
UserInterface: 54e15db9aceaec2b9686d00f471adb15d2598ea3

PODFILE CHECKSUM: 9a4a4208e8595d7fa51cbc758521284dec9359cc

COCOAPODS: 1.6.0
COCOAPODS: 1.6.1
2 changes: 1 addition & 1 deletion Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.11.0</string>
<string>0.12.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSApplicationCategoryType</key>
Expand Down
3 changes: 1 addition & 2 deletions Sources/Application/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ class AppDelegate: NSObject, NSApplicationDelegate {
.fullSizeContentView, .unifiedTitleAndToolbar]
window.titleVisibility = .hidden
window.toolbar = toolbar

window.minSize = windowSize
window.maxSize = CGSize(width: 790, height: 1280)
window.maxSize = CGSize(width: 790 * 2, height: 1280)

if window.frame.size.width < windowSize.width || window.frame.size.width > window.maxSize.width {
window.setFrame(NSRect.init(origin: .zero, size: windowSize),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,8 @@ ApplicationGridViewDelegate, ApplicationsLogicControllerDelegate, ApplicationLis
strongSelf.performSearch(with: strongSelf.query)
}

switch mode {
case .grid:
gridComponent.reload(with: gridModels(from: applications), completion: completion)
case .list:
listComponent.reload(with: listModels(from: applications), completion: completion)
}
gridComponent.reload(with: gridModels(from: applications), completion: completion)
listComponent.reload(with: listModels(from: applications), completion: completion)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ class ApplicationsLoadingViewController: NSViewController {
let stackView = NSStackView()
stackView.orientation = .vertical
stackView.alignment = .centerX
stackView.distribution = .gravityAreas
stackView.addArrangedSubview(textField)
stackView.distribution = .fillProportionally
stackView.addArrangedSubview(progress)
NSLayoutConstraint.addAndPin(stackView, toView: view, insets: .init(top: 20, left: 20, bottom: 20, right: 20))

NSLayoutConstraint.deactivate(layoutConstraints)
layoutConstraints = NSLayoutConstraint.addAndPin(stackView, toView: view,
insets: .init(top: 0, left: 20, bottom: 0, right: 20))

textField.maximumNumberOfLines = -1
textField.alignment = .center
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,6 @@ class ApplicationsLogicController {
appearance: appearance,
restricted: restricted)

// let app = ApplicationGridViewModel(
// title: bundleName,
// subtitle: subtitle,
// application: application)
DispatchQueue.main.async { [weak self] in
guard let strongSelf = self else { return }
strongSelf.delegate?.applicationsLogicController(strongSelf, didLoadApplication: application, offset: offset, total: total)
Expand Down
24 changes: 12 additions & 12 deletions Voodoo/Output/CollectionViewItemComponent-macOS.generated.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated using Sourcery 0.15.0 — https://github.com/krzysztofzablocki/Sourcery
// Generated using Sourcery 0.16.1 — https://github.com/krzysztofzablocki/Sourcery
// DO NOT EDIT

import Cocoa
Expand Down Expand Up @@ -122,10 +122,10 @@ class ApplicationGridDataSource: NSObject, NSCollectionViewDataSource {
let model = self.model(at: indexPath)

if let view = item as? ApplicationGridView {
view.currentAppearance = model.application.appearance
iconStore.loadIcon(for: model.application) { image in view.iconView.image = image }
view.titleLabel.stringValue = model.title
view.subtitleLabel.stringValue = model.subtitle
view.currentAppearance = model.application.appearance
iconStore.loadIcon(for: model.application) { image in view.iconView.image = image }
view.titleLabel.stringValue = model.title
view.subtitleLabel.stringValue = model.subtitle
}

return item
Expand Down Expand Up @@ -256,10 +256,10 @@ class ApplicationListDataSource: NSObject, NSCollectionViewDataSource {
let model = self.model(at: indexPath)

if let view = item as? ApplicationListView {
view.currentAppearance = model.application.appearance
iconStore.loadIcon(for: model.application) { image in view.iconView.image = image }
view.titleLabel.stringValue = model.title
view.subtitleLabel.stringValue = model.subtitle
view.currentAppearance = model.application.appearance
iconStore.loadIcon(for: model.application) { image in view.iconView.image = image }
view.titleLabel.stringValue = model.title
view.subtitleLabel.stringValue = model.subtitle
}

return item
Expand Down Expand Up @@ -390,9 +390,9 @@ class SystemPreferenceDataSource: NSObject, NSCollectionViewDataSource {
let model = self.model(at: indexPath)

if let view = item as? SystemPreferenceView {
view.iconView.image = model.icon
view.titleLabel.stringValue = model.title
view.subtitleLabel.stringValue = model.subtitle
view.iconView.image = model.icon
view.titleLabel.stringValue = model.title
view.subtitleLabel.stringValue = model.subtitle
}

return item
Expand Down
2 changes: 1 addition & 1 deletion Voodoo/Output/StatefulItem-macOS.generated.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated using Sourcery 0.15.0 — https://github.com/krzysztofzablocki/Sourcery
// Generated using Sourcery 0.16.1 — https://github.com/krzysztofzablocki/Sourcery
// DO NOT EDIT

import Cocoa
Expand Down
2 changes: 1 addition & 1 deletion Voodoo/Output/ViewControllerFactory-macOS.generated.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated using Sourcery 0.15.0 — https://github.com/krzysztofzablocki/Sourcery
// Generated using Sourcery 0.16.1 — https://github.com/krzysztofzablocki/Sourcery
// DO NOT EDIT

import Cocoa
Expand Down
16 changes: 8 additions & 8 deletions Voodoo/Templates/CollectionViewItemComponent-macOS.stencil
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,15 @@ class {{type.name|replace:"View",""}}DataSource: NSObject, NSCollectionViewDataS
{% for variable in type.variables %}
{% for key, value in variable.annotations %}
{% ifnot variable|annotated:"$RawBinding" %}
{% if value.length > 0 %}
view.{{key}} = {{value}}
{% else %}
{% for variableType in value %}
view.{{variable.annotations[key][variableType]}}
{% endfor %}
{% endif %}
{% if value.count > 1 %}
view.{{key}} = {{value}}
{% else %}
{{ value }}
{% for variableType in value %}
view.{{variable.annotations[key][variableType]}}
{% endfor %}
{% endif %}
{% else %}
{{ value }}
{% endif %}
{% endfor %}
{% endfor %}
Expand Down

0 comments on commit 8970423

Please sign in to comment.