Search This Blog

Sunday, December 11, 2011

New job

Since last November 14 I am working for basysKom. At last a job to work with KDE :-)

I am working in the Contour project, which is part of Plasma Active. One of the things I am working on is a replacement for the shutdown dialog used in KDE. The intention is make it more suitable for touchscreen devices, like the ones that Plasma Active is target to. The current result is this:

Ok, I admit we need to improve this. Well, the fact it has only three big buttons is intentional, the less buttons the less problems to use and big buttons are easier to press. The implementation is in branch ksmserver/qml-shutdowndlg of git:// and it is made partially in C++ and partially in QML. This mini-project is being a good way to learn QML, maybe in the (not near)  future I can use what I have learnt in Plasma NM.

To implement that simpler dialog I did not have many problems. On the other hand the replacement for the current dialog has been giving me some headaches to implement all its look-and-feel, specially the button's context menu. It's  not that difficult to implement static context menu in QML, but adding items dynamically is more difficult. Another problem in the current implemenation is the lack of tab order and some other keyboard for features, such as default widget when pressing the ENTER key and label's accelerators. I have not found how to do use those features in QML, maybe because QML is target to thouchscreen and not keyboard use.

This weekend I have finished to implement all features except the keybord features:


And it works with other Plasma themes:




And here the button's context menus (notice the small triangle on the buttons):

If you want to try it you can do it in KDE SC 4.7 too. You need to compile plasmacomponents from kde-runtime master first:

git clone git://
mkdir kde-runtime/build
cd kde-runtime/build
cd plasma/declarativeimports
make && make install

Then you need to compile the branch mentioned earlier:

git clone git://
cd kde-workspace
git checkout ksmserver/qml-shutdowndlg
mkdir build
cd build
cd ksmserver
make && make install

Update 12/Dec/2012: some people asked how the dialog looks like with compositing disabled. Here it is:


friesoft said...

Great work :) Looks very cool :)

How does it look like in non compositing mode? Unfortunately my intel system is not able to enable compositing >.<

Lamarque said...

The dialog looks exactly the same. It does not use any 3D effect, just SVG images.

tuliom said...

Congratulations for your new job!

BajK said...

One thing I hate in KDE are those dropdown menus on buttons; you have to click and hold (for like two seconds) to make the menu appear.
The options for Standby and Suspend-To-Disk should be much more obvious und much easier accessible :(

Fri13 said...

It does look good sizes and order for tablets.

Btw, contact artists who made those icons and ask two small changes.
1) Add a keyhole to lock so it is clearly a lock
2) Change a wierd sleep to "Zzz" or even a "II" as pause.

Just great work and very wonderful to hear that another KDE member has got job related KDE!

Lamarque said...

@tuliom, obrigado :-) O contrato é até o final de abril, vamos ver se será renovado, espero que sim.

@BajK, for your happiness button's drop-down menus are deprecated in Qt 4, so probably they will be gone in Qt 5. I am developing a replacement for the current dialog, so it should mimic all aspects of the current one. But do not worry, it is in QML, anyone can change how it looks.

My first implementation just stacked all buttons and guess what, it was horrible. There can be seven buttons, not counting the reboot options, which in my case are 5 in number. Imagine 12 buttons stacked :-/ For sure the less used ones should be hidden.

In my second implementation I did not use button's drop-down menu, but then I needed at least two clicks for straight shutdown and straight restart. Besides, it also had to increase the dialog size to show/hide the less used items, which does not work automatically for every Plasma themes (I do not know why). I had to add a Timer to trigger a method to force the resizing in those cases.

All in all the current implementation is the less problematic one, although it took me a lot of time to figure out a way to dynamically add items to the menus and there is still a drawback: I can only pass attributes to the MenuItem, no slots, this is a QML limitation. If you look at the source code you will see how I solved this problem. It is not a master piece of software engineer but works.

@Fri13, those icons are not final. I just needed some icons to create the first version. The icons are too colorfull for current Plasma Active's theme. They will be changed.

Anonymous said...

We will finally get rid of black triangles with no composition?

Lamarque said...

@Anonymous, well I do not think so because I guess real transparency is not possible without compositing. Probably that is why the screen background gets totally black here when I disable compositing and press Ctrl+Alt+Del.

Anonymous said...

@Lamarque yeah but why one corner is rendered properly? I'm talking only about corners background not whole applet transparency (couse this one needs compositing)

Lamarque said...

I do not know why only one corner gets rendered correctly. What I know is that for real transparency compositing is required. Without compositing the window manager has to do the job of composing the final image, which usually is implemented by taking a screenshot of the background and them overlying the opened windows over it.

The problem is that windows are always squares in Xorg, so when the window manager takes a window's square to overlay, it automatically picks the "triangles" from the screen's background to complete the rounded borders. Usually the screen's background is black, that is why the black triangles.

I just do not get why only one corner does not have the "black triangle". All corners should have it as far as I know.

Anonymous said...

Will it use the current font size set by the current user?
Eg: All my font are set between 14 to 16 but actually this dialog still use a small one. (9 I believe!)

Lamarque said...

@Anonymous, the fonts there are 11pt for the "Logging out in %1 seconds" label and 12pt for the button's text. My notebook's LCD is 1600x900, but with 120 DPI. The fonts increase if you increase the desktop fonts using systemsettings.

Anonymous said...

It is a good news that your new version will reflect that.
I rather change the font size than the dpi that I keep at 96 PPP.

Will it be the current user setting?
user 1: 96 PPP, menu font size (I don't which one you are using) set to 16 or more.
user 2: 120 PPP, menu font size set to 12.

It is very important as I am already using my KDE desktop as a media center where I can be up to 2m from the 27' screen.

Lamarque said...

@Anonymous, right now the minimum font size for the "Logging out in %1 seconds" label is hardcoded to 11pt, for the buttons it is 12pt. The fonts can increase but not shrink.

I did not change my DPI setting. Xorg automatically set it to 120 DPI on start according to /var/log/Xorg.0.log.