Giter Site home page Giter Site logo

flatbutton's Introduction

FlatButton

Layer based NSButton with Interface Builder exposed style options.

This is a subclass that lets you create beautiful NSButton controls easily.

FlatButton for macOS

Installation (CocoaPods)

Configure your Podfile to use FlatButton:

pod 'FlatButton'

Note that FlatButton is Swift 3 only.

Usage

Create an NSButton in Interface Builder and set it's class to FlatButton. You can now style your button from the inspector:

FlatButton for macOS

The same values can be accessed from your code.

License

The MIT License (MIT)

Copyright (c) 2016 Oskar Groth

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.

flatbutton's People

Contributors

felixlisczyk avatar karlzeo avatar mborsten avatar oskargroth avatar tmw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flatbutton's Issues

Pod Install Error

I am running into the following error when trying to install FlatButton using CocoaPods

[!] The platform of the target `Test` (iOS 10.0) is not compatible with `FlatButton (0.0.9)`, which does not support `ios`.

Any advice on how to resolve this error?

Buttons don't respond to dark-mode changes

Using named dynamic colours works in terms of changing the colour when the button is first drawn.

however - the button should also recognise a change in dark mode and re-draw itself

Swift 3.0.2 and macOS 10.12

Hi, the master branch uses an outdated Swift version - to fix this, I tried to manually download and use the 1.1.1 tagged .swift file but there's issues, notably the button doesn't appear until clicked, and the title is invisible. Am I doing something wrong or is this repo not ready for this yet? :) Thanks!

Customisation Error

Hey,

Every time I try and customise the buttons, the default setting when the view loads is a hidden button. When pressed, the color and style is applied to the button.
When the button has text, the button is hidden.

I have loaded version 1.4, use swift 4.

Swift 3.1 syntax

This pod could use an update to the new Swift API.
.sizeWithAttributes(attributes) -> size(withAttributes: attributes), etc.etc.

CocoaPods installs an outdated version of FlatButton

Podfile

use_frameworks!

target 'test' do
  platform :osx, '10.13'
  pod 'FlatButton'
end

Terminal

$ pod install
Analyzing dependencies
Downloading dependencies
Installing FlatButton (1.2)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

Notice that CocoaPods installs version 1.2 although version 1.4 is the latest release. I assume you have to update the master repo?

https://github.com/CocoaPods/Specs/tree/master/Specs/9/7/f/FlatButton

Thank you!

As a workaround for others, you can specify this repo in the podfile directly. This will install the latest version.

pod 'FlatButton', :git => 'https://github.com/OskarGroth/FlatButton.git'

Objective-c version

Hi I am new to this mac-programming.
I would like to looking for objective-c version of these project.
What I work on, i need objective-c version. And I can't find the proper function of these code.

Buttons Don't Highlight via ShortCut Keys

When assigning a shortcut key to a button, and the key is pressed, the button doesn not momentarily highlight.
As well, after a key press, the button will toggle on if clicked and toggle momentarily off with future clicks.
After a subsequent key press, the button toggles off if clicked.

Title not sharp

This may be the most stupid question but why the title text I got in the button is not as sharp as other labels.
Screenshot

New release for Carthage

Could you please create a new release so that it is possible to get the latest updates via Carthage?

The current release does not contain the changes to the access level of FlatButton...

Button image not working

Hi - I am trying to add an image to a flat button - but it shows the image as being out of proportion.
Do you know how to make the image follow the image sizes of the button?

image

Whereas is should look like:

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.