Giter VIP home page Giter VIP logo

Comments (8)

bilikyar avatar bilikyar commented on June 14, 2024 1

scratch link使用native方案,所以可以使用系统特性(小图标是系统特性)

如果要实现这个功能,有两个思路,其一是依赖于一个强大的UI库,来提供跨平台的支持。目前我在qt(pyqt5)中似乎没看到这个支持。

方案二是使用python包装过的系统库,如pywin32(Windows)、pyobjc(Mac)

目前我使用pyobjc完成在mac上的图标功能了。源码一时找不到,等我找到之前的实验代码,我贴过来。

用pyqt5 这个库加个小图标,挺简单的你看这个链接。 我感觉就这一次迁移框架的时候,就添加tray icon的代码就好了。
链接

按道理,pyqt5 应该是跨平台的,我刚刚在windows,mac上测试过了上面链接里的代码,运行成功了。

from codelab_adapter_extensions.

wwj718 avatar wwj718 commented on June 14, 2024

scratch link使用native方案,所以可以使用系统特性(小图标是系统特性)

如果要实现这个功能,有两个思路,其一是依赖于一个强大的UI库,来提供跨平台的支持。目前我在qt(pyqt5)中似乎没看到这个支持。

方案二是使用python包装过的系统库,如pywin32(Windows)、pyobjc(Mac)

目前我使用pyobjc完成在mac上的图标功能了。源码一时找不到,等我找到之前的实验代码,我贴过来。

from codelab_adapter_extensions.

wwj718 avatar wwj718 commented on June 14, 2024

我找到之前的一些笔记

from AppKit import NSStatusBar
status_item = NSStatusBar.systemStatusBar().statusItemWithLength_(-1) #NSVariableStatusItemLength
status_item.setImage_(<NSImage instance to status icon>)

from codelab_adapter_extensions.

wwj718 avatar wwj718 commented on June 14, 2024

在windows下,这个功能名字叫Tray Icon, 在关键字的帮助下,Google到QT对其提供了支持!
image

https://doc.qt.io/archives/qt-4.8/qt-desktop-systray-example.html

from codelab_adapter_extensions.

wwj718 avatar wwj718 commented on June 14, 2024

linux考虑 https://github.com/martinohanlon/shortcut 帮助启动

from codelab_adapter_extensions.

wwj718 avatar wwj718 commented on June 14, 2024

@bilikyar 太棒了

from codelab_adapter_extensions.

wwj718 avatar wwj718 commented on June 14, 2024

@wangshub

from codelab_adapter_extensions.

wangshub avatar wangshub commented on June 14, 2024

@wwj718 Copy,Pyqt5 做这个再好不过了 😋

from codelab_adapter_extensions.

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.