window_->SetBackgroundColor(color_name);
}
+void Window::SetHasShadow(bool has_shadow) {
+ window_->SetHasShadow(has_shadow);
+}
+
+bool Window::HasShadow() {
+ return window_->HasShadow();
+}
+
void Window::FocusOnWebView() {
window_->FocusOnWebView();
}
.SetMethod("setKiosk", &Window::SetKiosk)
.SetMethod("isKiosk", &Window::IsKiosk)
.SetMethod("setBackgroundColor", &Window::SetBackgroundColor)
+ .SetMethod("setHasShadow", &Window::SetHasShadow)
+ .SetMethod("hasShadow", &Window::HasShadow)
.SetMethod("setRepresentedFilename", &Window::SetRepresentedFilename)
.SetMethod("getRepresentedFilename", &Window::GetRepresentedFilename)
.SetMethod("setDocumentEdited", &Window::SetDocumentEdited)
void SetKiosk(bool kiosk);
bool IsKiosk();
void SetBackgroundColor(const std::string& color_name);
+ void SetHasShadow(bool has_shadow);
+ bool HasShadow();
void FocusOnWebView();
void BlurWebView();
bool IsWebViewFocused();
callback.Run(bitmap);
}
+void NativeWindow::SetHasShadow(bool has_shadow) {
+}
+
+bool NativeWindow::HasShadow() {
+ return true;
+}
+
SkColor NativeWindow::ParseHexColor(const std::string& name) {
SkColor result = 0xFF000000;
unsigned value = 0;
virtual void SetKiosk(bool kiosk) = 0;
virtual bool IsKiosk() = 0;
virtual void SetBackgroundColor(const std::string& color_name) = 0;
+ virtual void SetHasShadow(bool has_shadow);
+ virtual bool HasShadow();
virtual void SetRepresentedFilename(const std::string& filename);
virtual std::string GetRepresentedFilename();
virtual void SetDocumentEdited(bool edited);
void SetKiosk(bool kiosk) override;
bool IsKiosk() override;
void SetBackgroundColor(const std::string& color_name) override;
+ void SetHasShadow(bool has_shadow) override;
+ bool HasShadow() override;
void SetRepresentedFilename(const std::string& filename) override;
std::string GetRepresentedFilename() override;
void SetDocumentEdited(bool edited) override;
if (!has_frame())
[window_ setOpaque:NO];
+ bool has_shadow = true;
+ options.Get(options::kHasShadow, &has_shadow);
+ if (!has_shadow) {
+ SetHasShadow(false);
+ }
+
// We will manage window's lifetime ourselves.
[window_ setReleasedWhenClosed:NO];
[window_ setBackgroundColor:color];
}
+void NativeWindowMac::SetHasShadow(bool has_shadow) {
+ [window_ setHasShadow:has_shadow];
+}
+
+bool NativeWindowMac::HasShadow() {
+ return [window_ hasShadow];
+}
+
void NativeWindowMac::SetRepresentedFilename(const std::string& filename) {
[window_ setRepresentedFilename:base::SysUTF8ToNSString(filename)];
}
// Default browser window background color.
const char kBackgroundColor[] = "backgroundColor";
+// Whether the window should have a shadow.
+const char kHasShadow[] = "hasShadow";
+
// The WebPreferences.
const char kWebPreferences[] = "webPreferences";
extern const char kDisableAutoHideCursor[];
extern const char kStandardWindow[];
extern const char kBackgroundColor[];
+extern const char kHasShadow[];
extern const char kWebPreferences[];
// WebPreferences.
* `backgroundColor` String - Window's background color as Hexadecimal value,
like `#66CD00` or `#FFF`. Default is `#000` (black) for Linux and Windows,
`#FFF` for Mac (or clear if transparent).
+ * `hasShadow` Boolean - Whether window should have a shadow. This is only
+ implemented on OS X.
* `darkTheme` Boolean - Forces using dark theme for the window, only works on
some GTK+3 desktop environments. Default is `false`.
* `transparent` Boolean - Makes the window [transparent](frameless-window.md).
Sets a 16px overlay onto the current taskbar icon, usually used to convey some
sort of application status or to passively notify the user.
+### `win.setHasShadow(hasShadow)` _OS X_
+
+* `hasShadow` (Boolean)
+
+Sets whether the window should have a shadow. On Windows and Linux does
+nothing.
+
+### `win.hasShadow()` _OS X_
+
+Returns whether the window has a shadow. On Windows and Linux always returns
+`true`.
### `win.setThumbarButtons(buttons)` _Windows 7+_