Skip to content

Commit c67bd17

Browse files
committed
r39
1 parent 29923e1 commit c67bd17

13 files changed

+74
-48
lines changed

Envy/CoolInterface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// CoolInterface.cpp
33
//
4-
// This file is part of Envy (getenvy.com) © 2016-2018
4+
// This file is part of Envy (getenvy.com) © 2016-2020
55
// Portions copyright Shareaza 2002-2008 and PeerProject 2008-2015
66
//
77
// Envy is free software. You may redistribute and/or modify it
@@ -759,7 +759,7 @@ void CCoolInterface::CreateFonts(LPCTSTR pszFace /*0*/, int nSize /*0*/)
759759

760760
// ToDo: Fix settings page high dpi richtext (this doesn't work)
761761
if ( Settings.Interface.DisplayScaling > 101 && nSize == Settings.Fonts.DefaultSize )
762-
nSize = (int)( nSize * Settings.Interface.DisplayScaling / 100 ) + 1;
762+
nSize = SCALE(nSize) + 1;
763763

764764
m_fntRichDefault.CreateFont( -nSize - 1, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE,
765765
DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, Settings.Fonts.Quality,

Envy/DlgSplash.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DlgSplash.cpp
33
//
4-
// This file is part of Envy (getenvy.com) © 2016-2018
4+
// This file is part of Envy (getenvy.com) © 2016-2020
55
// Portions copyright Shareaza 2002-2008 and PeerProject 2008-2015
66
//
77
// Envy is free software. You may redistribute and/or modify it
@@ -64,7 +64,13 @@ CSplashDlg::CSplashDlg(int nMax, bool bClosing)
6464
, m_sState ( Settings.SmartAgent() ) // Was theApp.m_sSmartAgent
6565
{
6666
if ( ! m_bmSplash.m_hObject )
67-
m_bmSplash.Attach( CImageFile::LoadBitmapFromFile( Settings.General.DataPath + L"Splash.png" ) );
67+
{
68+
CString strPath = Settings.General.DataPath + L"Splash.png";
69+
if ( Settings.Interface.DisplayScaling > 140 && GetFileAttributes( Settings.General.DataPath + L"Splash.HiRes.png" ) != INVALID_FILE_ATTRIBUTES )
70+
strPath = Settings.General.DataPath + L"Splash.HiRes.png";
71+
72+
m_bmSplash.Attach( CImageFile::LoadBitmapFromFile( strPath ) );
73+
}
6874

6975
Create( IDD, GetDesktopWindow() );
7076
}
@@ -221,7 +227,7 @@ void CSplashDlg::DoPaint(CDC* pDC)
221227
CFont* pOldFont = (CFont*)dcMemory.SelectObject( &theApp.m_gdiFontBold );
222228
dcMemory.SetBkMode( TRANSPARENT );
223229

224-
CRect rc( 8, m_nHeight - 18, m_nWidth - 98, m_nHeight - 2 ); // Text Position
230+
CRect rc( SCALE( 8 ), m_nHeight - SCALE( 18 ), m_nWidth - SCALE( 98 ), m_nHeight - SCALE( 2 ) ); // Text Position
225231
const UINT nFormat = DT_LEFT|DT_VCENTER|DT_SINGLELINE|DT_NOPREFIX;
226232

227233
dcMemory.SetTextColor( COLOR_TEXT_FADE ); // Text Outline/Fade
@@ -247,7 +253,7 @@ void CSplashDlg::DoPaint(CDC* pDC)
247253

248254
dcMemory.SelectObject( pOldFont );
249255

250-
rc.SetRect( m_nWidth - 90, m_nHeight - 14, m_nWidth - 8, m_nHeight - 5 ); // Progress Bar Position ( 440, 222, 522, 231 )
256+
rc.SetRect( m_nWidth - SCALE( 90 ), m_nHeight - SCALE( 14 ), m_nWidth - SCALE( 8 ), m_nHeight - SCALE( 5 ) ); // Progress Bar Position ( 440, 222, 522, 231 )
251257
// dcMemory.Draw3dRect( &rc, COLOR_BAR_UPPEREDGE, COLOR_BAR_LOWEREDGE ); // Progress Bar Outline
252258
rc.DeflateRect( 1, 1 );
253259
dcMemory.FillSolidRect( &rc, COLOR_BAR_FILL ); // Progress Bar Background

Envy/Envy.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ CEnvyApp::CEnvyApp()
206206
, m_bIsWinXP ( false )
207207
, m_bLimitedConnections ( false )
208208
, m_bMenuWasVisible ( FALSE )
209-
, m_nLastInput ( 0ul )
210-
, m_nWinVer ( 0ul )
209+
, m_nLastInput ( 0 )
210+
, m_nWinVer ( 0 )
211211
, m_nMouseWheel ( 3 )
212212
, m_hHookMouse ( NULL )
213213
, m_hHookKbd ( NULL )
@@ -1715,7 +1715,7 @@ void CEnvyApp::InitResources()
17151715
Settings.Interface.DisplayScaling =
17161716
nDPI < 100 ? 100 :
17171717
nDPI > 190 ? 200 :
1718-
(DWORD)( ( nDPI * 100 ) / 96 );
1718+
(DWORD)( nDPI * 100 / 96 );
17191719
}
17201720

17211721
//
@@ -1759,15 +1759,17 @@ void CEnvyApp::InitResources()
17591759
if ( Settings.Fonts.PacketDumpFont.IsEmpty() )
17601760
Settings.Fonts.PacketDumpFont = L"Lucida Console";
17611761

1762-
m_gdiFont.CreateFont( -(int)Settings.Fonts.DefaultSize, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE,
1762+
const int nFontSize = SCALE( Settings.Fonts.DefaultSize );
1763+
1764+
m_gdiFont.CreateFont( -nFontSize, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE,
17631765
DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, Settings.Fonts.Quality,
17641766
DEFAULT_PITCH|FF_DONTCARE, Settings.Fonts.DefaultFont );
17651767

1766-
m_gdiFontBold.CreateFont( -(int)Settings.Fonts.DefaultSize, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE,
1768+
m_gdiFontBold.CreateFont( -nFontSize, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE,
17671769
DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, Settings.Fonts.Quality,
17681770
DEFAULT_PITCH|FF_DONTCARE, Settings.Fonts.DefaultFont );
17691771

1770-
m_gdiFontLine.CreateFont( -(int)Settings.Fonts.DefaultSize, 0, 0, 0, FW_NORMAL, FALSE, TRUE, FALSE,
1772+
m_gdiFontLine.CreateFont( -nFontSize, 0, 0, 0, FW_NORMAL, FALSE, TRUE, FALSE,
17711773
DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, Settings.Fonts.Quality,
17721774
DEFAULT_PITCH|FF_DONTCARE, Settings.Fonts.DefaultFont );
17731775

Envy/Envy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,4 +498,4 @@ const LPCTSTR RT_GZIP = L"GZIP";
498498

499499

500500
// Saved-State Serialization: (Set Smart Version and _SER_VERSIONs)
501-
#define INTERNAL_VERSION 3
501+
#define INTERNAL_VERSION 4

Envy/Envy.rc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
2525
//
2626

2727
VS_VERSION_INFO VERSIONINFO
28-
PRODUCTVERSION 3,1
29-
FILEVERSION 3,1
28+
PRODUCTVERSION 4,0
29+
FILEVERSION 4,0
3030
FILEFLAGSMASK 0x1fL
3131
#ifdef _DEBUG
3232
FILEFLAGS 0x1L
@@ -42,8 +42,8 @@ BEGIN
4242
BLOCK "000004b0"
4343
BEGIN
4444
VALUE "ProductName", "Envy"
45-
VALUE "ProductVersion", "3.1"
46-
VALUE "FileVersion", "3.1"
45+
VALUE "ProductVersion", "4.0"
46+
VALUE "FileVersion", "4.0"
4747
VALUE "Title", "Envy"
4848
VALUE "InternalName", "Envy"
4949
VALUE "OriginalFilename", "Envy.exe"
@@ -282,18 +282,18 @@ IDR_HTML_BROWSER GZIP "Res\\Browser.htm.gz"
282282
// Dialog
283283
//
284284

285-
IDD_ABOUT DIALOGEX 0, 0, 298, 132
285+
IDD_ABOUT DIALOGEX 0, 0, 312, 132
286286
STYLE DS_SHELLFONT|DS_MODALFRAME|WS_POPUP|WS_CAPTION|WS_SYSMENU
287287
CAPTION "About Envy"
288288
FONT 8, "MS Shell Dlg"
289289
BEGIN
290-
CONTROL IDR_LOGO,IDC_LOGO,"Static",SS_BITMAP|SS_CENTERIMAGE|SS_REALSIZEIMAGE,235,3,55,56
291-
LTEXT "Envy Filesharing Client ",IDC_TITLE,20,15,200,10,SS_CENTERIMAGE // Substitute Bold Version
290+
CONTROL IDR_LOGO,IDC_LOGO,"Static",SS_BITMAP|SS_CENTERIMAGE|SS_REALSIZEIMAGE,240,5,55,56
291+
LTEXT "Envy Filesharing Client ",IDC_TITLE,20,15,200,10,SS_CENTERIMAGE // Substitute Bold Font
292292
LTEXT "� Envy Development Team, 2016-",IDC_COPYRIGHT,20,42,200,12 // Substitute Manifest LegalCopyright
293293
LTEXT "Envy� is free software; you can redistribute and/or modify it \nunder terms of the GNU Affero General Public License as published\nby the Free Software Foundation, version 3 or later. (AGPL v3)",IDC_STATIC,20,56,236,24
294294
LTEXT "Portions copyright Shareaza 2002-2008 and PeerProject 2008-2016.",IDC_STATIC,20,86,262,12
295295
LTEXT "http://getenvy.com",IDC_WEB,20,112,90,10
296-
DEFPUSHBUTTON "OK",IDOK,235,110,55,16
296+
DEFPUSHBUTTON "OK",IDOK,240,108,55,16
297297
END
298298

299299
IDD_SETTINGS_GENERAL DIALOGEX 0, 0, 282, 220

Envy/Envy.vcxproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@
109109
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
110110
<RuntimeTypeInfo>false</RuntimeTypeInfo>
111111
<FunctionLevelLinking>true</FunctionLevelLinking>
112+
<FloatingPointModel>Fast</FloatingPointModel>
112113
<PrecompiledHeader>Use</PrecompiledHeader>
113114
<PrecompiledHeaderFile>StdAfx.h</PrecompiledHeaderFile>
114115
<PrecompiledHeaderOutputFile>$(IntDir)$(ProjectName).pch</PrecompiledHeaderOutputFile>
@@ -162,6 +163,7 @@
162163
<SDLCheck>true</SDLCheck>
163164
<MultiProcessorCompilation>true</MultiProcessorCompilation>
164165
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
166+
<FloatingPointModel>Fast</FloatingPointModel>
165167
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
166168
<RuntimeTypeInfo>false</RuntimeTypeInfo>
167169
<PrecompiledHeader>Use</PrecompiledHeader>
@@ -220,6 +222,7 @@
220222
<SDLCheck>true</SDLCheck>
221223
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
222224
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
225+
<FloatingPointModel>Fast</FloatingPointModel>
223226
<StringPooling>true</StringPooling>
224227
<MultiProcessorCompilation>true</MultiProcessorCompilation>
225228
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@@ -282,6 +285,7 @@
282285
<IntrinsicFunctions>true</IntrinsicFunctions>
283286
<OmitFramePointers>true</OmitFramePointers>
284287
<SDLCheck>true</SDLCheck>
288+
<FloatingPointModel>Fast</FloatingPointModel>
285289
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
286290
<StringPooling>true</StringPooling>
287291
<MultiProcessorCompilation>true</MultiProcessorCompilation>
@@ -1636,3 +1640,4 @@
16361640
</VisualStudio>
16371641
</ProjectExtensions>
16381642
</Project>
1643+

Envy/Res/Banner.bmp

20.8 KB
Binary file not shown.

Envy/StdAfx.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,8 @@ INT_PTR MsgBox(UINT nIDPrompt, UINT nType = MB_OK, UINT nIDHelp = 0, DWORD* pnDe
10291029
((hr)==RPC_E_SERVERFAULT)|| \
10301030
((hr)==RPC_E_INVALID_OBJECT))
10311031

1032+
#define SCALE(size) ( Settings.Interface.DisplayScaling < 110UL ? (size) : (size) * (int)Settings.Interface.DisplayScaling / 100 )
1033+
10321034
#define TIMER_START DWORD tTest = GetTickCount(); // Temporary testing purposes [PPD]
10331035
#define TIMER_STOP tTest = GetTickCount() - tTest; CString strTest; strTest.Format( L"\r\n %.3f seconds", tTest / 1000.000 ); \
10341036
CFile pFile; if ( pFile.Open( Settings.General.Path + L"\\Timer.txt", CFile::modeReadWrite ) ) pFile.Seek( 0, CFile::end ); \

Envy/WizardConnectionPage.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// WizardConnectionPage.cpp
33
//
4-
// This file is part of Envy (getenvy.com) © 2016-2018
4+
// This file is part of Envy (getenvy.com) © 2016-2020
55
// Portions copyright Shareaza 2002-2008 and PeerProject 2008-2016
66
//
77
// Envy is free software. You may redistribute and/or modify it
@@ -475,6 +475,7 @@ void CWizardConnectionPage::OnRun()
475475
}
476476
}
477477

478+
// Reenable navigation buttons
478479
CWizardSheet* pSheet = GetSheet();
479480
if ( pSheet->GetDlgItem( ID_WIZBACK ) )
480481
pSheet->GetDlgItem( ID_WIZBACK )->EnableWindow();

Envy/WizardSheet.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// WizardSheet.cpp
33
//
4-
// This file is part of Envy (getenvy.com) © 2016-2018
4+
// This file is part of Envy (getenvy.com) © 2016-2020
55
// Portions copyright Shareaza 2002-2007 and PeerProject 2008-2016
66
//
77
// Envy is free software. You may redistribute and/or modify it
@@ -40,7 +40,7 @@ static char THIS_FILE[] = __FILE__;
4040
#define new DEBUG_NEW
4141
#endif // Debug
4242

43-
#define CONTROLBAR_HEIGHT 44
43+
#define CONTROLBAR_HEIGHT 44 // m_nNavBar Default
4444
#define BUTTON_GAP 8
4545

4646
/////////////////////////////////////////////////////////////////////////////
@@ -109,6 +109,8 @@ BOOL CWizardSheet::OnInitDialog()
109109
GetClientRect( &rc );
110110
const int nCenter = rc.Width() / 2 + 1; // Accomodate HighDPI
111111

112+
m_nNavBar = SCALE( CONTROLBAR_HEIGHT );
113+
112114
SetIcon( CoolInterface.ExtractIcon( IDR_MAINFRAME, FALSE ), FALSE );
113115
SetFont( &theApp.m_gdiFont );
114116

@@ -200,7 +202,7 @@ void CWizardSheet::OnSize(UINT nType, int cx, int cy)
200202
GetClientRect( &m_rcPage );
201203

202204
m_rcPage.top += Skin.m_nBanner;
203-
m_rcPage.bottom -= CONTROLBAR_HEIGHT + 2;
205+
m_rcPage.bottom -= m_nNavBar + 2;
204206

205207
pWnd->SetWindowPos( NULL, m_rcPage.left, m_rcPage.top, m_rcPage.Width(), m_rcPage.Height(), SWP_NOSIZE );
206208
}
@@ -226,14 +228,14 @@ void CWizardSheet::OnPaint()
226228
//dc.Draw3dRect( 0, Skin.m_nBanner, rc.Width() + 1, 1, RGB( 128, 128, 128 ), RGB( 128, 128, 128 ) );
227229

228230
//GetClientRect( &rc );
229-
rc.top = rc.bottom - CONTROLBAR_HEIGHT;
231+
rc.top = rc.bottom - m_nNavBar;
230232

231233
dc.Draw3dRect( 0, rc.top - 2, rc.Width() + 1, 2, RGB( 142, 141, 140 ), RGB( 255, 255, 255 ) ); // ToDo: Skinned bevel color?
232234

233235
if ( Images.m_bmDialog.m_hObject )
234236
CoolInterface.DrawWatermark( &dc, &rc, &Images.m_bmDialog );
235237
else
236-
dc.FillSolidRect( rc.left, rc.top, rc.Width(), CONTROLBAR_HEIGHT, Colors.m_crSysBtnFace ); // Colors.m_crDialog?
238+
dc.FillSolidRect( rc.left, rc.top, rc.Width(), m_nNavBar, Colors.m_crSysBtnFace ); // Colors.m_crDialog?
237239
}
238240

239241
HBRUSH CWizardSheet::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)

Envy/WizardSheet.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// WizardSheet.h
33
//
4-
// This file is part of Envy (getenvy.com) © 2016-2018
4+
// This file is part of Envy (getenvy.com) © 2016-2020
55
// Portions copyright Shareaza 2002-2007 and PeerProject 2008-2012
66
//
77
// Envy is free software. You may redistribute and/or modify it
@@ -29,8 +29,9 @@ class CWizardSheet : public CPropertySheetAdv
2929
public:
3030
CWizardSheet(CWnd *pParentWnd = NULL, UINT iSelectPage = 0);
3131

32-
CRect m_rcPage;
3332
CBitmap m_bmHeader;
33+
CRect m_rcPage;
34+
int m_nNavBar;
3435

3536
static BOOL RunWizard(CWnd* pParent = NULL);
3637

Envy/WndMain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ int CMainWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
462462
if ( ! m_wndStatusBar.Create( this ) ) return -1;
463463
m_wndStatusBar.SetIndicators( wID, 2 ); // 2 Panels = _countof( wID )
464464
m_wndStatusBar.SetPaneInfo( 0, ID_SEPARATOR, SBPS_STRETCH, 0 );
465-
m_wndStatusBar.SetPaneInfo( 1, ID_SEPARATOR, SBPS_NORMAL, 220 ); // Status Panel Width (lower-right corner)
465+
m_wndStatusBar.SetPaneInfo( 1, ID_SEPARATOR, SBPS_NORMAL, SCALE( 220 ) ); // Status Panel Width (lower-right corner)
466466
//m_wndStatusBar.SetPaneInfo( 2, ID_SEPARATOR, SBPS_NORMAL, 120 ); // IP address status panel?
467467

468468
EnableDocking( CBRS_ALIGN_ANY );

0 commit comments

Comments
 (0)