Getting PlatGEnWohl to look Native under GTK based Desktop Managers

Description: General discussion regarding the current engine development.
Moderator: Moderators

Luigifan2010 M
Topic author, Contributor
Contributor
Avatar
Luigifan2010 M
Topic author, Contributor
Contributor
Reputation: 5
Posts: 31
Joined: 29 Mar 2014

Post #1by Luigifan2010 » 31 Jul 2014, 0:13

As you know, there are endless amounts of desktop managers in the Linux world. Some based around Qt, and others based around GTK. Both toolkits are great and have advantages and disadvantages. However, one disadvantage they both have is looking native in their counterparts playgrounds.

For example: I've opened up PGE, a Qt app, and gedit, a GTK app. I'm currently running the MATE desktop environment, a fork of GNOME 2 running Gtk.

Image
As you can see, it's not exactly the most native looking application ever. It's not that big of a deal when running a theme like Clearlooks but in themes like my current, it's kind of a problem.
Luckily, this an easy fix.

Qt5 applications have a way to force styles without needing to recompile or specifically recode the application for your platform/theme. And you don't have to install a special theme. Simply run the application and add the "-style gtk" flag onto the end of it.

Code: Select all

mike@mike-Lenovo ~/Desktop/platgenwohl_complete $ ./pge_editor -style gtk


And hey, check this out. It's alot better looking isn't it?
Image

I don't think it'll ever be exact but it sure is close! AFAIK it does a good job of following the native styles' rules and such.

There's also an environment variable you can set to supposedly force this for every Qt5 application, I couldn't get it to work with PGE however. I did get it to work with KWRITE and probably other KDE apps, if you're into that kind of thing

Code: Select all

mike@mike-Lenovo ~/Desktop/platgenwohl_complete $ export QT_STYLE_OVERRIDE=gtk


Cheers!

Return to “Engine Development”

Who is online (over the past 5 minutes)

Users browsing this forum: 1 guest