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

Button layout management wrong #297

Open
kanehekili opened this issue Aug 3, 2023 · 23 comments
Open

Button layout management wrong #297

kanehekili opened this issue Aug 3, 2023 · 23 comments

Comments

@kanehekili
Copy link

kanehekili commented Aug 3, 2023

Resizing the Search Window is virtual impossible, due to a lack of correct layout of the buttons:
image

Observed on debian testing,unstable,now 0.36a-2 amd64 [installed]

Whereas your "special" version (Builddate 2023/03/11) handles that correctly

@kanehekili kanehekili changed the title Button layoutmanangemt wrong Button layout management wrong Aug 3, 2023
@davidbannon
Copy link
Member

Hmm, thats a bit confronting kanehelili. Looking back through my logs, I note that 0.36b fixed a layout issue that I expected no one to notice. But what you see here sure is noticeable ! Originally reported in #292 I was unable to replicate the problem but fixed something I was suspicious of. I guessed its due to some particular combination of libraries and display manager. The fact that you also see it is somewhat alarming. I think I had better try and get 0.36c into debian backports. That will take some time I am afraid, Debian set some barriers to things popping up in backports. And I am away from home, traveling right now.

In the mean time, I suggest you try the one from https://github.com/tomboy-notes/tomboy-ng/releases/tag/v0.36c - I don't remember what I did for your 'special' but expect what ever it was, its included in 0.36c.

Thanks for reporting this, its by nature, quite a nasty and unpredictable bug.

Davo

@davidbannon
Copy link
Member

kanehekili - no more signs of this problem ?

Davo

@davidbannon
Copy link
Member

OK, https://github.com/tomboy-notes/tomboy-ng/wiki/Download_Release has a new release that is also available in Trixie.

So closing this issue, thanks for your report.

Davo

@kanehekili
Copy link
Author

Thanks for maintaining this. I'll update it and report back.

@kanehekili
Copy link
Author

kanehekili commented Jan 30, 2024

Installed latest version of tomboy-ng on debian testing. The Menubar does not respect the theme. Are you using "stylesheets" ?
image

The test-version you have once supplied does it correctly:

image

The layout problem is fixed - should I open a new issue?

@davidbannon
Copy link
Member

Are you using the Debian Repo version ? If so, its a Qt5 app. The colours are determined in a number of ways. I'd need to know your QT_QPA_PLATFORMTHEME and possibly your qt5ct selected theme (if applicable). And your Desktop (ie Gnome, Mate, KDE), and its selected theme. But that said, honestly, when it comes to colours and dark themes, I am just about ready to give up. Every time I turn around, I find something has changed.

Let me have a look when I get a chance, just home from some time away.

Maybe better to report it to Debian ? They will forward it on to me and that will give me a leaver to upload a new version. Its quite a process with Debian ....

(No, stylesheets are not applicable here. I try, as much as possible, conform to QT5 (or 6) colour theme that you set in your Desktop settings. But there are always corner cases, spots where something is unexpected.)

Davo

@davidbannon
Copy link
Member

reopening to deal with Qt5 theme of note form button bar background colour.

@davidbannon davidbannon reopened this Feb 5, 2024
@kanehekili
Copy link
Author

kanehekili commented Feb 5, 2024

