Image background does not work #3

開放中
建立於 4 年前MicheleC · 19 則留言
擁有者

This is a spin-off issue from issue #2, to separate the scope from the original issue.

For a long description, see various comments on issue #2. In brief, background image does not work well, as shown in these two examples:

http://oscomp.hu/depot/withnobg.png

http://oscomp.hu/depot/withbg.png

This is a spin-off issue from issue #2, to separate the scope from the original issue. For a long description, see various comments on issue #2. In brief, background image does not work well, as shown in these two examples: http://oscomp.hu/depot/withnobg.png http://oscomp.hu/depot/withbg.png
tch 已留言 3 年前
協作者

I think there is a typo there: you said does now work; isn't it does not work? Or am i wrong and does it work now?

I think there is a typo there: you said *does now work*; isn't it does *not* work? Or am i wrong and does it work now?
發布者
擁有者

Sorry to disappoint you @tch, it was a typo which I have now corrected. It is "not" and not "now".

On a side note, I remember is one of your comments on bugszilla, you mentioned the backgroud thing was working before version 1.6 (?) and then it stopped after that.

If that is the case, would you be able to test what was the latest version at which this was working? That would easy the process of troubleshooting this issue, since we can compare a working implementation with the current version.

Sorry to disappoint you @tch, it was a typo which I have now corrected. It is "not" and not "now". On a side note, I remember is one of your comments on bugszilla, you mentioned the backgroud thing was working before version 1.6 (?) and then it stopped after that.<br/> If that is the case, would you be able to test what was the latest version at which this was working? That would easy the process of troubleshooting this issue, since we can compare a working implementation with the current version.
tch 已留言 3 年前
協作者

I think you have confused something; this was never working on KDE3 or TDE. It was working on KDE4, but only after QtCurve 1.8.0.
I had a picture of a KDE4 screenshot, but i could not find it.

I think you have confused something; this was never working on KDE3 or TDE. It was working on KDE4, but only after QtCurve 1.8.0. I had a picture of a KDE4 screenshot, but i could not find it.
發布者
擁有者

Oh I see, I must have misunderstood some of your comments, or simply remembered that wrong. Thanks for the update.

Oh I see, I must have misunderstood some of your comments, or simply remembered that wrong. Thanks for the update.
tch 已留言 2 年前
協作者

Any update on this, why does the background not work with TQt?

Any update on this, why does the background not work with TQt?
發布者
擁有者

Hi @tch and happy new year.
No updates, to be honest I haven't been able to look into it. I don't want to make an empty promise, so I can't give you a date on when I will take a look. It will probably sit here for quite a while since there are so many things to do in TDE and the time is always limited.
It probably sounds disappointing, but I am jsut being honest here :-)

Hi @tch and happy new year. No updates, to be honest I haven't been able to look into it. I don't want to make an empty promise, so I can't give you a date on when I will take a look. It will probably sit here for quite a while since there are so many things to do in TDE and the time is always limited. It probably sounds disappointing, but I am jsut being honest here :-)
tch 已留言 2 年前
協作者

HNY to you too.
Well, too bad, but understandable, this is not a priority.

HNY to you too. Well, too bad, but understandable, this is not a priority.
發布者
擁有者

If you wish to have a look into adding support for background image, I will be happy to review and provide feedback. I don't know how big the effort would be, but nothing to lose in trying :-)

If you wish to have a look into adding support for background image, I will be happy to review and provide feedback. I don't know how big the effort would be, but nothing to lose in trying :-)
tch 已留言 2 年前
協作者

The support should be already in, it just does not work. Unfortunately i don't know how Qt works, so currently i don't think i could fix it. But never say never.

The support should be already in, it just does not work. Unfortunately i don't know how Qt works, so currently i don't think i could fix it. But never say never.
發布者
擁有者

If I remember correctly from the trail of 10+ year old messages, the support was there when tested on qt4, after modifying some config files. Also one of your comment above seem to confirm that. so it could well be that the code is there in QtCurve but it relies on something that is not included in TQt3 at the moment. If we find what, we can of course add it to TQt3, that is not a problem.

If I remember correctly from the trail of 10+ year old messages, the support was there when tested on qt4, after modifying some config files. Also one of your comment above seem to confirm that. so it could well be that the code is there in QtCurve but it relies on something that is not included in TQt3 at the moment. If we find what, we can of course add it to TQt3, that is not a problem.
tch 已留言 2 年前
協作者

In common/config_file.c at line 519:

        if(0==memcmp(str, "file", 4))
            return IMG_FILE;

So, there should be support for it. It's function the toImageType() is used in macro CFG_READ_IMAGE. In where the subproperty .file is processed if the result is IMG_FILE. This macro is used at line 2027 and 2028:

            CFG_READ_IMAGE(bgndImage)
            CFG_READ_IMAGE(menuBgndImage)

We've been trying to set bgndImage.file to something and that was what was never worked.

According to loadBgndImage() at line 842 this function can only load SVG-s if it was compiled as C++ and anything via gdk_pixbuf_new_from_file_at_scale() if it's compiled as C.
However, this function is nowhere called in the entire source.

I opened the source of the Qt4 version of QtCurve 1.8.5 and this function is called in style/qtcurve.cpp at line 11695 in the functions Style::drawBackgroundImage() and Style::drawBackground(). These functions are missing in the TQt version. In the Qt4 versions they're called from Style::eventFilter() and Style::drawPrimitive(). The first is also not present in the TQt version, but it has similar ones like addEventFilter() and such, but the latter one is what we have interest right now and that is present at line 3271 in the TQt version. And while the Qt4 version has the case QtC_PE_DrawBackground inside the switch, the TQt version does not have case PE_DrawBackground.

