Giter Club home page Giter Club logo

Comments (7)

indragiek avatar indragiek commented on July 18, 2024

This is a duplicate of issue #3. There appears to be no solution to this problem using public APIs. I believe the only way to work around this would be to create a completely custom window that mimics the appearance of a standard window, except with the centered traffic lights and larger titlebar (as INAppStoreWindow does). I currently do not have time to create something like that, but I believe @Perspx is working on it.

from inappstorewindow.

alexrozanski avatar alexrozanski commented on July 18, 2024

Indeed, I have got the window buttons to work; I still have a few things to fix before i release it. If not as a full project I'll release it as a gist or a blog post.

from inappstorewindow.

levinunnink avatar levinunnink commented on July 18, 2024

@Perspx, just curious what you did to get the buttons to work? I'm using this project but I haven't been able to fix this bug yet.

from inappstorewindow.

alexrozanski avatar alexrozanski commented on July 18, 2024

Sure, I've posted it as a gist, which can be found here https://gist.github.com/972958

The way the window handles the window buttons is that it uses a tracking area for the rectangle where the buttons should be. When the mouse is hovered in this rectangle, the buttons change their display to the hover state.

Therefore altering this is pretty easy: all you have to do is swap out the existing tracking area with a new one, for your updated rectangle. The tracking area is on the window's theme frame (the view which draws the window bar etc) so you find the tracking area being used, and use your updated rectangle.

Unfortunately, NSTrackingArea has no public -setRect: method (there is a private -_setRect: method which I believe works, but I was going for public APIs) so what you have to do is create a new tracking area with the same values as the old tracking area, except for your updated rectangle. Also, for some reason, the userInfo property can't be nil, it has to be [NSDictionary dictionary] for some reason which I'm not entirely sure about.

If you do that then the buttons will appear in the hover state when you mouse over this new rectangle.

from inappstorewindow.

indragiek avatar indragiek commented on July 18, 2024

I've implemented @Perspx's fix in the latest commit (e0d0006). I'm unable to test this because I'm currently running a beta version of Mac OS X which has some notable differences in the ways tracking areas are used in the theme frame. If you guys could test on Snow Leopard and let me know if it works, that would be fantastic :-)

from inappstorewindow.

alexrozanski avatar alexrozanski commented on July 18, 2024

There was a one-liner fix, but otherwise worked as expected. I've sent you a pull request.

from inappstorewindow.

indragiek avatar indragiek commented on July 18, 2024

I've merged the pull request, hopefully all issues are solved now :) Thanks @Perspx for all the assistance!

from inappstorewindow.

Related Issues (20)

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.