Skip to content
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

Improve modal and add more customising options #126

Closed
10 tasks done
kasper opened this issue Jul 31, 2016 · 9 comments
Closed
10 tasks done

Improve modal and add more customising options #126

kasper opened this issue Jul 31, 2016 · 9 comments
Assignees
Milestone

Comments

@kasper
Copy link
Owner

kasper commented Jul 31, 2016

Improve modal and add more customising options.

  1. Adjust alignment and size
  2. Use NSVisualEffectView as content view
  3. Allow origin to be updated dynamically
  4. Ability to adjust weight dynamically
  5. Ability to change appearance (dark|light|transparent)
  6. Deprecate message-property for removal in next minor release
  7. Add text-property, alias message-property to text
  8. Ability to display an app icon
  9. Add convenience factory method Modal.build(properties)
  10. Document dynamic properties
@kasper kasper added this to the 2.2.2 milestone Jul 31, 2016
@kasper kasper self-assigned this Jul 31, 2016
@kasper
Copy link
Owner Author

kasper commented Jul 31, 2016

Tada! 🎉

var parent = Screen.main().visibleFrameInRectangle();
var modal = new Modal();
modal.weight = 100;
modal.appearance = 'transparent';
modal.text = '🐱';
modal.origin = {
  x: parent.x + (parent.width / 2) - (modal.frame().width / 2),
  y: parent.y + (parent.height / 2) - (modal.frame().height / 2)
};
modal.show();

@kasper
Copy link
Owner Author

kasper commented Jul 31, 2016

cat

@mafredri
Copy link
Contributor

Epic! Don't know what I'm gonna do with it yet, but I look forward to playing around with it 😆!

@kasper
Copy link
Owner Author

kasper commented Jul 31, 2016

@mafredri How about a nice little cat vs. mouse mini-game? 😆 I’m also looking into adding the support to display an app icon alongside the message. (These were just some additional benefits for that.)

@mafredri
Copy link
Contributor

How about a nice little cat vs. mouse mini-game?

Haha, would be a fun proof of concept xD!

I’m also looking into adding the support to display an app icon alongside the message

Oh yes, that will be very nice, especially when showing modals on a per-window basis!

@kasper kasper changed the title Add more customising options for modals Improve modal Aug 2, 2016
kasper added a commit that referenced this issue Aug 2, 2016
@kasper kasper added the feature label Aug 2, 2016
@kasper kasper changed the title Improve modal Improve modal and add more customising options Aug 2, 2016
kasper added a commit that referenced this issue Aug 2, 2016
kasper added a commit that referenced this issue Aug 3, 2016
kasper added a commit that referenced this issue Aug 3, 2016
kasper added a commit that referenced this issue Aug 3, 2016
@kasper
Copy link
Owner Author

kasper commented Aug 3, 2016

I think this will be a nice little feature! 😉

screenshot

@kasper
Copy link
Owner Author

kasper commented Aug 3, 2016

If someone finds any bugs, please report! This feature should be mostly done now. Just some cleaning up to do.

kasper added a commit that referenced this issue Aug 3, 2016
kasper added a commit that referenced this issue Aug 3, 2016
@mafredri
Copy link
Contributor

mafredri commented Aug 3, 2016

Looking really nice, great work! I'll try to find some time this week to play around with them :).

kasper added a commit that referenced this issue Aug 4, 2016
kasper added a commit that referenced this issue Aug 4, 2016
kasper added a commit that referenced this issue Aug 4, 2016
@kasper
Copy link
Owner Author

kasper commented Aug 4, 2016

Lastly, a nice factory method!

var parent = Screen.main().visibleFrameInRectangle();
var modal = Modal.build({
  appearance: 'light',
  icon: App.get('Spotify').icon(),
  text: 'Spotify',
  origin: function (frame) {
    return {
      x: parent.x + (parent.width / 2) - (frame.width / 2),
      y: parent.y + (parent.height / 2) - (frame.height / 2)
    };
  }
});
modal.show();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants