Tracker: small code simplication
Use std::max() to avoid comparison and turn into 1-liner.
This commit is contained in:
parent
54e2dd7272
commit
3c4e26995c
@ -35,11 +35,14 @@ their respective holders. All rights reserved.
|
|||||||
// NavMenu is a hierarchical menu of volumes, folders, files and queries
|
// NavMenu is a hierarchical menu of volumes, folders, files and queries
|
||||||
// displays icons, uses the SlowMenu API for full interruptability
|
// displays icons, uses the SlowMenu API for full interruptability
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <strings.h>
|
|
||||||
|
|
||||||
#include "NavMenu.h"
|
#include "NavMenu.h"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
#include <Catalog.h>
|
#include <Catalog.h>
|
||||||
#include <Debug.h>
|
#include <Debug.h>
|
||||||
@ -768,8 +771,7 @@ BNavMenu::DoneBuildingItemList()
|
|||||||
int32
|
int32
|
||||||
BNavMenu::GetMaxMenuWidth(void)
|
BNavMenu::GetMaxMenuWidth(void)
|
||||||
{
|
{
|
||||||
int32 width = (int32)(BScreen().Frame().Width() / 4);
|
return std::max((int32)(BScreen().Frame().Width() / 4), kMinMenuWidth);
|
||||||
return (width < kMinMenuWidth) ? kMinMenuWidth : width;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user