Bug 339670

Summary: KCalc's GUI layout glitch
Product: [Applications] kcalc Reporter: Marko Käning <mk-lists>
Component: generalAssignee: Christoph Feck <cfeck>
Status: RESOLVED FIXED    
Severity: minor CC: cfeck, iandw.au, kde-ml, rjvbertin, simonandric5
Priority: NOR    
Version: 2.13   
Target Milestone: ---   
Platform: MacPorts   
OS: macOS   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: kcalc with "Macintosh (aqua)" style
kcalc with "Oxygen" style just after startup
kcalc with "Oxygen" style after clicking into dialog background
Proposed patch
Appearance using "Macintosh (aqua)" theme after using the 1st patch supplied
kcalc 2.13, kdelibs 4.14.1; QtCurve theme
idem, macintosh (aqua) theme
KF5's kcalc with the default "Macintosh (aqua)" style
KF5's kcalc with the "QtCurve" style switched to with '-style=QtCurve' option
kcalc.ui shown in Qt4 (top) and Qt5 (bottom) designed, using the "Macintosh (Aqua)" style that's native on OS X
kcalc.ui shown in Qt4 (top) and Qt5 (bottom) designed, using the QtCurve style
kcalc.ui shown in Qt4 (top) and Qt5 (bottom) designed, using the Fusion style
Fusion style

Description Marko Käning 2014-10-04 16:32:59 UTC
On OSX the layout of kcalc looks completely wrong, when using the default "Macintosh (aqua)" theme (kcalc1.png).

If using e.g. widget style "Oxygen" the layout looks much better, but still has a little glitch regarding the status bar (kcalc2.png) which shows texts "NORM" and "RAD" overlapping with buttons of the GUI.

Clicking into the GUI's dialog background re-renders the dialog with a larger height, now displaying the dialog correctly (kcalc3.png).

Reproducible: Always

Steps to Reproduce:
1. Select widget style in "System Settings"
2. Start kcalc
3. Click onto dialog background



This is probably unavoidable on OSX, as the default Aqua theme is known to be faulty.
Comment 1 Marko Käning 2014-10-04 16:35:35 UTC
Created attachment 88960 [details]
kcalc with "Macintosh (aqua)" style
Comment 2 Marko Käning 2014-10-04 16:36:18 UTC
Created attachment 88961 [details]
kcalc with "Oxygen" style just after startup
Comment 3 Marko Käning 2014-10-04 16:36:42 UTC
Created attachment 88962 [details]
kcalc with "Oxygen" style after clicking into dialog background
Comment 4 Christoph Feck 2014-10-04 20:27:28 UTC
Created attachment 88964 [details]
Proposed patch

First blind guess ... it should make buttons larger and respect the style margins.
Comment 5 Marko Käning 2014-10-04 20:48:36 UTC
Created attachment 88965 [details]
Appearance using "Macintosh (aqua)" theme after using the 1st patch supplied

Yippee, this already does look much better on the left third of the GUI! :)
Comment 6 RJVB 2014-10-04 20:49:19 UTC
FYI: on OS X more so than under Linux, it's important to configure the same font in qtconfig and kde's systemsetting (the default font). This is maybe the reason why I cannot reproduce the issue being reported here.
Comment 7 RJVB 2014-10-04 20:52:50 UTC
Created attachment 88966 [details]
kcalc 2.13, kdelibs 4.14.1; QtCurve theme
Comment 8 RJVB 2014-10-04 20:54:18 UTC
Created attachment 88967 [details]
idem, macintosh (aqua) theme

