mirror of https://github.com/buggins/dlangui.git
support exact filename in file filter; fix action dispatching when no focus
This commit is contained in:
parent
6e1f11fd57
commit
96d19be199
|
@ -156,14 +156,15 @@ string parentDir(string path) {
|
||||||
return buildNormalizedPath(path, "..");
|
return buildNormalizedPath(path, "..");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// check filename with pattern (currently only *.ext pattern is supported)
|
/// check filename with pattern (currently only *.ext, *.* and filename.ext patterns are supported)
|
||||||
bool filterFilename(string filename, string pattern) {
|
bool filterFilename(string filename, string pattern) {
|
||||||
if (pattern.equal("*.*"))
|
if (pattern.equal("*.*"))
|
||||||
return true; // matches any
|
return true; // matches any
|
||||||
if (pattern.length < 3)
|
if (pattern.length < 3)
|
||||||
return false;
|
return false;
|
||||||
if (pattern[0] != '*' || pattern[1] != '.')
|
if (pattern[0] != '*' || pattern[1] != '.') {
|
||||||
return false;
|
return filename.baseName.equal(pattern);
|
||||||
|
}
|
||||||
return filename.endsWith(pattern[1..$]);
|
return filename.endsWith(pattern[1..$]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -515,6 +515,8 @@ class Window {
|
||||||
return true;
|
return true;
|
||||||
focus = focus.parent;
|
focus = focus.parent;
|
||||||
}
|
}
|
||||||
|
if (_mainWidget)
|
||||||
|
return _mainWidget.handleAction(action);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue