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
Keyboard shortcut for next/previous tileset #1238
Comments
There should be no real negative performance impact for having a large number of tilesets. In one of my projects there is a map with 58 tilesets without performance issues. I'm fine with adding a keyboard shortcut for flipping through the tilesets, though I rather doubt that it is an effective way of navigation, especially if you're going to have more than a dozen of them. Much nicer would probably be if you could press a shortcut and then start typing a tileset name to select it. Of course that's a much more complicated feature to implement, but I think we need it also for other things (like opening maps and jumping to objects). Any suggestions for these shortcuts? We have Alt+Left/Right for switching maps, so maybe Ctrl+Left/Right for switching tilesets? |
Thx for the reply. Yep your suggestion might be better, a searchable tilemap list and a shortcut to search will help (it encourages better tileset naming as well). The drawback would be it requires quite a bit screen estate to present its UI properly. Another option might be horizontally scrollable tab view? It will (1) be better than current arrow control (2) make re-ordering easier (you can hold the tab and scroll). I think all I want is to avoid (a) clicking the tileset view dropdown a lot (b) clicking the arrow control a lot. I am fine with clicking on tabs. Ctrl+Left/Right sounds good to me. |
Well, I'm thinking more along the lines of the Locator in Qt Creator, so that it would only require a single text entry field somewhere. Or as done in text editors like Sublime Text, it isn't visible at all and only pops up when used.
I don't understand this suggestion. The tab view is already horizontally scrollable, right? The arrow just exists because the scrolling gets very annoying when you have many tilesets. Note that you can also use the scroll wheel to flip through the tilesets. |
Wait, it's not the case on OSX. Doesn't work with scroll wheel or trackpad. |
Hmm, must be a missing feature of Qt on OS X... It works on Linux and Windows, at least. :-/ |
I am used to this pattern due to being a ST user myself :)
Should I open another ticket to track this? I hope I am not missing something, other part scrolls just fine. |
I will try to set usesScrollButtons explicitly. |
Hmm, actually I just tried it on OS X and the tab bar already uses scroll buttons. The only thing that seems to not work is the mouse wheel to switch between tilesets. I guess that's again a system-specific behavior. |
Right, so that's Qt's QTabBar implementation for wheel events: void QTabBar::wheelEvent(QWheelEvent *event)
{
#ifndef Q_OS_MAC
Q_D(QTabBar);
int offset = event->delta() > 0 ? -1 : 1;
d->setCurrentNextEnabledIndex(offset);
QWidget::wheelEvent(event);
#else
Q_UNUSED(event)
#endif
} So, I could probably override this in a subclass and just enable that part on OS X as well. I guess OS X people will not expect this kind of behavior, but it may be better than doing nothing in this case. |
Thx for going in depth on this issue. I am trying to think of an example of scrollable tab bar on OSX, I think sublime text's solution is pretty nice (without sacrificing individual tab size too much). |
Alright, wheel events will be handled on this tab bar as of change d88813d, to be included in Tiled 0.16. |
I finally decided to go for [ and ], but we can change it when we think of something better, and it can be configured in the Preferences. At least there are shortcuts for this now. :-) |
After making a few maps with Tiled I really start to think a keyboard shortcut for next/previous tileset might be a good idea.
Instead of merging all tilesets into a monolithic large set, I really prefer to have around 10-20 tilesets where I can easily switch between and peek at.
I am not sure the performance impact of having multiple tilesets, maybe that depends on tile engine implementation. Large tilesets (say above 200 tiles per set) are a pain to search through.
Given we have tabs in the tileset view, keyboard shortcut feels like the correct decision for usability and convenience. What do you think?
The text was updated successfully, but these errors were encountered: