Coder Social home page Coder Social logo

renwinping / qtdocktile Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alekseysidorov/qtdocktile

0.0 1.0 0.0 904 KB

Crossplatform dock icon implementation

License: GNU Lesser General Public License v3.0

Shell 0.24% PHP 0.05% JavaScript 9.16% CSS 46.28% IDL 0.65% C++ 34.35% Groovy 0.01% C 6.83% Objective-C 2.41%

qtdocktile's Introduction

## Readme document for QtDockTile library

Using issue of docks on desktops today become more and more popular. There is at least 3 popular solutions of this issue: MacOS Dock, Windows 7 taskbar and Unity launchers from Ubuntu. Also there is icon tasks in KDE 4.8.
Looking at this, there is a need to cross-platform library for the work with all this docks.

### Common issues for docks

* Badges
* Progress indicator
* Menu
* Alarms

All this things are basics and they are fully supported in Win7, MacOS and Ubuntu. On this basis QtDockTile API will be built and all platform-dependent extensions will be added by the time of development and they won't be essentials.

### Architecture of library and using in your code

For maximum flexibility and extensibility realization in every is usual Qt plugins. It allows adding support of new API without recompiling all the library, and in the case of inability of using any realization, plugin just won't work. The plugins are booted by the special singleton-manager. Every plugin inform this manager if it can work in this enviroment or not, resulting in thing that manager can call methods in only that plugins, which are allowed in this enviroment.
User just work with simle class QtDockTile that is front-end to this manager. So you can create any number of QtDockTile instance.
For the realization of dock menu Qt QMenu will be used. It is important to know about restrictions on the platform, which you use.

Simple example in code:<br />
<code>
<br />
m_tile = new QtDockTile(this); <br />
m_tile->setMenu(ui->menu);<br />
connect(ui->pushButton, SIGNAL(clicked()), m_tile, SLOT(alert()));<br />
m_tile->setBadge(123); <br />
connect(ui->horizontalSlider, SIGNAL(valueChanged(int)), m_tile, SLOT(setProgress(int)));
<br />
</code>

As you can see, it is very simple!

### Restrictions

#### For Unity
For correct work of API existence of /usr/share/applications \*.desktop icon is essential.

* Badges are only digitals and not less than 0. Else it prints 0
* Exported menu doesn't shows submenu, so it is better not to use them
* If menu is exported in appmenu, it completely doesn't appear
* There is a bug in realization of DBusMenuExplorer, so check state is inverted

#### For Windows

* Only 2 symbols as badges
* Last files from jump lists disappear
* Actions are not supported: switch keys and inactive actions
* Submenu is not supported

### Conclusion

If you want menu to be exported for sure it has to satisfy this requirements:

* No submenu
* No checkable or inactive items
* Little amount of items
* No change after it is setted by setMenu

Two more advices:

* Correct work of dock is guaranteed only in case of single application, so use it with QtSingleApplication or anything like it
* In badges you have to use only positive numbers, that are less than 100

In other cases something may be unavailable on some platform.
All code are licensed under LGPL licence.

qtdocktile's People

Contributors

alekseysidorov avatar dtf avatar torkve avatar hubbitus avatar coolroman avatar magist3r avatar

Watchers

James Cloos avatar

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.