Skip to content

Commit

Permalink
Fixed some bugs related to manga grid scaling, also made the scale sl…
Browse files Browse the repository at this point in the history
…ider affect the group view
  • Loading branch information
DrabWeb committed Dec 30, 2016
1 parent 2a651c3 commit 10dfa44
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Komikan/Komikan/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,14 @@ class ViewController: NSViewController, NSTabViewDelegate, NSWindowDelegate {

/// When the value for infoBarGridSizeSlider changes...
@IBAction func infoBarGridSizeSliderInteracted(_ sender: AnyObject) {
// Set the manga collection view's item size to the sliders value(For both width and height so we get a square)
// Set the manga grid and group's min and max size to the sliders value
mangaCollectionView.minItemSize = NSSize(width: infoBarGridSizeSlider.integerValue, height: infoBarGridSizeSlider.integerValue);
mangaCollectionView.maxItemSize = NSSize(width: infoBarGridSizeSlider.integerValue + 100, height: infoBarGridSizeSlider.integerValue + 100);

groupCollectionView.minItemSize = NSSize(width: infoBarGridSizeSlider.integerValue, height: infoBarGridSizeSlider.integerValue);
groupCollectionView.maxItemSize = NSSize(width: infoBarGridSizeSlider.integerValue + 100, height: infoBarGridSizeSlider.integerValue + 100);
}

// Is the sidebar open?
var sidebarOpen : Bool = false;

// The button in the titlebar that lets us add manga
@IBOutlet weak var titlebarAddMangaButton: NSButton!

Expand Down Expand Up @@ -352,9 +353,6 @@ class ViewController: NSViewController, NSTabViewDelegate, NSWindowDelegate {

// Subscribe to the Drag and Drop add / import notification
NotificationCenter.default.addObserver(self, selector: #selector(ViewController.showAddImportPopoverDragAndDrop(_:)), name:NSNotification.Name(rawValue: "MangaGrid.DropFiles"), object: nil);

// Subscribe to the application's preferences saved notification
NotificationCenter.default.addObserver(self, selector: #selector(ViewController.loadPreferenceValues), name:NSNotification.Name(rawValue: "Application.PreferencesLoaded"), object: nil);
}

override func viewWillAppear() {
Expand All @@ -370,6 +368,9 @@ class ViewController: NSViewController, NSTabViewDelegate, NSWindowDelegate {
// Show the groups
showGroupView();
}

// Load the preference values
loadPreferenceValues();
}

override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
Expand Down

0 comments on commit 10dfa44

Please sign in to comment.