filename as Optional argument
This commit is contained in:
parent
9736dc3115
commit
b44371f4bf
3 changed files with 10 additions and 5 deletions
|
@ -729,8 +729,11 @@ void Window::SetAspectRatio(double aspect_ratio, mate::Arguments* args) {
|
||||||
window_->SetAspectRatio(aspect_ratio, extra_size);
|
window_->SetAspectRatio(aspect_ratio, extra_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::PreviewFile(const std::string& filepath,
|
void Window::PreviewFile(const std::string& filepath, mate::Arguments* args) {
|
||||||
const std::string& filename) {
|
std::string filename;
|
||||||
|
if (!args->GetNext(&filename)) {
|
||||||
|
filename = filepath;
|
||||||
|
}
|
||||||
window_->PreviewFile(filepath, filename);
|
window_->PreviewFile(filepath, filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -170,7 +170,7 @@ class Window : public mate::TrackableObject<Window>,
|
||||||
void SetMenuBarVisibility(bool visible);
|
void SetMenuBarVisibility(bool visible);
|
||||||
bool IsMenuBarVisible();
|
bool IsMenuBarVisible();
|
||||||
void SetAspectRatio(double aspect_ratio, mate::Arguments* args);
|
void SetAspectRatio(double aspect_ratio, mate::Arguments* args);
|
||||||
void PreviewFile(const std::string& filepath, const std::string& filename);
|
void PreviewFile(const std::string& filepath, mate::Arguments* args);
|
||||||
void SetParentWindow(v8::Local<v8::Value> value, mate::Arguments* args);
|
void SetParentWindow(v8::Local<v8::Value> value, mate::Arguments* args);
|
||||||
v8::Local<v8::Value> GetParentWindow() const;
|
v8::Local<v8::Value> GetParentWindow() const;
|
||||||
std::vector<v8::Local<v8::Object>> GetChildWindows() const;
|
std::vector<v8::Local<v8::Object>> GetChildWindows() const;
|
||||||
|
|
|
@ -664,10 +664,12 @@ the player itself we would call this function with arguments of 16/9 and
|
||||||
are within the content view--only that they exist. Just sum any extra width and
|
are within the content view--only that they exist. Just sum any extra width and
|
||||||
height areas you have within the overall content view.
|
height areas you have within the overall content view.
|
||||||
|
|
||||||
#### `win.previewFile(pathname, filename)` _macOS_
|
#### `win.previewFile(pathname[, filename])` _macOS_
|
||||||
|
|
||||||
* `pathname` String - The absolute path to the file to preview with QuickLook. This is important as Quicklook uses the file name and file extension on the path to determine the content_type of the file to open.
|
* `pathname` String - The absolute path to the file to preview with QuickLook. This is important as Quicklook uses the file name and file extension on the path to determine the content_type of the file to open.
|
||||||
* `filename` String - The name of the file to display on QuickLook modal view. This is purely visual and does not affect the content_type of the file.
|
* `filename` String (Optional) - The name of the file to display on the QuickLook modal view. This is purely visual and does not affect the content_type of the file. Defaults to filepath.
|
||||||
|
|
||||||
|
Uses QuickLook to preview a file at a given path.
|
||||||
|
|
||||||
#### `win.setBounds(bounds[, animate])`
|
#### `win.setBounds(bounds[, animate])`
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue