Skip to content

Commit

Permalink
[ADD] multilines checkboxes
Browse files Browse the repository at this point in the history
[FIX] a typo
  • Loading branch information
Pyroh committed May 8, 2020
1 parent b146151 commit cd30ca5
Show file tree
Hide file tree
Showing 10 changed files with 216 additions and 58 deletions.
4 changes: 4 additions & 0 deletions Fluor.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
3F16ECE123EDDF66008BC89A /* SetExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F16ECE023EDDF66008BC89A /* SetExtension.swift */; };
3F244071245D73180061960A /* UserNotificationHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F244070245D73180061960A /* UserNotificationHelper.swift */; };
3F2571F41FDBD43500020194 /* TableViewContentAnimator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F2571F31FDBD43500020194 /* TableViewContentAnimator.swift */; };
3F266BA1246489D70005395F /* MultilinesCheckBoxLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F266BA0246489D70005395F /* MultilinesCheckBoxLabel.swift */; };
3F2CAE6A246038E30046D711 /* UserNotificationEnablementViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F2CAE69246038E30046D711 /* UserNotificationEnablementViewController.swift */; };
3F2CAE6C246438590046D711 /* LinkButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F2CAE6B246438590046D711 /* LinkButton.swift */; };
3F2FA3FF1D79D094003E2AD8 /* StatusMenuController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F2FA3FE1D79D094003E2AD8 /* StatusMenuController.swift */; };
Expand Down Expand Up @@ -90,6 +91,7 @@
3F16ECE023EDDF66008BC89A /* SetExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SetExtension.swift; sourceTree = "<group>"; };
3F244070245D73180061960A /* UserNotificationHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserNotificationHelper.swift; sourceTree = "<group>"; };
3F2571F31FDBD43500020194 /* TableViewContentAnimator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TableViewContentAnimator.swift; sourceTree = "<group>"; };
3F266BA0246489D70005395F /* MultilinesCheckBoxLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MultilinesCheckBoxLabel.swift; sourceTree = "<group>"; };
3F2CAE69246038E30046D711 /* UserNotificationEnablementViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserNotificationEnablementViewController.swift; sourceTree = "<group>"; };
3F2CAE6B246438590046D711 /* LinkButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinkButton.swift; sourceTree = "<group>"; };
3F2FA3FE1D79D094003E2AD8 /* StatusMenuController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StatusMenuController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -229,6 +231,7 @@
3F15629B23FE892A00CD0773 /* MoverImageView.swift */,
3F9EDD29245C7BAF0047D1AC /* MenuItemView.swift */,
3F2CAE6B246438590046D711 /* LinkButton.swift */,
3F266BA0246489D70005395F /* MultilinesCheckBoxLabel.swift */,
);
path = Views;
sourceTree = "<group>";
Expand Down Expand Up @@ -462,6 +465,7 @@
3FC44EFC1D7F16CB0065D433 /* Items.swift in Sources */,
3F2FA3FF1D79D094003E2AD8 /* StatusMenuController.swift in Sources */,
3FE784DD2052F591007F6200 /* NSViewExtension.swift in Sources */,
3F266BA1246489D70005395F /* MultilinesCheckBoxLabel.swift in Sources */,
3FE38EAC221DBE880019B889 /* ReleaseNotesViewController.swift in Sources */,
3F84FE81200E655E00871275 /* StoryboardInstantiableProtocol.swift in Sources */,
3F16ECE123EDDF66008BC89A /* SetExtension.swift in Sources */,
Expand Down
8 changes: 1 addition & 7 deletions Fluor.xcodeproj/xcshareddata/xcschemes/Fluor.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
enableAddressSanitizer = "YES"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand All @@ -84,13 +85,6 @@
isEnabled = "NO">
</EnvironmentVariable>
</EnvironmentVariables>
<AdditionalOptions>
<AdditionalOption
key = "MallocStackLogging"
value = ""
isEnabled = "YES">
</AdditionalOption>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
154 changes: 113 additions & 41 deletions Fluor/Base.lproj/Preferences.storyboard

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Fluor/Base.lproj/RulesEditor.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<windowStyleMask key="styleMask" titled="YES" closable="YES" resizable="YES" fullSizeContentView="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="196" y="240" width="320" height="480"/>
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="1050"/>
<rect key="screenRect" x="0.0" y="0.0" width="3200" height="1800"/>
<toolbar key="toolbar" implicitIdentifier="1EEC2327-407B-4B2B-A439-BD7C40F619F6" autosavesConfiguration="NO" allowsUserCustomization="NO" displayMode="iconOnly" sizeMode="regular" id="zFq-f3-1of">
<allowedToolbarItems>
<toolbarItem implicitItemIdentifier="NSToolbarFlexibleSpaceItem" id="8mb-UB-zuJ"/>
Expand Down Expand Up @@ -204,7 +204,7 @@
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="FQS-Uv-JNd">
<rect key="frame" x="144" y="6" width="33" height="14"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Label" id="Y1u-Fa-sgm">
<font key="font" metaFont="menu" size="11"/>
<font key="font" metaFont="message" size="11"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
Expand All @@ -219,7 +219,7 @@
<segmentedControl verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ttC-Xk-L6o">
<rect key="frame" x="2" y="2" width="51" height="21"/>
<segmentedCell key="cell" controlSize="small" borderStyle="border" alignment="left" style="rounded" trackingMode="momentary" id="qsY-JB-wQQ">
<font key="font" metaFont="menu" size="11"/>
<font key="font" metaFont="message" size="11"/>
<segments>
<segment toolTip="Add rule" image="NSAddTemplate" width="22"/>
<segment toolTip="Delete selected rule" image="NSRemoveTemplate" width="22" tag="1"/>
Expand Down
2 changes: 1 addition & 1 deletion Fluor/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>2323</string>
<string>2342</string>
<key>FLGithubURL</key>
<string>https://github.com/Pyroh/Fluor</string>
<key>FLPyrolyseURL</key>
Expand Down
2 changes: 1 addition & 1 deletion Fluor/Misc/UserNotificationHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ enum UserNotificationHelper {
let alert = NSAlert()
alert.icon = NSImage(imageLiteralResourceName: "QuestionMark")
alert.messageText = NSLocalizedString("Enable notifications ?", comment: "")
alert.informativeText = NSLocalizedString("Fluor can send notifications when the F-Keys mode change.", comment: "")
alert.informativeText = NSLocalizedString("Fluor can send notifications when the F-Keys mode changes.", comment: "")
if suppressible {
alert.showsSuppressionButton = true
alert.suppressionButton?.title = NSLocalizedString("Don't ask me on startup again", comment: "")
Expand Down
25 changes: 23 additions & 2 deletions Fluor/Views/LinkButton.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,31 @@
//
// LinkButton.swift
//
// Fluor
//
// Created by Pierre TACCHI on 07/05/2020.
// Copyright © 2020 Pyrolyse. All rights reserved.
// MIT License
//
// Copyright (c) 2020 Pierre Tacchi
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//


import Cocoa
import SmoothOperators
Expand Down
67 changes: 67 additions & 0 deletions Fluor/Views/MultilinesCheckBoxLabel.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
//
// MultilinesCheckBoxLabel.swift
//
// Fluor
//
// MIT License
//
// Copyright (c) 2020 Pierre Tacchi
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//


import Cocoa

class MultilinesCheckBoxLabel: NSTextField {
@IBOutlet weak var checkBox: NSButton!

override var isHighlighted: Bool {
didSet {
checkBox.isHighlighted = isHighlighted
}
}
private var isClicked = false

override func updateTrackingAreas() {
super.updateTrackingAreas()

self.trackingAreas.forEach(self.removeTrackingArea(_:))
let trackingArea = NSTrackingArea(rect: self.bounds, options: [.activeAlways, .mouseEnteredAndExited, .enabledDuringMouseDrag], owner: self, userInfo: nil)
self.addTrackingArea(trackingArea)
}

override func mouseDown(with event: NSEvent) {
isClicked = true
isHighlighted = true
}

override func mouseUp(with event: NSEvent) {
if isHighlighted { checkBox.performClick(self) }
isClicked = false
}

override func mouseEntered(with event: NSEvent) {
if isClicked { isHighlighted = true }
}

override func mouseExited(with event: NSEvent) {
if isClicked { isHighlighted = false }
}
}
Binary file modified Fluor/en.lproj/Localizable.strings
Binary file not shown.
6 changes: 3 additions & 3 deletions Fluor/fr.lproj/Preferences.strings
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"aHs-kY-jFz.ibShadowedToolTips[1]" = "Mode touches de fonction";

/* Class = "NSButtonCell"; title = "When the current application mode is set by pressing the fn key"; ObjectID = "B11-db-6JL"; */
"B11-db-6JL.title" = "Lors de la modification du mode pour l'application active par l'appui de la touche fn";
"ezd-7Z-VvY.title" = "Lors de la modification du mode pour l'application active par l'appui de la touche fn";

/* Class = "NSViewController"; title = "General"; ObjectID = "bdY-l4-Nw7"; */
"bdY-l4-Nw7.title" = "Général";
Expand Down Expand Up @@ -41,7 +41,7 @@
"hgm-4a-jDl.title" = "Pour tout évènement";

/* Class = "NSButtonCell"; title = "When the global mode is set by pressing the fn key"; ObjectID = "hIk-un-EuO"; */
"hIk-un-EuO.title" = "Lors de la modification du mode par défaut par l'appui de la touche fn";
"fT0-a8-Fn0.title" = "Lors de la modification du mode par défaut par l'appui de la touche fn";

/* Class = "NSTabViewItem"; label = "Notifications"; ObjectID = "hM9-Ia-nxv"; */
"hM9-Ia-nxv.label" = "Notifications";
Expand Down Expand Up @@ -110,7 +110,7 @@
"Vtq-y9-sm5.title" = "Vérifier maintenant";

/* Class = "NSButtonCell"; title = "When the mode changes with the active application"; ObjectID = "x50-mP-zRP"; */
"x50-mP-zRP.title" = "Lorsque le mode change avec l'application active";
"tcj-WZ-834.title" = "Lorsque le mode change avec l'application active";

/* Class = "NSButtonCell"; title = "Automaticaly check for updates"; ObjectID = "xgt-53-WGT"; */
"xgt-53-WGT.title" = "Vérification automatique des mises à jour";
Expand Down

0 comments on commit cd30ca5

Please sign in to comment.