Responding to QGtkStyle issues

Archived bsnes development news, feature requests and bug reports. Forum is now located at http://board.byuu.org/
Locked
jensbw
New Member
Posts: 4
Joined: Fri Feb 20, 2009 1:02 pm

Responding to QGtkStyle issues

Post by jensbw »

I'm the developer of QGtkStyle and I'm simply looking into relevant feedback and found this thread using Google. So far I've noticed a few issues that I can comment on:

- Ugly fonts
QGtkStyle does pick up your font settings from GTK directly. However Qt font hinting and subpixel rendering is different from that GTK uses. In Qt 4.5 they will both be using freetype for actual rendering, hence there should be no visible difference so it's preferable not to change the default font. More information can be found here:See http://labs.trolltech.com/blogs/2008/09 ... ng-on-x11/

- Group box ignoring frames
This could be an issue for XFCE. However as QGtkStyle primarily targets GNOME at the moment the default groupbox is implemented to follow the GNOME HIG guidelines which state :
"Using frames with visible borders to separate groups within a window is deprecated. Use spacing and bold headers instead."
Ref: http://library.gnome.org/devel/hig-book ... ow.html.en I guess the primary feedback I take from this is that you would like the groupbox frame to be customizable in designer just like the QFrame.

- Pushbutton focus rect
This is not a known issue. It would be cool if you could verify this with the latest SVN and/or Qt 4.5.0. If it still is a problem, please file a bug including your current gtkrc file here :
http://code.google.com/p/qgtkstyle/

I was also wondering why the driver input comboboxes are custom made and not using the normal Qt implementations. The drop-down button would look a bit more native that way.
byuu

Post by byuu »

Hello, nice to meet you. I'm honored that you stopped by to offer advice, thank you very much.

I hope my responses didn't come off as negative. I really do like QGtkStyle overall. Integration with things like the common file dialogs is really awesome, and overall it works very well. It's just when you're at ~99% accuracy, you end up in that uncanny valley area.

I have one more issue, actually. Whenever I call QFileDialog::getOpenFileName with a default path of "", it will print many GTK+ errors to the terminal window, and you'll end up with a permanent wait cursor with no files visible in the window. It seems to be failing a gtk_path_is_absolute(?) assertion.

Have quite a few bugs I've spotted in Qt, but I think they should go to someone else. Overall the library is extremely impressive, and exceeds my expectations. Thanks a ton to all of you for making this LGPL :)
I guess the primary feedback I take from this is that you would like the groupbox frame to be customizable in designer just like the QFrame.
That's a tough one. If GNOME states they don't want frames, then I guess we have to honor it. I will note that gtk_frame_new() defaults to having a frame still ...

One thing is that my groupboxes didn't look like they did even in the Qt4-config tool: the groupbox title was not bold, and it was indented evenly with the widgets inside it by ~10 or so pixels.

I had to abandon their use anyway, Qt4 as a whole adds a ton of extra space right below the groupbox labels that's difficult to get rid of without falling back to the CSS renderer (which doesn't look very native across platforms.)
This is not a known issue. It would be cool if you could verify this with the latest SVN and/or Qt 4.5.0. If it still is a problem, please file a bug including your current gtkrc file here :
I'm not sure if I want to build Qt SVN on my Ubuntu box, as I'm a big fan of apt-get. I'll definitely be sure to let you know with Qt 4.5 if the problem persists.
I was also wondering why the driver input comboboxes are custom made and not using the normal Qt implementations. The drop-down button would look a bit more native that way.
I didn't think they were custom :/
I prefer code to Qt Designer, though.

Code: Select all

videoDriver = new QComboBox;
driverLayout->addWidget(videoDriver, 1, 0);
...
part.split(";", video.driver_list());
for(unsigned i = 0; i < part.size(); i++) {
  videoDriver->addItem(utf8() << part[i]);
  if(part[i] == config.system.video) videoDriver->setCurrentIndex(i);
}
I'll PM you a link to the WIP source code for my Qt port for reference, in case you're interested. Not asking for help fixing anything, of course. But hopefully it'll be helpful for you in some way.
jensbw
New Member
Posts: 4
Joined: Fri Feb 20, 2009 1:02 pm

Post by jensbw »

