Skip to content

Customizable button class for cocoa / OSX, written in Swift. Permits customizing colors, border radii, roll-over hover highlighting, and more. Customizeable from within InterfaceBuilder.

License

Notifications You must be signed in to change notification settings

kleydon/Customizable-Button-Demo-OSX-Swift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Customizable-Button-Demo-OSX-Swift

Demo of a highly customizable button class for cocoa / OSX, written in Swift.

Permits customizing the following, via InterfaceBuilder or via code:

  • Button color (normal and pressed)
  • Border color (normal and pressed)
  • Icon color (normal and pressed) - Supports monochrome images.
  • Icon image (normal and pressed)
  • Text color (normal and pressed)
  • Border Radius (together or one at a time)
  • Roll-over/hover highlighting
  • Glow color
  • Glow radius

Usage:

  1. Add the QXButton.swift class to your codebase.
  2. Using InterfaceBuilder, drag a button to a storyboard
  3. From InterfaceBuilder's Attributes Inspector, change the style of the button to "Square"
  4. From InterfaceBuilder's Identity Inspector, set the class to "QXButton"
  5. Returning to the Attribute Inspector, controls will appear for button color, etc.
  6. Configure and connect your QXButton as you would a standard NSButton.

Implementation:

NOTE: The relative positioning of text and image (when button includes both) is still flakey.

About

Customizable button class for cocoa / OSX, written in Swift. Permits customizing colors, border radii, roll-over hover highlighting, and more. Customizeable from within InterfaceBuilder.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages