Giter Club home page Giter Club logo

Comments (4)

andydotxyz avatar andydotxyz commented on May 19, 2024 1

Exposing a call particularly useful for macOS kinda goes against platform-agnostic design. Passing in a ThemedResource allows us to do the right thing per-platform under the hood.

from fyne.

andydotxyz avatar andydotxyz commented on May 19, 2024

There's a lot of interesting thoughts here, but I don't follow how having a version of an icon called "_templated" helps to use template icons in systray?
More simply we could either add SetTemplateSystrayIcon or just make use of the existing ThemedResource to be used as a template image in the systray context?
i.e. SetSystemTrayIcon(theme.NewThemedResource(iconData))?
seems much simpler and uses existing APIs.

from fyne.

flowchartsman avatar flowchartsman commented on May 19, 2024

Simply exposing SetTemplateSystrayIcon is probably a good start, though given the general guidance to prefer templated images on macOS, it's probably worth considering how it might be handled in a default way. I like the idea of using ThemedResource for that, since, as you say, it already exists. It wasn't clear on how themed resources worked when I first submitted the issue, but after digging around in the code, it looks as if they require an SVG and then just swap out the fill color? If that's the case, SetSystemTrayIcon could then just conditionally rasterize themed resources to black on macOS, which would solve the issue neatly!

from fyne.

andydotxyz avatar andydotxyz commented on May 19, 2024

Fixed on the develop branch as proposed (passing theme.ThemedResource) will be available in v2.5.0

from fyne.

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.