Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 76733940b2 | |||
| a58be98a55 | |||
| 5f506926e0 | |||
| bde7399d29 | |||
| bcf6ce5e79 |
@@ -5,6 +5,7 @@
|
||||

|
||||

|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](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) | |
|
||||
|  |  |
|
||||
|  |  | |
|
||||
| [link](https://dribbble.com/shots/7055473-Dropdowns) | | |
|
||||
|  |  | [code](examples/examples.md) |
|
||||
|
||||
## Credits
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 62 KiB |
@@ -0,0 +1,38 @@
|
||||
## Example
|
||||
|
||||

|
||||
|
||||
### 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 |
Reference in New Issue
Block a user