コミットメタ情報

リビジョンa61c9fa38c9e6344fee10cbd4b0befe000c56e27 (tree)
日時2018-03-31 19:23:56
作者YujiSoftware <yuji.software+github@gmai...>
コミッターKazuhiro Fujieda @kfujieda

ログメッセージ

Adjust the layout of the properties dialog dynamically

On CJK versions of Windows 8 or later, the property sheet on the properties dialog are larger than expected and overlaps push buttons. This fix adjusts the layout dynamically.

Fixes #2 on github.

変更サマリ

差分

--- a/xkeymacs/properties.cpp
+++ b/xkeymacs/properties.cpp
@@ -78,10 +78,22 @@ BOOL CProperties::OnInitDialog()
7878 m_sheet.ModifyStyleEx (0, WS_EX_CONTROLPARENT);
7979 m_sheet.ModifyStyle( 0, WS_TABSTOP );
8080
81+ CRect rcArea;
82+ GetDlgItem(IDC_TAB)->GetWindowRect(&rcArea);
83+ ScreenToClient(&rcArea);
84+ m_sheet.SetWindowPos(NULL, rcArea.left - 11, rcArea.top - 8, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
85+
86+ // Fix: Overlapped with buttons due to font size change in CJK Windows 8 or later
87+ // https://github.com/fujieda/xkeymacs/issues/2
8188 CRect rcSheet;
82- GetDlgItem(IDC_TAB)->GetWindowRect(&rcSheet);
83- ScreenToClient(&rcSheet);
84- m_sheet.SetWindowPos(NULL, rcSheet.left - 11, rcSheet.top - 8, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
89+ m_sheet.GetWindowRect(&rcSheet);
90+ CRect rcDialog;
91+ GetWindowRect(&rcDialog);
92+ rcDialog.SetRect(rcDialog.left, rcDialog.top, rcDialog.right, rcSheet.bottom + 45);
93+ MoveWindow(rcDialog, TRUE);
94+
95+ // Fix: Window size can be changed due to dynamic layout effect
96+ ModifyStyle(WS_THICKFRAME, DS_MODALFRAME);
8597
8698 SetForegroundWindow();
8799
--- a/xkeymacs/xkeymacs.rc
+++ b/xkeymacs/xkeymacs.rc
@@ -770,6 +770,34 @@ END
770770
771771 /////////////////////////////////////////////////////////////////////////////
772772 //
773+// AFX_DIALOG_LAYOUT
774+//
775+
776+IDD_PROPERTIES AFX_DIALOG_LAYOUT
777+BEGIN
778+ 0,
779+ 0, 0, 0, 0,
780+ 0, 0, 0, 0,
781+ 0, 0, 0, 0,
782+ 0, 0, 0, 0,
783+ 0, 0, 0, 0,
784+ 0, 0, 0, 0,
785+ 0, 100, 0, 0,
786+ 0, 100, 0, 0,
787+ 0, 100, 0, 0,
788+ 0, 100, 0, 0,
789+ 0, 100, 0, 0,
790+ 0, 100, 0, 0,
791+ 0, 0, 0, 0,
792+ 0, 0, 0, 0,
793+ 0, 0, 0, 0,
794+ 0, 0, 0, 0,
795+ 0, 0, 0, 0
796+END
797+
798+
799+/////////////////////////////////////////////////////////////////////////////
800+//
773801 // String Table
774802 //
775803
旧リポジトリブラウザで表示