So, wherever the background is painted in the TQt version, it should call this function with PE_DrawBackground, after the relevant part has been copied from the Qt4 version.

BTW, in the TQt version, in common/common.h TQtC_PE_DrawBackground is defined, but nowhere else used. Also, there is a kwin directory in the Qt4 version, but neither kwin, nor twin exists in the TQt version.

In `common/config_file.c` at line 519: ``` if(0==memcmp(str, "file", 4)) return IMG_FILE; ``` So, there should be support for it. It's function the `toImageType()` is used in macro `CFG_READ_IMAGE`. In where the subproperty `.file` is processed if the result is `IMG_FILE`. This macro is used at line 2027 and 2028: ``` CFG_READ_IMAGE(bgndImage) CFG_READ_IMAGE(menuBgndImage) ``` We've been trying to set `bgndImage.file` to something and that was what was never worked. According to `loadBgndImage()` at line 842 this function can only load SVG-s if it was compiled as C++ and anything via `gdk_pixbuf_new_from_file_at_scale()` if it's compiled as C. However, this function is nowhere called in the entire source. I opened the source of the Qt4 version of QtCurve 1.8.5 and this function is called in `style/qtcurve.cpp` at line 11695 in the functions `Style::drawBackgroundImage()` and `Style::drawBackground()`. These functions are missing in the TQt version. In the Qt4 versions they're called from `Style::eventFilter()` and `Style::drawPrimitive()`. The first is also not present in the TQt version, but it has similar ones like `addEventFilter()` and such, but the latter one is what we have interest right now and that is present at line 3271 in the TQt version. And while the Qt4 version has the `case QtC_PE_DrawBackground` inside the `switch`, the TQt version does not have `case PE_DrawBackground`. So, wherever the background is painted in the TQt version, it should call this function with `PE_DrawBackground`, after the relevant part has been copied from the Qt4 version. BTW, in the TQt version, in `common/common.h` `TQtC_PE_DrawBackground` is defined, but nowhere else used. Also, there is a `kwin` directory in the Qt4 version, but neither `kwin`, nor `twin` exists in the TQt version.
發布者
擁有者

Thanks for looking into the code and provide some hints. I will take a look sometime this week and come back with feedback. Let's see if we can get something started perhaps.
If some required functions are not included in TQt3, we may need to backport code from Qt4.

Thanks for looking into the code and provide some hints. I will take a look sometime this week and come back with feedback. Let's see if we can get something started perhaps. If some required functions are not included in TQt3, we may need to backport code from Qt4.
發布者
擁有者

@tch apologies for not having yet looked at your suggestions. I started too many thing in the last 4 weeks and all of there were not finished. I have now made a list and I am going through one item at a time and complete them. This issue is on that list, will come back to it in a reasonable short time.

@tch apologies for not having yet looked at your suggestions. I started too many thing in the last 4 weeks and all of there were not finished. I have now made a list and I am going through one item at a time and complete them. This issue is on that list, will come back to it in a reasonable short time.
tch 已留言 2 年前
協作者

No problem, take your time, this is no priority.

No problem, take your time, this is no priority.
發布者
擁有者

@tch
sorry for the long delayed answer. I looked at your comment and into the code. It seems we just need to integrate some missing code from TQt4 version of qtcurve. If you wish to work on it and create a PR, I will review when ready. If not, I can work on it but probably not before a couple of months.

@tch sorry for the long delayed answer. I looked at your comment and into the code. It seems we just need to integrate some missing code from TQt4 version of qtcurve. If you wish to work on it and create a PR, I will review when ready. If not, I can work on it but probably not before a couple of months.
發布者
擁有者

Event filter exists in TQt3 too, they are at TQObject level. We need to install an event filter if we want an event to be capture in advance, but as you mentioned we may not needed for the scope of this issue.

Event filter exists in TQt3 too, they are at TQObject level. We need to install an event filter if we want an event to be capture in advance, but as you mentioned we may not needed for the scope of this issue.
tch 已留言 2 年前
協作者

Currently i am buried under work too. Also i have limited knowledge and experience in Qt, although this might be a good time to start getting deeper. But not right now, maybe next week. If you can help me about what is missing and where, then i can try to backport those codes from Qt4.

Currently i am buried under work too. Also i have limited knowledge and experience in Qt, although this might be a good time to start getting deeper. But not right now, maybe next week. If you can help me about what is missing and where, then i can try to backport those codes from Qt4.
發布者
擁有者

No worries @tch, take a look when you have time. I didn't look into Qt4 version of qtcurve, but based on what you mentioned in your comment, we need to add a case to the switch to draw the background image and call the loadBgndImage() function. If we are lucky it could be a small change :-)

No worries @tch, take a look when you have time. I didn't look into Qt4 version of qtcurve, but based on what you mentioned in your comment, we need to add a case to the switch to draw the background image and call the loadBgndImage() function. If we are lucky it could be a small change :-)
tch 已留言 2 年前
協作者

Yeah, that's what i'm hoping for, that it only will be a small tweak. :)

Yeah, that's what i'm hoping for, that it only will be a small tweak. :)
登入 才能加入這對話。
未選擇里程碑
沒有負責人
2 參與者
通知
截止日期

未設定截止日期。

先決條件

未設定先決條件。

參考: TDE/tde-style-qtcurve#3
載入中…
尚未有任何內容