changed badge style for available updates

This commit is contained in:
Steve Kküng
2019-03-18 22:28:20 +01:00
parent 914ce53041
commit 05c5f39ede
4 changed files with 18 additions and 17 deletions
@@ -284,7 +284,7 @@
attributes = {
CLASSPREFIX = MSC;
LastSwiftUpdateCheck = 0920;
LastUpgradeCheck = 0940;
LastUpgradeCheck = 1000;
ORGANIZATIONNAME = "The Munki Project";
TargetAttributes = {
C0196316210507DB0009F51A = {
@@ -505,6 +505,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
@@ -564,6 +565,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
@@ -398,21 +398,18 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<imageCell key="cell" refusesFirstResponder="YES" imageScaling="proportionallyDown" image="NSActionTemplate" id="LeG-M3-5ap"/>
</imageView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="pE9-YF-ju9">
<rect key="frame" x="179" y="11" width="37" height="17"/>
<autoresizingMask key="autoresizingMask"/>
<textFieldCell key="cell" lineBreakMode="clipping" id="Ahd-1Y-BGV">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button hidden="YES" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="LLF-TK-FyK">
<rect key="frame" x="167" y="11" width="20" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="inline" title="0" bezelStyle="inline" alignment="center" borderStyle="border" inset="2" id="q81-SY-K1x">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="smallSystemBold"/>
</buttonCell>
</button>
</subviews>
<connections>
<outlet property="badge" destination="pE9-YF-ju9" id="3L9-gU-gWP"/>
<outlet property="imageView" destination="fiC-hB-HCN" id="RX8-ym-kDr"/>
<outlet property="badge" destination="LLF-TK-FyK" id="y1n-3x-gCj"/>
<outlet property="imgView" destination="fiC-hB-HCN" id="8XJ-3j-uBh"/>
<outlet property="textField" destination="545-FJ-GjT" id="Ih4-QF-viy"/>
<outlet property="title" destination="545-FJ-GjT" id="0Bw-er-nlQ"/>
</connections>
</tableCellView>
@@ -661,13 +661,14 @@ class MainWindowController: NSWindowController, NSWindowDelegate, WKNavigationDe
if let view = self.sidebar.rowView(atRow: 3, makeIfNecessary: false) {
cellView = view.view(atColumn: 0) as? MSCTableCellView
}
if updateCount > 0 {
NSApp.dockTile.badgeLabel = String(updateCount)
cellView?.badge.stringValue = String(updateCount)
cellView?.badge.title = String(updateCount)
cellView?.badge.isHidden = false
} else {
NSApp.dockTile.badgeLabel = nil
cellView?.badge.stringValue = ""
cellView?.badge.isHidden = true
}
}
@@ -12,5 +12,6 @@ class MSCTableCellView: NSTableCellView {
@IBOutlet weak var imgView: NSImageView!
@IBOutlet weak var title: NSTextField!
@IBOutlet weak var badge: NSTextField!
@IBOutlet weak var badge: NSButton!
}