ProjectMode: Alwyas show at least one target

Even though that target is not usseable at that width, this looks
better.

Change-Id: If985808bcde6c0a836e4d6085536d0a1d9023c4d
Task-number: QTCREATORBUG-14182
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
Daniel Teske
2015-03-23 14:44:37 +01:00
parent 9301138540
commit b727c15a53

View File

@@ -239,7 +239,7 @@ QSize TargetSelector::sizeHint() const
int TargetSelector::maxVisibleTargets() const int TargetSelector::maxVisibleTargets() const
{ {
return (width() - ((NAVBUTTON_WIDTH + 1) * 2 + 3))/(targetWidth() + 1); return qMax((width() - ((NAVBUTTON_WIDTH + 1) * 2 + 3))/(targetWidth() + 1), 1);
} }
void TargetSelector::getControlAt(int x, int y, int *buttonIndex, int *targetIndex, int *targetSubIndex) void TargetSelector::getControlAt(int x, int y, int *buttonIndex, int *targetIndex, int *targetSubIndex)