зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1370034 - Add nsIWidget::SetWindowOpacity and implement it on Mac. r=spohl
MozReview-Commit-ID: ILqHQuQ4whl --HG-- extra : rebase_source : 6d45806a0384a58993c425572a8305715df1a181
This commit is contained in:
Родитель
ccaf464b9e
Коммит
195251f3db
|
@ -315,6 +315,7 @@ public:
|
|||
virtual nsTransparencyMode GetTransparencyMode() override;
|
||||
virtual void SetTransparencyMode(nsTransparencyMode aMode) override;
|
||||
virtual void SetWindowShadowStyle(int32_t aStyle) override;
|
||||
virtual void SetWindowOpacity(float aOpacity) override;
|
||||
virtual void SetShowsToolbarButton(bool aShow) override;
|
||||
virtual void SetShowsFullScreenButton(bool aShow) override;
|
||||
virtual void SetWindowAnimationType(WindowAnimationType aType) override;
|
||||
|
|
|
@ -2164,6 +2164,20 @@ nsCocoaWindow::SetWindowShadowStyle(int32_t aStyle)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
void
|
||||
nsCocoaWindow::SetWindowOpacity(float aOpacity)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
|
||||
if (!mWindow) {
|
||||
return;
|
||||
}
|
||||
|
||||
[mWindow setAlphaValue:(CGFloat)aOpacity];
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
void nsCocoaWindow::SetShowsToolbarButton(bool aShow)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
|
|
|
@ -1105,6 +1105,14 @@ class nsIWidget : public nsISupports
|
|||
*/
|
||||
virtual void SetWindowShadowStyle(int32_t aStyle) = 0;
|
||||
|
||||
/**
|
||||
* Set the opacity of the window.
|
||||
* Values need to be between 0.0f (invisible) and 1.0f (fully opaque).
|
||||
*
|
||||
* Ignored on child widgets and on non-Mac platforms.
|
||||
*/
|
||||
virtual void SetWindowOpacity(float aOpacity) {}
|
||||
|
||||
/*
|
||||
* On Mac OS X, this method shows or hides the pill button in the titlebar
|
||||
* that's used to collapse the toolbar.
|
||||
|
|
Загрузка…
Ссылка в новой задаче