Use short commands to change style

This commit is contained in:
Constantin Shalnev 2015-08-28 14:33:10 +03:00 committed by Alex Zolotarev
parent 3366100927
commit b334b72a31
3 changed files with 9 additions and 9 deletions

View file

@ -288,9 +288,9 @@ public class SearchFragment extends BaseMwmRecyclerFragment implements View.OnCl
private boolean tryChangeMapStyle(String str)
{
// Hook for shell command on change map style
final boolean isDark = str.equals("mapstyle:dark");
final boolean isLight = isDark ? false : str.equals("mapstyle:light");
final boolean isClear = isDark || isLight ? false : str.equals("mapstyle:clear");
final boolean isDark = str.equals("mapstyle:dark") || str.equals("?dark");
final boolean isLight = isDark ? false : str.equals("mapstyle:light") || str.equals("?light");
final boolean isClear = isDark || isLight ? false : str.equals("?newstyle");
if (!isDark && !isLight && !isClear)
return false;

View file

@ -372,9 +372,9 @@ static BOOL keyboardLoaded = NO;
- (BOOL)tryChangeMapStyleCmd:(NSString *)cmd
{
// Hook for shell command on change map style
BOOL const isDark = [cmd isEqualToString:@"mapstyle:dark"];
BOOL const isLight = isDark ? NO : [cmd isEqualToString:@"mapstyle:light"];
BOOL const isClear = isLight || isDark ? NO : [cmd isEqualToString:@"mapstyle:clear"];
BOOL const isDark = [cmd isEqualToString:@"mapstyle:dark"] || [cmd isEqualToString:@"?dark"];
BOOL const isLight = isDark ? NO : [cmd isEqualToString:@"mapstyle:light"] || [cmd isEqualToString:@"?light"];
BOOL const isClear = isLight || isDark ? NO : [cmd isEqualToString:@"?newstyle"];
if (!isDark && !isLight && !isClear)
return NO;

View file

@ -155,9 +155,9 @@ void SearchPanel::OnSearchResult(ResultsT * res)
bool SearchPanel::TryChangeMapStyleCmd(QString const & str)
{
// Hook for shell command on change map style
bool const isDark = (str == "mapstyle:dark");
bool const isLight = isDark ? false : (str == "mapstyle:light");
bool const isClear = isDark || isLight ? false : (str == "mapstyle:clear");
bool const isDark = (str == "mapstyle:dark") || (str == "?dark");
bool const isLight = isDark ? false : (str == "mapstyle:light") || (str == "?light");
bool const isClear = isDark || isLight ? false : (str == "?newstyle");
if (!isDark && !isLight && !isClear)
return false;