linux: Fix min/max size not working
This commit is contained in:
parent
48975d04e0
commit
73ded9d378
4 changed files with 73 additions and 17 deletions
35
atom/browser/ui/views/native_frame_view.cc
Normal file
35
atom/browser/ui/views/native_frame_view.cc
Normal file
|
@ -0,0 +1,35 @@
|
|||
// Copyright (c) 2015 GitHub, Inc.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "atom/browser/ui/views/native_frame_view.h"
|
||||
|
||||
#include "atom/browser/native_window_views.h"
|
||||
|
||||
namespace atom {
|
||||
|
||||
namespace {
|
||||
|
||||
const char kViewClassName[] = "AtomNativeFrameView";
|
||||
|
||||
} // namespace
|
||||
|
||||
NativeFrameView::NativeFrameView(NativeWindowViews* window,
|
||||
views::Widget* widget)
|
||||
: views::NativeFrameView(widget),
|
||||
window_(window) {
|
||||
}
|
||||
|
||||
gfx::Size NativeFrameView::GetMinimumSize() const {
|
||||
return window_->GetMinimumSize();
|
||||
}
|
||||
|
||||
gfx::Size NativeFrameView::GetMaximumSize() const {
|
||||
return window_->GetMaximumSize();
|
||||
}
|
||||
|
||||
const char* NativeFrameView::GetClassName() const {
|
||||
return kViewClassName;
|
||||
}
|
||||
|
||||
} // namespace atom
|
34
atom/browser/ui/views/native_frame_view.h
Normal file
34
atom/browser/ui/views/native_frame_view.h
Normal file
|
@ -0,0 +1,34 @@
|
|||
// Copyright (c) 2015 GitHub, Inc.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef ATOM_BROWSER_UI_VIEWS_NATIVE_FRAME_VIEW_H_
|
||||
#define ATOM_BROWSER_UI_VIEWS_NATIVE_FRAME_VIEW_H_
|
||||
|
||||
#include "ui/views/window/native_frame_view.h"
|
||||
|
||||
namespace atom {
|
||||
|
||||
class NativeWindowViews;
|
||||
|
||||
// Like the views::NativeFrameView, but returns the min/max size from the
|
||||
// NativeWindowViews.
|
||||
class NativeFrameView : public views::NativeFrameView {
|
||||
public:
|
||||
NativeFrameView(NativeWindowViews* window, views::Widget* widget);
|
||||
|
||||
protected:
|
||||
// views::View:
|
||||
gfx::Size GetMinimumSize() const override;
|
||||
gfx::Size GetMaximumSize() const override;
|
||||
const char* GetClassName() const override;
|
||||
|
||||
private:
|
||||
NativeWindowViews* window_; // weak ref.
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(NativeFrameView);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
|
||||
#endif // ATOM_BROWSER_UI_VIEWS_NATIVE_FRAME_VIEW_H_
|
Loading…
Add table
Add a link
Reference in a new issue