I hope my responses didn't come off as negative. I really do like QGtkStyle overall. Integration with things like the common file dialogs is really awesome, and overall it works very well. It's just when you're at ~99% accuracy, you end up in that uncanny valley area.
Don't worry. I really want Qt to look great in GNOME so any constructive feedback is good :)
Whenever I call QFileDialog::getOpenFileName with a default path of "", it will print many GTK+ errors to the terminal window, and you'll end up with a permanent wait cursor with no files visible in the window.
I believe this should already be fixed on SVN and in Qt snapshots. It would help if you could point me to the package you are using so I know which revision you have.
Qt4 as a whole adds a ton of extra space right below the groupbox labels that's difficult to get rid of without falling back to the CSS renderer
The spacing should be similar to that used by other GNOME applications. I have provided a pic of how it looks with Qt 4.5 currently. The dialog on the left uses Qt the one on the right is the GNOME mouse preferences.

Image

I am considering reducing the height by one pixel but more than that would make it seem less native. GNOME is in general very spacious. The issues you describe do sound like a bug though and I'd love to have a reproducible example showing the behavior you describe.

However, in Designer you can actually change the top margin. Just select the groupbox and set the layoutTopMargin to 0. But make sure to test that on other platforms as well.
I didn't think they were custom
No worries. :) I tried the updated version you provided and it certainly looks normal there so it looks like it was fixed already.
jensbw
New Member
Posts: 4
Joined: Fri Feb 20, 2009 1:02 pm

Post by jensbw »

Forgot to mention that you can also tweak the combo box margins programatically with setContentsMargins if you do not use Designer.
Thristian
Hazed
Posts: 76
Joined: Tue Feb 07, 2006 11:02 am

Post by Thristian »

byuu wrote:I'm not sure if I want to build Qt SVN on my Ubuntu box, as I'm a big fan of apt-get. I'll definitely be sure to let you know with Qt 4.5 if the problem persists.
./configure --prefix=$HOME
byuu

Post by byuu »

jensbw wrote:I believe this should already be fixed on SVN and in Qt snapshots. It would help if you could point me to the package you are using so I know which revision you have.
I used svn co to pull down the latest QGtkStyle, about two weeks ago. The main Qt version is 4.4.3.
The spacing should be similar to that used by other GNOME applications. I have provided a pic of how it looks with Qt 4.5 currently. The dialog on the left uses Qt the one on the right is the GNOME mouse preferences.
This is what I get presently:
Image
Cleanlooks

Image
QGtkStyle

Created with:

Code: Select all

QGroupBox *groupbox = new QGroupBox("Groupbox Title");

QVBoxLayout *grouplayout = new QVBoxLayout;

QPushButton *groupbutton = new QPushButton("Groupbox Push Button");

grouplayout->addWidget(groupbutton);

groupbox->setLayout(grouplayout);

layout->addWidget(groupbox);
I'll see if I can build Qt 4.5 SVN on a spare box and let you know how it goes. Will probably be a while, though ...
Forgot to mention that you can also tweak the combo box margins programatically with setContentsMargins if you do not use Designer.
Combo box margins? You mean for the group box? I'll take a look at it, thanks.
jensbw
New Member
Posts: 4
Joined: Fri Feb 20, 2009 1:02 pm

Post by jensbw »

Thanks for the clarification. I can indeed verify that the group box labels will look correct in Qt 4.5 as we have changed the way properties are propagated from the parent.
See http://labs.trolltech.com/blogs/2008/11 ... ion-in-qt/
The problem is that currently your application font defined by your default stylesheet overrides everything, including the group box label. The workaround for 4.4 is to apply the font using QApplication::setFont. But of course in 4.5, you should not have to set the font at all.

Regarding the file dialog. I did try to change defaultPath to "" without reproducing it. And the current QGtkStyle source code for openFilename does :

if (dir.isEmpty())
fileinfo.setFile(QDir::currentPath());

This above code was adde to fix precisely the issue you are having so perhaps you updated QGtkStyle after you added a workaround, meaning you might not be able to reproduce it. Or alternatively checkinstall somehow failed to replace your old version. I'd like to rule out both possibilities before I create a new bug id for it though.
Combo box margins? You mean for the group box? I'll take a look at it, thanks.
Of course :) Do you still have a problem with the button focus rect?

You might want to have a look at the QtIconLoader I blogged about
http://labs.trolltech.com/blogs/2009/02 ... ons-in-qt/
Both KDE and GNOME tend to be heavy on the icons while you could simply leave them out/empty on Windows and Mac. Just one idea to make it feel more GNOME-ish.
Locked