5 Commits

Author SHA1 Message Date
Sapozhnik Ivan 76733940b2 Update README.md 2021-11-19 23:04:48 +01:00
Sapozhnik Ivan a58be98a55 Update README.md 2020-09-15 11:22:31 +02:00
Sapozhnik Ivan 5f506926e0 Update README.md 2020-04-23 14:57:03 +02:00
Ivan Sapozhnik bde7399d29 Merge branch 'master' of https://github.com/iSapozhnik/Menu
# Conflicts:
#	README.md
2020-04-23 14:55:42 +02:00
Ivan Sapozhnik bcf6ce5e79 update readme 2020-04-23 14:53:23 +02:00
5 changed files with 46 additions and 5 deletions
+8 -5
View File
@@ -5,6 +5,7 @@
![Swift](https://img.shields.io/badge/%20in-swift%205.0-orange.svg)
![macOS](https://img.shields.io/badge/macOS-10.12-green.svg)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FiSapozhnik%2FMenu%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/iSapozhnik/Menu)
</div>
@@ -121,7 +122,7 @@ class ViewController: NSViewController {
myMenu.addItems(menuItems)
}
@IBAction func didClickedButton(_ sender: NSButton) {
@IBAction func didClickButton(_ sender: NSButton) {
myMenu.show(from: sender)
}
}
@@ -129,12 +130,14 @@ class ViewController: NSViewController {
## Examples
In this section I've collected some examples of what can be implemented by using **Menu** control. On the left side some random examples from Dribbble and on the right side there is my implementation.
In this section I've collected some examples of what can be i,plemented do using **Menu** control. On the left side some random example from Dribbble and on the right side my implementation.
| Dribbble | Menu |
| ------------- |:-------------:|
| Dribbble | Menu | Code |
| ------------- |:-------------:|:-------------:|
| [link](https://dribbble.com/shots/4233782-Snooze-notifications-in-Twist) | |
| ![](examples/twist.png) | ![](examples/example_twist.png) |
| ![](examples/twist.png) | ![](examples/menu_twist.png) | |
| [link](https://dribbble.com/shots/7055473-Dropdowns) | | |
| ![](examples/example_0.png) | ![](examples/menu_0.png) | [code](examples/examples.md) |
## Credits
Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

+38
View File
@@ -0,0 +1,38 @@
## Example
![](menu_0.png)
### Code:
```
class Config: MenuConfiguration {
override var cornerRadius: CGFloat {
return 15.0
}
override var backgroundColor: NSColor {
return NSColor(red: 63/255, green: 59/255, blue: 59/255, alpha: 1.0)
}
override var menuItemHoverBackgroundColor: NSColor {
return NSColor(red: 86/255, green: 81/255, blue: 81/255, alpha: 1.0)
}
override var menuItemHoverCornerRadius: CGFloat {
return 10.0
}
override var contentEdgeInsets: NSEdgeInsets {
return NSEdgeInsets(top: 8, left: 16, bottom: 8, right: 16)
}
override var menuItemHeight: CGFloat {
return 40.0
}
override var menuItemHoverEdgeInsets: NSEdgeInsets {
return NSEdgeInsets(top: 0, left: 8, bottom: 0, right: 8)
}
}
```
Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB