forked from arauchfuss/Simple-Comic
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'arc' into App-Store-1.9.1
- Loading branch information
Showing
62 changed files
with
245 additions
and
284 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// | ||
// CenteredTextLayer.swift | ||
// Simple Comic | ||
// | ||
// Created by J-rg on 09.12.20. | ||
// Copyright © 2020 Dancing Tortoise Software. All rights reserved. | ||
// | ||
|
||
import QuartzCore | ||
|
||
@objc | ||
class CenteredTextLayer: CATextLayer { | ||
|
||
override func draw(in ctx: CGContext) { | ||
let height = bounds.size.height | ||
let fontSize = self.fontSize | ||
let yDiff = (height - fontSize) / 2 - fontSize / 10 | ||
|
||
ctx.saveGState() | ||
ctx.translateBy(x: 0, y: -yDiff) | ||
super.draw(in: ctx) | ||
ctx.restoreGState() | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// DTPreferencesController.swift | ||
// Simple Comic | ||
// | ||
// Created by J-rg on 20.04.20. | ||
// Copyright © 2020 Dancing Tortoise Software. All rights reserved. | ||
// | ||
|
||
import Cocoa | ||
|
||
class DTPreferencesController: NSWindowController { | ||
|
||
convenience init() { | ||
self.init(windowNibName: "Preferences") | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// | ||
// DTToolbarItems.swift | ||
// Simple Comic | ||
// | ||
// Created by J-rg on 09.12.20. | ||
// Copyright © 2020 Dancing Tortoise Software. All rights reserved. | ||
// | ||
|
||
import Cocoa | ||
|
||
class DTToolbarItem: NSToolbarItem { | ||
|
||
override func validate() { | ||
guard let toolbarDelegate = toolbar?.delegate as? TSSTSessionWindowController else { return } | ||
|
||
if toolbarDelegate.responds(to: #selector(getter: TSSTSessionWindowController.pageSelectionInProgress)) { | ||
(view as? NSControl)?.isEnabled = !(toolbarDelegate.pageSelectionInProgress) | ||
} | ||
} | ||
} | ||
|
||
class DTPageTurnToolbarItem: DTToolbarItem { | ||
|
||
override func validate() { | ||
guard let toolbarDelegate = toolbar?.delegate as? TSSTSessionWindowController else { return } | ||
|
||
if toolbarDelegate.responds(to: #selector(getter: TSSTSessionWindowController.canTurnPageLeft)) { | ||
(view as? NSSegmentedControl)?.setEnabled(toolbarDelegate.canTurnPageLeft, forSegment: 0) | ||
} | ||
|
||
if toolbarDelegate.responds(to: #selector(getter: TSSTSessionWindowController.canTurnPageRight)) { | ||
(view as? NSSegmentedControl)?.setEnabled(toolbarDelegate.canTurnPageRight, forSegment: 1) | ||
} | ||
|
||
super.validate() | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// DTWindowCategory.swift | ||
// Simple Comic | ||
// | ||
// Created by J-rg on 21.11.20. | ||
// Copyright © 2020 Dancing Tortoise Software. All rights reserved. | ||
// | ||
|
||
import Cocoa | ||
|
||
@objc | ||
extension NSWindow { | ||
|
||
var toolbarHeight: CGFloat { | ||
get { | ||
return frame.height - contentRect(forFrameRect: frame).height | ||
} | ||
} | ||
|
||
var isFullscreen: Bool { | ||
get { | ||
return styleMask.contains(.fullScreen) | ||
} | ||
} | ||
} |
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
Oops, something went wrong.