Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make tdesktop look native / Do not set Qt style to win by default #987

Closed
ManuelSchneid3r opened this issue Aug 10, 2015 · 42 comments
Closed

Comments

@ManuelSchneid3r
Copy link

Telegram does not use the gtk style which uses gtk+ engine to render the widgets. Please do not do this. Just do not set it manually at all. As far as I know qt takes the correct style automatically.

Further reads:
http://doc.qt.io/qt-5/qstyle.html#details
http://doc.qt.io/qt-4.8/qgtkstyle.html#details

@ManuelSchneid3r ManuelSchneid3r changed the title Make Tgram look native / Do not set Qt style to win by default Make tdesktop look native / Do not set Qt style to win by default Aug 10, 2015
@Yanpas
Copy link

Yanpas commented Aug 14, 2015

Also stop using Open Sans, distance between symbols in some alphabets (russian e.g.) is too big

@ghost
Copy link

ghost commented Sep 4, 2015

Linux users want native file dialog and tray menu! QFileDialog does not use the native dialog windows by default?

@telegramdesktop
Copy link
Collaborator

I do nothing with the styles, but I use Qt static build, perhaps that is the cause of non-native look.

@nortexoid
Copy link

Proper theming would be nice, but native picker would be even better. I don't how they do it, but Chrome on linux manages to chooses the gtk picker on Gnome and the kde picker ("KDE File Dialog Widget") on KDE. I would at least be happy with proper theming!

@ManuelSchneid3r
Copy link
Author

@nortexoid This would introduce unneccesary dependencies. Qt way is to do it platform independent.
@telegramdesktop At least the style set manually gets overidden.

@Yanpas
Copy link

Yanpas commented Sep 9, 2015

@ManuelSchneid3r Why would it introduce dependecies? Make algorithm like: if there is gtkpeeker - use gtkpeeker, if there is KDE-file-dialog - use kdefile dialog. Otherwise use native. Chrome doesn't have any dependencies

@nortexoid
Copy link

@Yanpas Sounds right to me. The Qt5 build of QupZilla I'm using doesn't have any GTK/KDE dependencies but it still allows the use of native file picker.

@solbjorn
Copy link

solbjorn commented Sep 9, 2015

@Yanpas, Qt-based applications should automatically use system-wide look without any algorithms. As @ManuelSchneid3r said, currently there is an overrride of default style in Telegram code (through fake args), that prevents it.

@Lesik
Copy link

Lesik commented Sep 11, 2015

Everybody seems to be talking only about looks. Sure, looks are important, but it's not just about looks. Functionality is also impaired!

For example, mounted network drives, or "favourite places" are not shown in Telegram's file picker, although they exist in the native file picker. Another thing is that there is no file preview of the selected file on the right side. These are useful things and it's really annoying to not have those in the desktop client.

@orschiro
Copy link

I completely subscribe to @Lesik's comment. Thank you for highlighting the visual impairments that affect productivity directly!

@michaldaniel
Copy link

Please. File picker is really annoying to use and that is big shame considering how well Telegram works with media.

@telegramdesktop
Copy link
Collaborator

@michaldaniel If it is something easy and I just do not know how to do that, a pull request fix will be much appreciated. But it should not bring any new dependencies for the resulting binary (it should check library availability at runtime and use them only when they are available or static link them).

@funksen
Copy link

funksen commented Nov 11, 2015

the main problem is not the style, but the lack of a picture preview

as a workaround I just use the default filebrowser and drag the image to the telegram window which works just perfectly

@orschiro
Copy link

as a workaround I just use the default filebrowser and drag the image to the telegram window which works just perfectly

Cool workaround. Thanks for sharing! :)

~ Robert

@michaldaniel
Copy link

@telegramdesktop I have no idea what is the reason, as far as I know QT should use GTK by default if not overriden. I'll give it a try soon anyway as I love Telegram. Don't really count on much tho, it's not like I've done any QT development before.

@orschiro
Copy link

@michaldaniel and others,

hluk, developer of CopyQ, has successfully done the same here.

Maybe you can draw some inspiration?

~ Robert

@ManuelSchneid3r
Copy link
Author

Just to clarify as discussed in #982, this issue is about the style in general, not the filechooser. These are two different issues and #982 should be reopened for Lesiks arguments. If you check orschiros link you will see, that there even the Qt filedialog is rendered with the native renderer and blends in well with the set desktop theme.

