OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "xfa/fwl/core/cfwl_form.h" | 7 #include "xfa/fwl/core/cfwl_form.h" |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 if (m_pMaxBox) | 378 if (m_pMaxBox) |
379 arrBtn.Add(m_pMaxBox); | 379 arrBtn.Add(m_pMaxBox); |
380 if (m_pCloseBox) | 380 if (m_pCloseBox) |
381 arrBtn.Add(m_pCloseBox); | 381 arrBtn.Add(m_pCloseBox); |
382 return arrBtn.Find(pBtn); | 382 return arrBtn.Find(pBtn); |
383 } | 383 } |
384 | 384 |
385 void CFWL_Form::GetEdgeRect(CFX_RectF& rtEdge) { | 385 void CFWL_Form::GetEdgeRect(CFX_RectF& rtEdge) { |
386 rtEdge = m_rtRelative; | 386 rtEdge = m_rtRelative; |
387 if (m_pProperties->m_dwStyles & FWL_WGTSTYLE_Border) { | 387 if (m_pProperties->m_dwStyles & FWL_WGTSTYLE_Border) { |
388 FX_FLOAT fCX = GetBorderSize(); | 388 FX_FLOAT fCX = GetBorderSize(true); |
389 FX_FLOAT fCY = GetBorderSize(false); | 389 FX_FLOAT fCY = GetBorderSize(false); |
390 rtEdge.Deflate(fCX, fCY, fCX, fCY); | 390 rtEdge.Deflate(fCX, fCY, fCX, fCY); |
391 } | 391 } |
392 } | 392 } |
393 | 393 |
394 void CFWL_Form::SetWorkAreaRect() { | 394 void CFWL_Form::SetWorkAreaRect() { |
395 m_rtRestore = m_pProperties->m_rtWidget; | 395 m_rtRestore = m_pProperties->m_rtWidget; |
396 CFWL_WidgetMgr* pWidgetMgr = GetOwnerApp()->GetWidgetMgr(); | 396 CFWL_WidgetMgr* pWidgetMgr = GetOwnerApp()->GetWidgetMgr(); |
397 if (!pWidgetMgr) | 397 if (!pWidgetMgr) |
398 return; | 398 return; |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 CFWL_SysBtn* pPointBtn = GetSysBtnAtPoint(pMsg->m_fx, pMsg->m_fy); | 542 CFWL_SysBtn* pPointBtn = GetSysBtnAtPoint(pMsg->m_fx, pMsg->m_fy); |
543 CFWL_SysBtn* pPressedBtn = GetSysBtnByIndex(m_iCaptureBtn); | 543 CFWL_SysBtn* pPressedBtn = GetSysBtnByIndex(m_iCaptureBtn); |
544 if (!pPressedBtn || pPointBtn != pPressedBtn) | 544 if (!pPressedBtn || pPointBtn != pPressedBtn) |
545 return; | 545 return; |
546 if (pPressedBtn == GetSysBtnByState(FWL_SYSBUTTONSTATE_Pressed)) | 546 if (pPressedBtn == GetSysBtnByState(FWL_SYSBUTTONSTATE_Pressed)) |
547 pPressedBtn->SetNormal(); | 547 pPressedBtn->SetNormal(); |
548 if (pPressedBtn == m_pMaxBox) { | 548 if (pPressedBtn == m_pMaxBox) { |
549 if (m_bMaximized) { | 549 if (m_bMaximized) { |
550 SetWidgetRect(m_rtRestore); | 550 SetWidgetRect(m_rtRestore); |
551 Update(); | 551 Update(); |
552 Repaint(); | 552 Repaint(nullptr); |
553 } else { | 553 } else { |
554 SetWorkAreaRect(); | 554 SetWorkAreaRect(); |
555 Update(); | 555 Update(); |
556 } | 556 } |
557 m_bMaximized = !m_bMaximized; | 557 m_bMaximized = !m_bMaximized; |
558 } else if (pPressedBtn != m_pMinBox) { | 558 } else if (pPressedBtn != m_pMinBox) { |
559 CFWL_Event eClose(CFWL_EventType::Close); | 559 CFWL_Event eClose(CFWL_EventType::Close); |
560 eClose.m_pSrcTarget = this; | 560 eClose.m_pSrcTarget = this; |
561 DispatchEvent(&eClose); | 561 DispatchEvent(&eClose); |
562 } | 562 } |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 HitTest(pMsg->m_fx, pMsg->m_fy) == FWL_WidgetHit::Titlebar) { | 630 HitTest(pMsg->m_fx, pMsg->m_fy) == FWL_WidgetHit::Titlebar) { |
631 if (m_bMaximized) | 631 if (m_bMaximized) |
632 SetWidgetRect(m_rtRestore); | 632 SetWidgetRect(m_rtRestore); |
633 else | 633 else |
634 SetWorkAreaRect(); | 634 SetWorkAreaRect(); |
635 | 635 |
636 Update(); | 636 Update(); |
637 m_bMaximized = !m_bMaximized; | 637 m_bMaximized = !m_bMaximized; |
638 } | 638 } |
639 } | 639 } |
OLD | NEW |