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

Add 'New Tileset...' button when no tileset is opened #1789

Merged
merged 8 commits into from Nov 7, 2017

Conversation

Projects
None yet
3 participants
@RhenaudTheLukark
Contributor

RhenaudTheLukark commented Oct 18, 2017

Feature announced in the issue #1766.

RhenaudTheLukark added some commits Oct 18, 2017

@ketanhwr

Some general suggestions regarding the code style 🙂

Show outdated Hide outdated src/tiled/tilesetdock.cpp Outdated
Show outdated Hide outdated src/tiled/tilesetdock.h Outdated
RhenaudTheLukark RhenaudTheLukark
@bjorn

Thanks for working on this!

I didn't get around to trying it out yet, but here's my comments on the code.

Show outdated Hide outdated src/tiled/tilesetdock.cpp Outdated
Show outdated Hide outdated src/tiled/tilesetdock.cpp Outdated
Show outdated Hide outdated src/tiled/tilesetdock.cpp Outdated
Show outdated Hide outdated src/tiled/tilesetdock.cpp Outdated

RhenaudTheLukark added some commits Oct 24, 2017

@bjorn

I've tried it out but, but here's out it looks on my side:

selection_225

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.

Show outdated Hide outdated src/tiled/tilesetdock.cpp Outdated
RhenaudTheLukark RhenaudTheLukark
@RhenaudTheLukark

This comment has been minimized.

Show comment
Hide comment
@RhenaudTheLukark

RhenaudTheLukark Nov 7, 2017

Contributor

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)

Contributor

RhenaudTheLukark commented Nov 7, 2017

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)

Show outdated Hide outdated src/tiled/tilesetdock.cpp Outdated
@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Nov 7, 2017

Owner

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 int parameter is perfectly valid.

Owner

bjorn commented Nov 7, 2017

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 int parameter is perfectly valid.

@bjorn bjorn merged commit 77def2b into bjorn:master Nov 7, 2017

0 of 2 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Nov 7, 2017

Owner

Thanks! :-)

Owner

bjorn commented Nov 7, 2017

Thanks! :-)

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