The macintosh (aqua) theme clearly doesn't like the font I've configured here (Droid Sans 11), but the layout returns to normal as soon as I switch the theme.
Comment 9 Marko Käning 2014-10-04 20:58:23 UTC
(In reply to RJVB from comment #7)
> Created attachment 88966 [details]
> kcalc 2.13, kdelibs 4.14.1; QtCurve theme

My 3rd image for Oxygen looks like yours.
But even with QtCurve I get at first what I've shown as the 2nd image.

So, I wonder how to verify what is qtconfig is using and what kde's systemsettings are. . .
Comment 10 RJVB 2014-10-04 21:07:31 UTC
(In reply to Marko Käning from comment #9)

> So, I wonder how to verify what is qtconfig is using and what kde's
> systemsettings are. . .

qtconfig is in Qt's demo/example applications; build it using the qmake of your Qt installation and it will give you an app with which you can set a certain number of global Qt preferences, like the theme and the default font.
KDE's systemsettings are in the kde-workspace package, but you can also get the font settings kcm with `kcmshell4 fonts`.

BTW, I too have noticed that certain applications drop events or lack an explicit "draw all" step, in my case because windows remain empty. When I launch `kdevelop --ps` the dialog is drawn only when it is activated (meaning sometimes I have to deactivate it first), and `kcmshell4 fonts` gives me an empty window until I resize it.
Both are panels/dialogs, (probably) not KMainWindows, maybe a seasoned KDE dev. has an idea what this means?
Comment 11 Marko Käning 2014-10-04 21:10:37 UTC
(In reply to RJVB from comment #10)
> BTW, I too have noticed that certain applications drop events or lack an
> explicit "draw all" step, in my case because windows remain empty. 

Ho, this is what I have noticed for quite a few KDE apps, including kgoldrunner and others.

Check [http://quickgit.kde.org/?p=macports-kde.git&a=blob&h=0ecd99f3f2bc423f0bf61a93abfa2be8e6fbe052&hb=84af470d16ee68f258e07c35d83d06ec1b54ba64&f=dports%2Fkde%2FTODO.txt this] out
Comment 12 Marko Käning 2014-10-04 21:13:16 UTC
(In reply to Marko Käning from comment #11)

In the TODO.txt it's the key 'd' pointing to kgoldrunner and kdialog, but also ktouch, cantor, kompare and karm show weird empty dialogs.
Comment 13 Marko Käning 2014-10-04 21:18:08 UTC
(In reply to RJVB from comment #10)
> qtconfig is in Qt's demo/example applications; build it using the qmake of
> your Qt installation and it will give you an app with which you can set a
> certain number of global Qt preferences, like the theme and the default font.

I couldn't find that application installed on my KDE4.13 VM...
(But I know it from the OSX/CI system, where I also used to check paths. But I have never dealt with fonts though, up to now.)


> KDE's systemsettings are in the kde-workspace package, but you can also get
> the font settings kcm with `kcmshell4 fonts`.

Yep, that I do know. Thanks to you that app is now also there on OSX! :-)
Comment 14 RJVB 2014-10-04 21:21:03 UTC
(In reply to Marko Käning from comment #13)

> I couldn't find that application installed on my KDE4.13 VM...

Logical, you have to build it yourself. It's something that Digia was apparently so little proud of that the entire possibility of having global preferences settings was removed from Qt5 ... :-/
Comment 15 Marko Käning 2014-10-04 21:23:10 UTC
(In reply to RJVB from comment #14)
> Logical, you have to build it yourself.

Oh, I see. In Qt5 it does come with the out-of-the-box installation.
Comment 16 Christoph Feck 2014-10-04 21:32:31 UTC
Could you please remove the .kde/share/config/kcalcrc file (or wherever it is located on MacOS X)? I am highly curious why there are different frames used for the button renderings, while all of them are just rendered using CE_PushButtonBevel. See also bug 237513.
Comment 17 Marko Käning 2014-10-04 21:39:54 UTC
(In reply to Christoph Feck from comment #16)
> Could you please remove the .kde/share/config/kcalcrc file (or wherever it
> is located on MacOS X)?

rm ~/Library/Preferences/KDE/share/config/kcalcrc 

Restarting kcalc then shows that the problem persists - after having selected statistics mode and the themes discussed here.
Comment 18 Marko Käning 2015-01-20 07:31:52 UTC
OK, this issue is still not solved and is reproduced with the "Macintosh (Aqua)" theme on OSX/CI for KF5 with the lastest git versions of everything involved!

The alternative styles tested so far (QtCurve, Breeze, Fusion and CDE) DO NOT show this glitch.

I'll attach screenshots for KF5...
Comment 19 Marko Käning 2015-01-20 07:33:19 UTC
Created attachment 90536 [details]
KF5's kcalc with the default "Macintosh (aqua)" style
Comment 20 Marko Käning 2015-01-20 07:35:15 UTC
Created attachment 90537 [details]
KF5's kcalc with the "QtCurve" style switched to with '-style=QtCurve' option
Comment 21 RJVB 2015-01-20 11:03:39 UTC
Marko:

That's not the QtCurve style, I think. Compare to my own screenshot (https://bugsfiles.kde.org/attachment.cgi?id=88966).
Identifying the style used is easier when you put kcalc in science mode, and include the settings dialog in the screenshot.

It is probably impossible for now to configure QtCurve for Qt5/KF5, but you can copy its settings from KDE4 to KF5 (anything QtCurve and qtcurve from ~/.kde); the actual settings are in ~/.config/qtcurve/stylerc so those should be shared between Qt4/KDE4 and Qt5/KF5.
Comment 22 RJVB 2015-01-20 17:15:31 UTC
Created attachment 90549 [details]
kcalc.ui shown in Qt4 (top) and Qt5 (bottom) designed, using the "Macintosh (Aqua)" style that's native on OS X
Comment 23 RJVB 2015-01-20 17:16:05 UTC
Created attachment 90550 [details]
kcalc.ui shown in Qt4 (top) and Qt5 (bottom) designed, using the QtCurve style
Comment 24 RJVB 2015-01-20 17:17:14 UTC
Created attachment 90551 [details]
kcalc.ui shown in Qt4 (top) and Qt5 (bottom) designed, using the Fusion style

Fusion for Qt4 from https://code.google.com/p/fusion-qt4/
Comment 25 Marko Käning 2015-01-20 20:42:46 UTC
(In reply to RJVB from comment #21)
> That's not the QtCurve style, I think.

Yes, it looks like it.

> Identifying the style used is easier when you put kcalc in science mode, and
> include the settings dialog in the screenshot.

OK, will do so in the future.

> It is probably impossible for now to configure QtCurve for Qt5/KF5, but you
> can copy its settings from KDE4 to KF5 (anything QtCurve and qtcurve from
> ~/.kde); the actual settings are in ~/.config/qtcurve/stylerc so those
> should be shared between Qt4/KDE4 and Qt5/KF5.

Hmm... Well, I don't really want to mess with it like that. I would prefer to keep everything as vanilla as possible.

1) So, if I do not specify "--style=(Oxygen|Breeze)" I get something, but not really that what I want - well, at least it is NOT "Macintosh (Aqua)".

2) Specifying "--style=Fusion" obviously does something sensible. (Will attach a screenshot.)
Comment 26 Marko Käning 2015-01-20 20:43:18 UTC
Created attachment 90557 [details]
Fusion style
Comment 27 RJVB 2015-01-20 21:02:04 UTC
Did you notice how my screenshots from KDE4 have the kcalc app icon in the title bar, and your screenshots don't? Is that another case of a QSP issue?
Comment 28 Marko Käning 2015-01-20 21:05:44 UTC
(In reply to RJVB from comment #27)
> Did you notice how my screenshots from KDE4 have the kcalc app icon in the
> title bar, and your screenshots don't? Is that another case of a QSP issue?

Yes, I noticed that. I have no idea whether this is a QSP issue or just my OSX/CI installation or its setup... Needs investigation!

Do you also see this on the console:
---
Icon theme "hicolor" not found.
kf5.kiconthemes: "Theme tree: (Oxygen)"
---
when running any Qt5 app?
Comment 29 RJVB 2015-01-20 21:54:07 UTC
No, but why would "pure Qt5" apps look for the hicolor theme from Oxygen?

I don't have anything KF5 installed.

[OT]
I do notice this, though:
QCoreTextFontDatabase: Failed to resolve family name for PostScript name  "BanglaSangamMN"
QCoreTextFontDatabase: Failed to resolve family name for PostScript name  "SinhalaSangamMN"
QCoreTextFontDatabase: Failed to resolve family name for PostScript name  "TeluguSangamMN"
QCoreTextFontDatabase: Failed to resolve family name for PostScript name  "STSongti-SC-Regular"
QCoreTextFontDatabase: Failed to resolve family name for PostScript name  "STSongti-TC-Regular"
QCoreTextFontDatabase: Failed to resolve family name for PostScript name  "BanglaMN"
QCoreTextFontDatabase: Failed to resolve family name for PostScript name  "SinhalaMN"
QCoreTextFontDatabase: Failed to resolve family name for PostScript name  "TeluguMN"
QCoreTextFontDatabase: Failed to resolve family name for PostScript name  "BanglaSangamMN"
QCoreTextFontDatabase: Failed to resolve family name for PostScript name  "SinhalaSangamMN"
QCoreTextFontDatabase: Failed to resolve family name for PostScript name  "TeluguSangamMN"
QCoreTextFontDatabase: Failed to resolve family name for PostScript name  "DFKaiShu-SB-Estd-BF"
QCoreTextFontDatabase: Failed to resolve family name for PostScript name  "BanglaMN"
QCoreTextFontDatabase: Failed to resolve family name for PostScript name  "SinhalaMN"
QCoreTextFontDatabase: Failed to resolve family name for PostScript name  "TeluguMN"
QCoreTextFontDatabase: Failed to resolve family name for PostScript name  "DFKaiShu-SB-Estd-BF"
QCoreTextFontDatabase: Failed to resolve family name for PostScript name  "BanglaMN"
QCoreTextFontDatabase: Failed to resolve family name for PostScript name  "SinhalaMN"
QCoreTextFontDatabase: Failed to resolve family name for PostScript name  "TeluguMN"
QCoreTextFontDatabase: Failed to resolve family name for PostScript name  "Baghdad"
QCoreTextFontDatabase: Failed to resolve family name for PostScript name  "Ayuthaya"
QCoreTextFontDatabase: Failed to resolve family name for PostScript name  "BanglaSangamMN"
QCoreTextFontDatabase: Failed to resolve family name for PostScript name  "SinhalaSangamMN"
QCoreTextFontDatabase: Failed to resolve family name for PostScript name  "TeluguSangamMN"


because I uninstalled a number of (to me) useless fonts.
Comment 30 Marko Käning 2015-01-20 23:56:09 UTC
(In reply to RJVB from comment #29)
> No, but why would "pure Qt5" apps look for the hicolor theme from Oxygen?

Yeah, I always mix this whole style and theme stuff up...
Comment 31 Marko Käning 2015-01-20 23:58:49 UTC
(In reply to Marko Käning from comment #28)
> (In reply to RJVB from comment #27)
> > Did you notice how my screenshots from KDE4 have the kcalc app icon in the
> > title bar, and your screenshots don't? Is that another case of a QSP issue?
> 
> Yes, I noticed that. I have no idea whether this is a QSP issue or just my
> OSX/CI installation or its setup... Needs investigation!

Perhaps it's simply (still) different on KF5?!
Comment 32 RJVB 2015-01-21 00:27:05 UTC
I suppose KF5 applications do show the app icon in the window titlebar on Linux? 
It could of course be that the functions that do that haven't been ported (properly) to OS X yet.

Or they were part of the stuff moved to Qt5, and it was decided that this wasn't needed/wanted on OS X...
Comment 33 Marko Käning 2015-01-21 07:47:13 UTC
(In reply to RJVB from comment #32)
> I suppose KF5 applications do show the app icon in the window titlebar on
> Linux? 

Well, I don't know. But have a look at Plasma on KDE dot at [https://dot.kde.org/2015/01/13/plasma-52-beta-out-testing], where you can't see any icon in the window title.
Comment 34 Marko Käning 2015-04-11 12:19:27 UTC
Adding Mario in the hope of him knowing whom to contact regarding the OSX-default "Macintosh (aqua)" style.
Comment 35 Christoph Feck 2016-05-24 00:55:42 UTC
*** Bug 363423 has been marked as a duplicate of this bug. ***
Comment 37 RJVB 2016-06-09 17:17:18 UTC
Git commit fdfbc7b4da9818841d2e08333698f7b635404b13 by René J.V. Bertin.
Committed on 09/06/2016 at 17:17.
Pushed by rjvbb into branch 'master'.

Fix an alignment issue under the OS X native "macintosh" style

REVIEW: 128004
Committed from host : Portia.local

M  +2    -0    kcalc_button.cpp

http://commits.kde.org/kcalc/fdfbc7b4da9818841d2e08333698f7b635404b13