Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add 'New Tileset...' button when no tileset is opened #1789
I've tried it out but, but here's out it looks on my side:
There's two problems here:
- The button didn't receive the size it needs for the label to fit properly.
- I think the button should be centered.
You'll need to set a layout (probably
QGridLayout) on the
NewTilesetView (which I think would be better named
NoTilesetWidget) that will apply the size preferences of the button and to which you can add
QSpacerItem instances for centering the button. You could check out
noeditorwidget.ui to see how this could be achieved and either do the same in code (see the generated
ui_noeditorwidget.h when in doubt) or also make a
.ui file for this widget.
I tried to center the button, but no matter which way I took the problem from, I couldn't do better than that.
This is a simple task, yet somehow the QGridLayout widget is not taking the whole space the QDockWidget provides, so the button is centered horizontally but not vertically.
I surrounded it with QSpacerItem objects, but I couldn't center it vertically anyway.
Tell me if this is good enough (I really hope it is)
Of course it isn't good enough to have a bunch of code sitting there not achieving what it is meant to do. :-)
It wasn't easy for me either to find out what was going on though. A compiler warning would have certainly helped, but in C++ passing an enum value to an