As said the context menu of the systray icon is affected and presumably every not explicitely styled widget too.

Image

What prevents Telgram widgets from beeing rendered with the native renderer is this line in the code:

QByteArray args[] = { "-style=0" }; // prepare fake args

Is this fake arg really needed?

Just to show the effect: My own Qt application started without parameters: (Well integrated Vertex theme)
Image
My own Qt application started with --style=0 parameter: (Ugly fallback Winlike theme)
Image

Sorry for the tons of reedits.

@AndydeCleyre
Copy link
Contributor

@telegramdesktop, why is the style explicitly set to zero? What is the purpose of "fake args?"

@TotalKrill
Copy link

I am using Manjaro linux, tried to compile the binary and removing the "--style=0" fake argument from the binary. I can set environment variables for different apps but i cannot get the Telegram binary to switch to the native file-dialog

QTCreator switches correctly if i change my environment variables though...

@ManuelSchneid3r
Copy link
Author

Just to clearify again this bug is NOT about the filechooser. For filechooser check #982.

@vermeeren
Copy link

vermeeren commented Jul 2, 2016

@telegramdesktop @john-preston I've been trying to get portable builds of a patched telegram I maintain for a few days. And it seems that this can be fixed more properly by adding -no-gtkstyle -no-glib to the Qt build options.

After this is works on a Xubuntu 16.04 system without the -style=0 argument. I cannot confirm how this might impact other platforms.

For others interested in build scripts (main is ubuntu_xenial atm) and what not, check out:
https://git.mel.vin/telegram_desktop/builds

@BOOtak
Copy link
Contributor

BOOtak commented Jul 3, 2016

@telegramdesktop @ManuelSchneid3r I've made PR for it #2221 by applying qgtk2 theme engine

@vermeeren
Copy link

@BOOtak I still find it rather odd that a Qt application gives me a GTK file picker of any sort since I use KDE myself. With this PR however I doubt that -no-gtkstyle -no-glib can be added to the Qt configure arguments. Which effectively means -style=0 needs to be forced still.

@john-preston
Copy link
Member

I've added -no-gtkstyle in the latest 0.9.57 alpha version (instead of "-style=0" fake param).
I cannot let Qt to load gtk, because it loads gtk-2, while I sometimes load gtk-3 for libappindicator3 and everything crashes.
I'm using gtk file dialog in 0.9.57 alpha version when it is available.

@png2378
Copy link

png2378 commented Jul 8, 2016

Works great for me, thanks! (elementary OS 0.4)

@ManuelSchneid3r
Copy link
Author

@john-preston Note that this option changes in Qt 5.7

@michaldaniel
Copy link

@ManuelSchneid3r Looks like they are replacing it with "-no-gtk" or am I reading this wrong?

@john-preston
Copy link
Member

@ManuelSchneid3r I'm not moving to Qt 5.7 in the near future, at least widely — they drop support for many versions of Windows and one more OS X. I'm still not ready to develop two versions for Windows like I do for OS X :/

@TotalKrill
Copy link

The usage of the GTK filechooser is a big improvement to the software, what is the stance on making it optional to provide your own theme to the application and how hard would it be to implement?

@KAMiKAZOW
Copy link

The usage of the GTK filechooser is a big improvement to the software

No, it is not and worst of all --no-gtkstyle does not work in 0.10.1

@AndydeCleyre
Copy link
Contributor

@TotalKrill and @KAMiKAZOW

I think everything regarding theming will be hacky, rigid, and partial until (if) #1815 gets prioritized.

@YtvwlD
Copy link

YtvwlD commented Sep 13, 2016

@KAMiKAZOW Yes, this is a bit annoying if your desktop environment uses Qt.

@Aokromes
Copy link
Collaborator

Aokromes commented Nov 8, 2016

#667 ?

@theel0ja
Copy link

image
Context menu has been fixed in 1.0.26.

@Aokromes
Copy link
Collaborator

#2958 imho better ticket.

@stek29
Copy link
Contributor

stek29 commented Dec 13, 2017

@Aokromes they're a bit different, this one is for Linux :)

@stek29 stek29 added the linux label Dec 13, 2017
@Aokromes
Copy link
Collaborator

maybe, but it's sort of generic issue, people wanting a setting to allow to select how GUI is :)
cc #4358

@ManuelSchneid3r
Copy link
Author

Actually this one is solved for me. Everything looks fine.

@github-actions
Copy link

github-actions bot commented Mar 8, 2021

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests