OSDN Git Service

Make the UI flat
authorsdottaka <sdottaka@sourceforge.net>
Sat, 9 Aug 2014 00:01:53 +0000 (09:01 +0900)
committersdottaka <sdottaka@sourceforge.net>
Sat, 9 Aug 2014 00:01:53 +0000 (09:01 +0900)
--HG--
branch : stable

Src/ChildFrm.cpp
Src/Common/SplitterWndEx.cpp
Src/Common/SplitterWndEx.h
Src/EditorFilepathBar.cpp
Src/Merge.rc
Translations/WinMerge/English.pot

index 927295d..232152b 100644 (file)
@@ -183,7 +183,7 @@ BOOL CChildFrame::OnCreateClient( LPCREATESTRUCT /*lpcs*/,
        }
 
        CWnd* pWnd = new CLocationView;
-       DWORD dwStyle = AFX_WS_DEFAULT_VIEW ;// & ~WS_BORDER;
+       DWORD dwStyle = AFX_WS_DEFAULT_VIEW & ~WS_BORDER;
        pWnd->Create(NULL, NULL, dwStyle, CRect(0,0,40,100), &m_wndLocationBar, 152, pContext);
 
        // Merge frame has also a dockable bar at the very bottom
index 394890b..a3af158 100644 (file)
@@ -353,3 +353,30 @@ void CSplitterWndEx::FlipSplit()
        EqualizeRows();
 
 }
+
+static COLORREF GetIntermediateColor(COLORREF a, COLORREF b)
+{
+       const int R = (GetRValue(a) - GetRValue(b)) / 2 + GetRValue(b);
+       const int G = (GetGValue(a) - GetGValue(b)) / 2 + GetGValue(b);
+       const int B = (GetBValue(a) - GetBValue(b)) / 2 + GetBValue(b);
+       return RGB(R, G, B);
+}
+
+void CSplitterWndEx::OnDrawSplitter(CDC* pDC, ESplitType nType, const CRect& rectArg)
+{
+       CRect rect = rectArg;
+       if (nType == splitBorder && pDC)
+       {
+               COLORREF clrShadow  = GetSysColor(COLOR_BTNSHADOW);
+               COLORREF clrFace    = GetSysColor(COLOR_BTNFACE);
+               COLORREF clrShadow2 = GetIntermediateColor(clrFace, clrShadow);
+               COLORREF clrShadow3 = GetIntermediateColor(clrFace, clrShadow2);
+               COLORREF clrShadow4 = GetIntermediateColor(clrFace, clrShadow3);
+               COLORREF clrShadow5 = GetIntermediateColor(clrFace, clrShadow4);
+               pDC->Draw3dRect(rect, clrShadow5, clrShadow4);
+               rect.InflateRect(-1, -1);
+               pDC->Draw3dRect(rect, clrShadow3, clrShadow2);
+               return;
+       }
+       return CSplitterWnd::OnDrawSplitter(pDC, nType, rectArg);
+}
index 3721240..80e5661 100644 (file)
@@ -42,6 +42,7 @@ protected:
        afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
        afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
        afx_msg void OnSize(UINT nType, int cx, int cy);
+       virtual void OnDrawSplitter(CDC* pDC, ESplitType nType, const CRect& rect);
        DECLARE_MESSAGE_MAP()
 };
 
index de21a95..cd563da 100644 (file)
@@ -131,16 +131,10 @@ void CEditorFilePathBar::Resize()
        WINDOWPLACEMENT infoBar;
        GetWindowPlacement(&infoBar);
 
-       CRect rc;
-       GetClientRect(&rc);
+       int widths[3];
        for (int pane = 0; pane < m_nPanes; pane++)
-       {
-               int width = infoBar.rcNormalPosition.right / m_nPanes;
-               rc.left = pane * width;
-               rc.right = rc.left + width;
-               m_Edit[pane].MoveWindow(&rc);
-               m_Edit[pane].RefreshDisplayText();
-       }
+               widths[pane] = (infoBar.rcNormalPosition.right / m_nPanes) - 6;
+       Resize(widths);
 }
 /** 
  * @brief Set widths.
index f281da0..e3eb487 100644 (file)
@@ -1241,13 +1241,13 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x1
 BEGIN
     EDITTEXT        IDC_STATIC_TITLE_PANE0,0,2,160,12,ES_AUTOHSCROLL |
                     ES_READONLY | NOT WS_BORDER | NOT
-                    WS_TABSTOP,WS_EX_STATICEDGE
+                    WS_TABSTOP
     EDITTEXT        IDC_STATIC_TITLE_PANE1,163,2,160,12,ES_AUTOHSCROLL |
                     ES_READONLY | NOT WS_BORDER | NOT
-                    WS_TABSTOP,WS_EX_STATICEDGE
+                    WS_TABSTOP
     EDITTEXT        IDC_STATIC_TITLE_PANE2,326,2,0,12,ES_AUTOHSCROLL |
                     ES_READONLY | NOT WS_BORDER | NOT
-                    WS_TABSTOP,WS_EX_STATICEDGE
+                    WS_TABSTOP
 END
 
 IDD_DIRCOLS DIALOGEX 0, 0, 307, 163
index 95540ea..6fee72a 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: WinMerge\n"
 "Report-Msgid-Bugs-To: http://bugs.winmerge.org/\n"
-"POT-Creation-Date: 2014-07-29 01:34+0000\n"
+"POT-Creation-Date: 2014-08-09 02:19+0000\n"
 "PO-Revision-Date: \n"
 "Last-Translator: \n"
 "Language-Team: English <winmerge-translate@lists.sourceforge.net>\n"