I am using QT_QPA_PLATFORMTHEME= gtk2 with my own theme. Same problem with Adwaita dark - so this is not dependent on the theme (as far as I know). My Qt5 or Qt6 apps work with that (e.g. VideoCut ), so I suspect that you are using some stylesheets. Videocut uses the default toolbar. (addToolbar). My Qt Apps also runs with the Platformtheme qt5ct and the "gtk2" setting defined in the dialogs.
There is also a yellow line at the bottom (which I don't mind), but might indicate some kind of color tweaking from your side.
The reason I use gtk2 is, that this seems to be the only way to get QT applications to have an uniform look across GTK3/4 and QT5/6 .
My DE is xfce on debian testing. Arch AUR seems to have an old version from 2021, so I did not test it.

There has been an exhaustive discussion here

@davidbannon
Copy link
Member

Easy part - stylesheets : I do not use stylesheets. See https://github.com/tomboy-notes/tomboy-ng/blob/master/source/uqt_colors.pas - I use the colours identified in your qt5ct config if possible. If qt5ct is not configured, I try to copy colours for the KMemo from other parts of the app (that are presumably set correctly to the OS / Desktop theme. Sadly, that does not always work as some themes are made, usually for gtk2, then translated to Qt5, then translated into my app.

All parts of the application, should, in theory, be using the OS/DE supplied colours except for KMemo, the component that provides the editing space for the note itself and a few components immediately around it. KMemo does need to have it colours manually set. The panel behind the buttons you mention is set to what I call the AltColour, its set, in the case of Qt5, to colour number 3 in the Qt5 colour set, a colour defined as "less bright than the background colour". In most dark themes, its a darkish grey but lighter than background.

I am unsure why I override the OS/DE colour setting of that panel, probably because it did not work well with the default on some other theme. Almost certainly a dark theme I add.

The point here is that I have no control over what colours are set, all I can do is use the colours made available to me by Qt (with very vague recommendations of how to use them.) And test with several well known themes accepting that not all are perfect.

There definitely should NOT be a yellow line visible. The yellow is used when a note has become read only (due to a sync bringing in a new copy) and is the background of a explanation message. I will make some room on my disk, install a XFCE vm and try and replicate. (On MacOS, I cannot make that message invisible so reduce its height to zero, some recent work they may have had unintended effects ??)

Harder part - my tests. So far, I have checked KDE, Gnome and Mate, while results vary, especially if not using qt5ct, in all cases I cannot reproduce your specific problem. My notes (from pre release testing, updated only the Gnome section as my guess was you were using Gnome)

Mate - seems to not follow dark gtk2 or gtk3 themes at all unless you install qt5-style-plugins. Setting QT_QPA_PLATFORMTHEME=gtk2 seems pretty good after that. Does obey qt5ct, Dark and Waves OK but dusk really lacks contrast on note button bar.

Gnome (Wayland) we obey qt5ct if its set to custom theme. And works OK. But ignores a gtk2 or gtk3 setting, why ? Apparently Qt issue ? If qt5ct is set to default (ie should pickup default desktop colours) all the qt5 controlled part of app stays light but Notes window does a dark theme. Thats surprising ! Install qt5-style-plugins appears to have no effect. Looks like Gnome is white-anting Qt apps.

KDE (Wayland) - seems to pick up the dark theme colours without any QT_QPA* settings. Looks fine with the KDE supplied Breeze Dark. Finally something good about KDE.

Gnome and KDE provide only one dark theme each, perhaps trying to minimize this burgeoning theme problem. But nothing to stop end users downloading themes from other sources so must try to support at least some of them. Sigh.

Will try and test on a trixie XFCE VM.

Davo

@davidbannon
Copy link
Member

OK, I can see the effect you describe using XFCE (left hand side of image) if qt5-styles-plugins is installed and QT* is set to gtk2. If you use qt5ct and 'Darker' theme, same system, then you do not see it (right hand side of image). Nor do I see it using Gnome, KDE or Mate. Nor is there an issue using lighter themes. I am afraid its probably down to the colours available in the theme.

TrixieXvariations

I will have a look through the code to see what decisions are made for that particular combination but I expect there is little I can do without upsetting all the other dark theme users.

Davo

@davidbannon
Copy link
Member

davidbannon commented Feb 6, 2024

Attached is a new, unreleased binary. I have set that panel to a fit lighter than the kmemo background but still based on it. I need to see a difference between the background and the button (and search) bar backgrounds or you will get lost.
tomboy-ng.tar.gz

Just un tar it on your desktop and start it from there. You could, if feeling brave, copy it to /usr/bin/. It should show a version number of 0.39+

Please start a new issue here about this, maybe if we get a satisfactory solution, I might ask you to log something with Debian (easy, their entire system is built around an email responder).

Davo

EDIT : altered text about how colour is derived and uploaded a new binary accordingly

@kanehekili
Copy link
Author

It works in a special edition which I am still using:
image

@kanehekili
Copy link
Author

No change in bar color - still gray - the gtk theme defines another color.
QT_QPA_PLATFORMTHEME=gtk2.
I'll change that to qt5c and will report back. TransmissonQT for example works correctly

@davidbannon
Copy link
Member

Hmm, seems my reply did not make it to github, here. Not sure it made it to Kanehekili. Juts to be sure, I will try again.

On 7/2/24 02:07, Kanehekili wrote:

No change in bar color - still gray - the gtk theme defines another color.

It should be a darker grey than previously. I assumed that was your problem. As I have limited colours available and that particular one must be (on a dark theme) a bit lighter than the background, I have derived it from the background.

If you are expecting a distinctly different or specific colour, sorry, I only have a limited set to choose from, I expect LCL only makes some of the colours from GTK2 available. It needs to be visibly different from the background and, for the sake of dark theme users, still dark itself.

QT_QPA_PLATFORMTHEME=gtk2.
I'll change that to qt5c and will report back. TransmissonQT for example works correctly

No, don't bother, that will not be relevant, if you are using qt5ct (and have a configure there) it will work but the colours are now read directly from the qt5ct config. Totally different path. Not the issue we are chasing.

I have never heard of TransmissionQT but I expect its not a FPC/Lazarus application.

Davo

@kanehekili
Copy link
Author

kanehekili commented Feb 13, 2024

Would you mind explaining, why you are altering colors in a QT theme? I checked your code, since my QT_QPA_PLATFORM_THEME is "gtk2" and not "qt5c" it should not change anything. The status bar or any other widget may have distinct background and foreground colors - these are usually defined by themes and not by an application.

@davidbannon
Copy link
Member

I don't change any colors in a Qt theme. With one exception. Anything set by the theme is left exactly how it is. Generally, all components I use in tomboy-ng know how to pick up their colors from a QT theme.

KMemo, the component used to display a note's markup, does not observe the QT theme, it is written from a much lower level and does not know that Qt (or gtk2) even exists. So, I attempt to make KMemo comply with the theme. Thats relatively easy if the Dark Theme is derived from qt5ct, I can read the colours there and through a long and tiresome process of trial and error, apply what seems an appropriate set to kmemo. But if I cannot ask qt5ct, then I have to guess.

The dark theme users I consulted wanted a black as the KMemo background. As luck would have it, and not particularly surprisingly, most dark themes want to set the button panel and the button background to black too. And my beta testers all agreed we needed to see a difference. Some Dark Themes have no borders around components, you cannot see where they stop and start.

So, that one exception I mentioned ? That panel behind the buttons in the edit box. I define it as being a touch lighter than the KMemo background. Not black. I am not sorry, it needed to be done.

If you want I will add a secret command line option, --kcolor and set that panel to any color you define. But, honestly, dark themes are not my thing, I don't like headaches, I have to go by the majority of users opinion and ration my own time to some degree.

Attached is a small app I make to look at qt5 (not exclusively), look at the colors it can show compared to how many different colors in a typical theme. If it gets a QPA_QT_PLATFORMTHEME-qt5ct, it reads that set theme and displays its colors, in either case, it show a number of components and a click on one will show its colors. That includes a status bar you mention. Note that qt5ct seems to provide 20 color slots, but most dark themes just use 5 or 6.

project1.tar.gz

Davo

@davidbannon
Copy link
Member

OK kanehekili, you dragged me out of my sick bed to do this. (Not really, just had a covid19 shot and never handle them very well. Had to do something.

Attached is a much more relevant mini app that displays and names the colours that Qt is being passed by the OS. It does not care how the colors are set, be it qt5ct, a copy of current gtk2 or gtk3 or just the default. While I have tried it with a number of default themes provided by major distros, not one of them can be used to directly apply to KMemo. I need more colors that that. Highlight, selected, background etc.

Please try it with your theme, send me a screen shot with the index of this color you need as the background panel. But I cannot promise anything, I must make the app usable with the main stream, default themes distros provide "out of the box".

The good thing (from you point of view, not mine) is that I have proved to myself that I can read the Qt Application Theme colors. Its certainly neater than reading the qt5ct config file. Maybe ....

Davo

qt_colors.tar.gz

@davidbannon
Copy link
Member

Right, from what I have learnt about Qt Palette, I modified -ng to use exactly the colors in that palette. Results, as I expected where, in my humble opinion, very disappointing in most of the themes I tested (20 odd). So, again, I override specific colors because most themes simply do not have enough colors.

Attached is the resulting binary BUT I have added a new (Qt only) command line switch that prevents my overrides. So, if you want the strict Qt theme colours please try -

./tomboy-ng --strict-theme

It is guaranteed not to use any color except ones from the indicated themes, but, obviously no guarantee that it will necessarily use them as you might expect. This switch will be Qt only, given the effort required to work out how to use the relatively well documented Qt Palette, I have no intention of trying to do the same for the obsolete gtk2.

Davo

tomboy-ng.tar.gz

@kanehekili
Copy link
Author

kanehekili commented Apr 14, 2024

Dave, I appreciate your efforts. But gtk2 has been -obviously - the only way to adapt the distros GTK theme with a QT application. My objective is to have GTK3/4 themes correlate to Qt5/Qt6. Since I came to the conclusion that GTK and Gnome is a dead end (whereas Qt5/Qt6 is not not) my own apps are written in Qt. Since I'm using XFCE (which is GTK bounded) the only way to get QT and GTK a uniform look & feels was gkt2. If you have a better idea let me know.

@davidbannon
Copy link
Member

Hi kanehekili, I am afraid I really do not understand just what you want. But I will try.

Most users who want their Qt apps to comply with a (eg) gtk2 or gtk3 theme use qt5ct (or qt6ct). And that mostly works OK. However, as I mentioned, the KMemo component requires manual setting of colours, it does not follow any theme. So, if left to its own devices, it will always look like typical gtk2 light theme but not follow any particular theme. So, I try to map the theme colours onto KMemo. If you don't like that, I also provide, in settings, a way to set the KMemo colours directly.

As most themes have less different colours than tomboy-ng actually needs (I have no idea why) thats sometimes necessary.

I sent you a small app to display Qt colours and I sent you a tomboy-ng with a different approach yet again to colours but not received any feed back. If I am to help you, you really, really, need to be a bit more specific about just where the colours are so wrong and what you would rather see instead. I cannot guarantee to make it exactly what you want but will try to accommodate your needs if you tell me what they are.

Davo

@davidbannon
Copy link
Member

kanehekili, just one more follow up here. I have been testing prior to a 0.40 release and not some different results with different distro xfce. In particular I note with Qt5 app (any Qt5 app I suggest) -

Fedora 39 Xfce seems to follow theme quite well, no help needed.

Ubuntu 24.04 Xfce needs qgnomeplatform-qt5 and QT_QPA_PLATFORMTHEME=gnome is needed.

I am endlessly surprised (and annoyed) at the diversity of distros, I don't know which distro / version you use.

I also note, twice in the above text you talk about setting QT_QPA_PLATFORMTHEME to "qt5c", I expect this is just a typo, but the correct value is "qt5ct".
Davo

@kanehekili
Copy link
Author

kanehekili commented Apr 19, 2024

Davo, I am using your software @ Debian testing. As I said before: I am writing QT5/QT6 applications on GitHub that are accepting the colors of the configured GTK theme by using either gtk2(if the theme still has a gtk2 definition) or qtct5 in QT_QPA_PLATFORM_THEME. Did not test my stuff with qt6. But this thread refers to a wrong layout (which you have been fixed) and not to the colors, which should be a different issue/thread. Try your software with my theme: https://www.pling.me/p/1378907 which does support gtk2. Writing UI code for Linux is indeed a pain - too much freedom, obviously.
On the long run, I'm still missing the possibility to sync my notes with another computer (which tomboy could via ssh) - but this is a different issue altogether.
I appreciate your efforts keeping the tomboy idea alive - so my objective is to help, not to criticize.

@davidbannon
Copy link
Member

Davo, I am using your software @ Debian testing.

OK, thats 0.39. If given the correct settings, the Qt5 tomboy-ng definitely follows the (eg) gtk2 themes on the Xfce platforms I have tested, but I have not tested Debian Testing with XFCe recently. See https://github.com/tomboy-notes/tomboy-ng/wiki/System-Tray-on-Linux#linux-desktop-and-distribution-matrix for my current test matrix.

But this thread refers to a wrong layout (which you have been fixed) and not to the colors, which should be a different issue/thread.

Yes, I have given up asking people start a new thread for a new issue.

On the long run, I'm still missing the possibility to sync my notes with another computer ..

https://github.com/tomboy-notes/tomboy-ng/wiki/File-Sync-with-tomboy-ng and that includes syncing over sshfs, a much unrecognized tool IMHO. You can also sync via github (over ssh or https) with the added benefit of making you notes available on your phone https://github.com/tomboy-notes/tomboy-ng/wiki/Github-Sync . But there is a problem with 0.39 and openssl 3.0 (a combination you will get with Debian Testing). My next release, beta https://github.com/tomboy-notes/tomboy-ng/releases/tag/v0.39d solves this unfortunate problem. Will hit Debian Testing soon.

I agree your theme looks good, does not seem to have the accute lack of colors so fashionable at present. But I don't use dark themes, don't like the headaches they induce. So, I only use dark themes when testing and then I test only distro supplied ones. I have 29 VMs for my build and test program, don't want to make it any more complicated.

Davo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants