Browse Source

Theme udpates

Scott Brogden 9 years ago
parent
commit
48f721f583
8 changed files with 40 additions and 33 deletions
  1. 1 1
      CP_Main.h
  2. 5 0
      DittoSetup/BuildDitto.bld
  3. 12 12
      DittoWindow.cpp
  4. 7 17
      Options.cpp
  5. 2 0
      OptionsGeneral.cpp
  6. 4 3
      OptionsQuickPaste.cpp
  7. 3 0
      QPasteWnd.cpp
  8. 6 0
      SymbolEdit.cpp

+ 1 - 1
CP_Main.h

@@ -26,7 +26,7 @@
 extern class CCP_MainApp theApp;
 
 #define BORDER 2 
-#define CAPTION_BORDER theApp.m_metrics.ScaleX(32)
+#define CAPTION_BORDER theApp.m_metrics.ScaleX(25)
 
 class CCP_MainApp : public CWinApp
 {

+ 5 - 0
DittoSetup/BuildDitto.bld

@@ -441,6 +441,9 @@ DittoSetup*]]></X>
 %DATETIME%
 <br>
 <br>
+Warning, as of version 3.21.105 I'm in the middle of updating the default looks of Ditto, so it might take a few versions to sort out.
+<br>
+<br>
 <b>Ditto beta, version %version%</b>
 <br><br>
 <a href="DittoSetup_%versionFileName%.exe">Ditto Setup</a><br>
@@ -480,6 +483,7 @@ var sc_security="b3f57099";
 <!-- End of StatCounter Code --><br><a href="http://my.statcounter.com/project/standard/stats.php?project_id=4303469&guest=1">View My Stats</a>
 
 </body>]]></Text>
+			<checked type='11'>0</checked>
 			<indent type='3'>2</indent>
 			<name>Beta web page</name>
 		</step>
@@ -546,6 +550,7 @@ var sc_security="b3f57099";
 			<Timeout>30</Timeout>
 			<TransferType type='3'>1</TransferType>
 			<UserName>sabrogden,ditto-cp</UserName>
+			<checked type='11'>0</checked>
 			<indent type='3'>1</indent>
 			<name>Copy to beta folder</name>
 		</step></steps>

+ 12 - 12
DittoWindow.cpp

@@ -275,10 +275,10 @@ void CDittoWindow::DoNcPaint(CWnd *pWnd)
 		rightRect.SetRect(rcBorder.right - CAPTION_BORDER+ border, leftRect.top, rcBorder.right, rcBorder.top + IndexToPos(index, false));
 		leftRect.SetRect(rcBorder.right - CAPTION_BORDER+ border, rcBorder.top + IndexToPos(index, false) + 1, rcBorder.right, rcBorder.bottom);
 		
-		textRect.SetRect(rcBorder.right - theApp.m_metrics.ScaleX(2), rightRect.bottom + theApp.m_metrics.ScaleX(10), rcBorder.right - CAPTION_BORDER + theApp.m_metrics.ScaleX(5), rcBorder.bottom - theApp.m_metrics.ScaleX(50));
+		textRect.SetRect(rcBorder.right + theApp.m_metrics.ScaleX(2), rightRect.bottom + theApp.m_metrics.ScaleX(10), rcBorder.right - CAPTION_BORDER + theApp.m_metrics.ScaleX(0), rcBorder.bottom - theApp.m_metrics.ScaleX(50));
 
-		int left = rcBorder.right - theApp.m_metrics.ScaleX(22);
-		int right = rcBorder.right - theApp.m_metrics.ScaleX(6);
+		int left = rcBorder.right - theApp.m_metrics.ScaleX(19);
+		int right = rcBorder.right - theApp.m_metrics.ScaleX(3);
 
 		m_crCloseBT.SetRect(left, IndexToPos(closeIndex, false), right, m_crCloseBT.top+ widthHeight);
 		m_crChevronBT.SetRect(left, IndexToPos(chevronIndex, false), right, m_crChevronBT.top + widthHeight);
@@ -286,7 +286,7 @@ void CDittoWindow::DoNcPaint(CWnd *pWnd)
 		m_crMinimizeBT.SetRect(left, IndexToPos(minIndex, false), right, m_crMinimizeBT.top + widthHeight);
 
 
-		m_crWindowIconBT.SetRect(rcBorder.right - theApp.m_metrics.ScaleX(27), rcBorder.bottom - theApp.m_metrics.ScaleX(28), rcBorder.right - theApp.m_metrics.ScaleX(8), rcBorder.bottom);
+		m_crWindowIconBT.SetRect(rcBorder.right - theApp.m_metrics.ScaleX(24), rcBorder.bottom - theApp.m_metrics.ScaleX(28), rcBorder.right - theApp.m_metrics.ScaleX(2), rcBorder.bottom);
 
 		bVertical = TRUE;
 	}
@@ -295,10 +295,10 @@ void CDittoWindow::DoNcPaint(CWnd *pWnd)
 		rightRect.SetRect(rcBorder.left, leftRect.top, rcBorder.left + CAPTION_BORDER - border, rcBorder.top + IndexToPos(index, false));
 		leftRect.SetRect(rcBorder.left, rcBorder.top + IndexToPos(index, false) + 1, rcBorder.left + CAPTION_BORDER - border, rcBorder.bottom);
 
-		textRect.SetRect(rcBorder.left + CAPTION_BORDER - theApp.m_metrics.ScaleX(3), rightRect.bottom + theApp.m_metrics.ScaleX(10), rcBorder.left + theApp.m_metrics.ScaleX(2), rcBorder.bottom - theApp.m_metrics.ScaleX(50));
+		textRect.SetRect(rcBorder.left + CAPTION_BORDER - theApp.m_metrics.ScaleX(0), rightRect.bottom + theApp.m_metrics.ScaleX(10), rcBorder.left - theApp.m_metrics.ScaleX(5), rcBorder.bottom - theApp.m_metrics.ScaleX(50));
 
-		int left = theApp.m_metrics.ScaleX(8);
-		int right = theApp.m_metrics.ScaleX(24);
+		int left = theApp.m_metrics.ScaleX(5);
+		int right = theApp.m_metrics.ScaleX(21);
 
 		m_crCloseBT.SetRect(left, IndexToPos(closeIndex, false), right, m_crCloseBT.top + widthHeight);
 		m_crChevronBT.SetRect(left, IndexToPos(chevronIndex, false), right, m_crChevronBT.top + widthHeight);
@@ -306,7 +306,7 @@ void CDittoWindow::DoNcPaint(CWnd *pWnd)
 		m_crMinimizeBT.SetRect(left, IndexToPos(minIndex, false), right, m_crMinimizeBT.top + widthHeight);
 
 
-		m_crWindowIconBT.SetRect(rcBorder.left + theApp.m_metrics.ScaleX(4), rcBorder.bottom - theApp.m_metrics.ScaleX(28), rcBorder.left + theApp.m_metrics.ScaleX(28), rcBorder.bottom);
+		m_crWindowIconBT.SetRect(rcBorder.left + theApp.m_metrics.ScaleX(0), rcBorder.bottom - theApp.m_metrics.ScaleX(28), rcBorder.left + theApp.m_metrics.ScaleX(25), rcBorder.bottom);
 
 		bVertical = TRUE;
 	}
@@ -317,8 +317,8 @@ void CDittoWindow::DoNcPaint(CWnd *pWnd)
 
 		textRect.SetRect(leftRect.right, leftRect.top, leftRect.right, leftRect.bottom);
 
-		int top = theApp.m_metrics.ScaleX(8);
-		int bottom = theApp.m_metrics.ScaleX(24);
+		int top = theApp.m_metrics.ScaleX(5);
+		int bottom = theApp.m_metrics.ScaleX(21);
 
 		m_crCloseBT.SetRect(rcBorder.right - IndexToPos(closeIndex, true), top, m_crCloseBT.left + widthHeight, bottom);
 		m_crChevronBT.SetRect(rcBorder.right - IndexToPos(chevronIndex, true), top, m_crChevronBT.left + widthHeight, bottom);
@@ -336,8 +336,8 @@ void CDittoWindow::DoNcPaint(CWnd *pWnd)
 
 		textRect.SetRect(leftRect.right, leftRect.top, leftRect.right, leftRect.bottom);
 
-		int top = leftRect.top + theApp.m_metrics.ScaleX(8);
-		int bottom = leftRect.top + theApp.m_metrics.ScaleX(24);
+		int top = leftRect.top + theApp.m_metrics.ScaleX(4);
+		int bottom = leftRect.top + theApp.m_metrics.ScaleX(20);
 
 		m_crCloseBT.SetRect(rcBorder.right - IndexToPos(closeIndex, true), top, m_crCloseBT.left + widthHeight, bottom);
 		m_crChevronBT.SetRect(rcBorder.right - IndexToPos(chevronIndex, true), top, m_crChevronBT.left + widthHeight, bottom);

+ 7 - 17
Options.cpp

@@ -1116,11 +1116,11 @@ BOOL CGetSetOptions::GetMainHWND()
 
 void CGetSetOptions::SetCaptionPos(long lPos)	
 {	
-	SetProfileLong("CaptionPos2", lPos);					
+	SetProfileLong("CaptionPos", lPos);					
 }
 long CGetSetOptions::GetCaptionPos()			
 {	
-	return GetProfileLong("CaptionPos2", CAPTION_TOP);	
+	return GetProfileLong("CaptionPos", CAPTION_RIGHT);	
 }
 
 void CGetSetOptions::SetAutoHide(BOOL bAutoHide)
@@ -1313,7 +1313,7 @@ BOOL CGetSetOptions::GetFont(LOGFONT &font)
 {
 	if(m_bFromIni && !m_bInConversion)
 	{
-		GetProfileFont("DisplayFont4", font);
+		GetProfileFont("DisplayFont5", font);
 
 		//Return true if there is a font name
 		//other wise load the default font below
@@ -1325,11 +1325,7 @@ BOOL CGetSetOptions::GetFont(LOGFONT &font)
 	else
 	{
 		DWORD dwLength = 0;
-		#ifdef _UNICODE
-			LPVOID lpVoid = GetProfileData("DisplayFont5", dwLength);
-		#else
-			LPVOID lpVoid = GetProfileData("DisplayFont", dwLength);
-		#endif
+		LPVOID lpVoid = GetProfileData("DisplayFont5", dwLength);
 		if(lpVoid)
 		{
 			if(sizeof(font) == dwLength)
@@ -1361,17 +1357,11 @@ void CGetSetOptions::SetFont(LOGFONT &font)
 {
 	if(m_bFromIni)
 	{
-		SetProfileFont("DisplayFont4", font);
+		SetProfileFont("DisplayFont5", font);
 	}
 	else
-	{
-		#ifdef _UNICODE
-			CString csParam = "DisplayFont4";
-		#else
-			CString csParam = "DisplayFont";
-		#endif
-
-		SetProfileData(csParam, &font, sizeof(LOGFONT));
+	{	
+		SetProfileData("DisplayFont5", &font, sizeof(LOGFONT));
 	}
 }
 

+ 2 - 0
OptionsGeneral.cpp

@@ -370,6 +370,7 @@ void COptionsGeneral::OnGetPath()
 	FileName.lpstrInitialDir = szDir;
 	FileName.lpstrFilter = _T("Ditto Databases (*.db; *.mdb)\0*.db;*.mdb\0\0");
 	FileName.lpstrDefExt = _T("db");
+	FileName.hwndOwner = m_hWnd;
 
 	if(GetOpenFileName(&FileName) == 0)
 		return;
@@ -451,6 +452,7 @@ void COptionsGeneral::OnSelectSound()
 	FileName.lpstrInitialDir = szDir;
 	FileName.lpstrFilter = _T("Sounds(*.wav)\0*.wav\0\0");
 	FileName.lpstrDefExt = _T("wav");
+	FileName.hwndOwner = m_hWnd;
 
 	if(GetOpenFileName(&FileName) == 0)
 		return;

+ 4 - 3
OptionsQuickPaste.cpp

@@ -197,7 +197,7 @@ BOOL COptionsQuickPaste::OnApply()
 
 void COptionsQuickPaste::OnButtonFont() 
 {
-	CFontDialog dlg(&m_LogFont, (CF_TTONLY | CF_SCREENFONTS));
+	CFontDialog dlg(&m_LogFont, (CF_TTONLY | CF_SCREENFONTS), 0, this);
 	if(dlg.DoModal() == IDOK)
 	{	
 		m_Font.DeleteObject();
@@ -221,10 +221,10 @@ void COptionsQuickPaste::OnButtonDefaultFault()
 
 	memset(&m_LogFont, 0, sizeof(m_LogFont));
 
-	m_LogFont.lfHeight = -11;
+	m_LogFont.lfHeight = -theApp.m_metrics.PointsToPixels(10);
 	m_LogFont.lfWeight = 400;
 	m_LogFont.lfCharSet = 1;
-	STRCPY(m_LogFont.lfFaceName, _T("Arial Unicode MS"));
+	STRCPY(m_LogFont.lfFaceName, _T("Segoe UI"));
 
 	m_Font.DeleteObject();
 	m_Font.CreateFontIndirect(&m_LogFont);
@@ -317,6 +317,7 @@ void COptionsQuickPaste::OnBnClickedButtonDiffBrowse()
 	FileName.lpstrInitialDir = szDir;
 	FileName.lpstrFilter = _T("*.exe");
 	FileName.lpstrDefExt = _T("");
+	FileName.hwndOwner = m_hWnd;
 
 	if(GetOpenFileName(&FileName) == 0)
 		return;

+ 3 - 0
QPasteWnd.cpp

@@ -424,6 +424,8 @@ int CQPasteWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
 	m_alwaysOnToWarningStatic.SetFont(&m_groupFont);
 
 	LoadShortcuts();
+
+	InvalidateNc();
 	
     return 0;
 }
@@ -1084,6 +1086,7 @@ void CQPasteWnd::RefreshNc()
 
 void CQPasteWnd::UpdateStatus(bool bRepaintImmediately)
 {
+	return;
     CString title = m_Title;
     CString prev;
 

+ 6 - 0
SymbolEdit.cpp

@@ -281,6 +281,9 @@ void CSymbolEdit::OnPaint()
 			oldFont = dc.SelectObject(&m_fontPrompt);
 			COLORREF color = dc.GetTextColor();
 			dc.SetTextColor(m_colorPromptText);
+			DWORD margins = this->GetMargins();
+			rect.left += LOWORD(margins);
+			rect.right -= HIWORD(margins);
 			dc.DrawText(m_strPromptText, rect, DT_LEFT | DT_SINGLELINE | DT_EDITCONTROL);
 			dc.SetTextColor(color);
 			dc.SelectObject(oldFont);
@@ -291,6 +294,9 @@ void CSymbolEdit::OnPaint()
 		dc.FillSolidRect(rect, m_editFocusColor);
 
 		oldFont = dc.SelectObject(GetFont());
+		DWORD margins = this->GetMargins();
+		rect.left += LOWORD(margins);
+		rect.right -= HIWORD(margins);
 		dc.DrawText(text, rect, DT_SINGLELINE | DT_INTERNAL | DT_EDITCONTROL);
 		dc.SelectObject(oldFont);
 	}