From 8f94d5886d4782a7387ee78ea1187568b1523cc5 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 16 Jul 2014 15:40:22 +0800 Subject: [PATCH] win: Min/max size uses scaled DPI size. --- atom/browser/ui/views/frameless_view.cc | 1 + atom/browser/ui/views/win_frame_view.cc | 11 +++++++++++ atom/browser/ui/views/win_frame_view.h | 2 ++ 3 files changed, 14 insertions(+) diff --git a/atom/browser/ui/views/frameless_view.cc b/atom/browser/ui/views/frameless_view.cc index f413899d3866..7a98891dcaf9 100644 --- a/atom/browser/ui/views/frameless_view.cc +++ b/atom/browser/ui/views/frameless_view.cc @@ -15,6 +15,7 @@ namespace { const int kResizeInsideBoundsSize = 5; const int kResizeAreaCornerSize = 16; + const char kViewClassName[] = "FramelessView"; } // namespace diff --git a/atom/browser/ui/views/win_frame_view.cc b/atom/browser/ui/views/win_frame_view.cc index 07932de91bd3..4a7e90ce5bf3 100644 --- a/atom/browser/ui/views/win_frame_view.cc +++ b/atom/browser/ui/views/win_frame_view.cc @@ -5,6 +5,7 @@ #include "atom/browser/ui/views/win_frame_view.h" #include "atom/browser/native_window_views.h" +#include "ui/gfx/win/dpi.h" #include "ui/views/widget/widget.h" #include "ui/views/win/hwnd_util.h" @@ -38,6 +39,16 @@ int WinFrameView::NonClientHitTest(const gfx::Point& point) { return FramelessView::NonClientHitTest(point); } +gfx::Size WinFrameView::GetMinimumSize() { + gfx::Size size = FramelessView::GetMinimumSize(); + return gfx::win::DIPToScreenSize(size); +} + +gfx::Size WinFrameView::GetMaximumSize() { + gfx::Size size = FramelessView::GetMaximumSize(); + return gfx::win::DIPToScreenSize(size); +} + const char* WinFrameView::GetClassName() const { return kViewClassName; } diff --git a/atom/browser/ui/views/win_frame_view.h b/atom/browser/ui/views/win_frame_view.h index 209a00a1da95..6cc65c937026 100644 --- a/atom/browser/ui/views/win_frame_view.h +++ b/atom/browser/ui/views/win_frame_view.h @@ -20,6 +20,8 @@ class WinFrameView : public FramelessView { virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; // views::View: + virtual gfx::Size GetMinimumSize() OVERRIDE; + virtual gfx::Size GetMaximumSize() OVERRIDE; virtual const char* GetClassName() const OVERRIDE; private: