-
-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Menu improvements #423
Merged
Merged
Menu improvements #423
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
a3a8936
Extract MenuBuilder
simonhamp bff79d7
Add more Electron MenuItem roles
simonhamp 9d407ce
Allow MenuItems to have submenus
simonhamp 97bc40b
enabled/disabled
simonhamp 0e2429f
Add GoToUrl convenience item
simonhamp 428819b
Fix styling
simonhamp e066697
Add help and hide roles
simonhamp 4ad23a6
Receive combo key data
simonhamp c1874ee
Add id's to menu items
simonhamp 37f0040
Support radio items
simonhamp 23c3363
Style
simonhamp 7c1cca5
Remove custom event menu item type
simonhamp f857938
Support custom event firing on all menu items
simonhamp 1c8931e
Fix label
simonhamp c6cc7e0
Type hints and consistency
simonhamp a180a16
Fix styling
simonhamp a6a6f30
Get rid of the yucky GoTo* stuff
simonhamp 3825635
Fix test
simonhamp 2f4d01f
Add hotkey alias method
simonhamp 2afe2e4
Update docblock
simonhamp 9fe62d4
Make Menu JsonSerializable
simonhamp d19389e
Fix styling
simonhamp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
namespace Native\Laravel\Facades; | ||
|
||
use Illuminate\Support\Facades\Facade; | ||
use Native\Laravel\Menu\Items\Checkbox; | ||
use Native\Laravel\Menu\Items\Label; | ||
use Native\Laravel\Menu\Items\Link; | ||
use Native\Laravel\Menu\Items\Radio; | ||
use Native\Laravel\Menu\Items\Role; | ||
use Native\Laravel\Menu\Items\Separator; | ||
|
||
/** | ||
* @method static \Native\Laravel\Menu\Menu make(\Native\Laravel\Menu\Items\MenuItem ...$items) | ||
* @method static Checkbox checkbox(string $label, bool $checked = false, ?string $hotkey = null) | ||
* @method static Label label(string $label) | ||
* @method static Link link(string $url, string $label = null, ?string $hotkey = null) | ||
simonhamp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* @method static Link route(string $url, string $label = null, ?string $hotkey = null) | ||
* @method static Radio radio(string $label, bool $checked = false, ?string $hotkey = null) | ||
* @method static Role app() | ||
* @method static Role file() | ||
* @method static Role edit() | ||
* @method static Role view() | ||
* @method static Role window() | ||
* @method static Role help() | ||
* @method static Role window() | ||
* @method static Role fullscreen() | ||
* @method static Role separator() | ||
* @method static Role devTools() | ||
* @method static Role undo() | ||
* @method static Role redo() | ||
* @method static Role cut() | ||
* @method static Role copy() | ||
* @method static Role paste() | ||
* @method static Role pasteAndMatchStyle() | ||
* @method static Role reload() | ||
* @method static Role minimize() | ||
* @method static Role close() | ||
* @method static Role quit() | ||
* @method static Role help() | ||
* @method static Role hide() | ||
* @method static void create(MenuItem ...$items) | ||
* @method static void default() | ||
*/ | ||
class Menu extends Facade | ||
{ | ||
protected static function getFacadeAccessor() | ||
{ | ||
return \Native\Laravel\Menu\MenuBuilder::class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add some PHP Doc here to represent:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comes straight from Electron and I don't want the docblock structure to be wrong if/when they change things, as that would be more confusing imo. Perhaps at some point we create our own abstraction around this? 🤷🏻♂️