Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Commit

Permalink
Review Comments.
Browse files Browse the repository at this point in the history
1. Changing resource names
  • Loading branch information
abose committed Feb 11, 2015
1 parent d807bf4 commit 64c5d38
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 87 deletions.
6 changes: 3 additions & 3 deletions appshell/cef_dark_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,19 +234,19 @@ void cef_dark_window::LoadSysButtonImages()

if(scaleFactor>=250)
{
BUTTON_RESOURCES(250X)
BUTTON_RESOURCES(2_5X)
}
else if(scaleFactor>=200)
{
BUTTON_RESOURCES(2X)
}
else if(scaleFactor>=150)
{
BUTTON_RESOURCES(150X)
BUTTON_RESOURCES(1_5X)
}
else if(scaleFactor>=125)
{
BUTTON_RESOURCES(125X)
BUTTON_RESOURCES(1_25X)
}
else
{
Expand Down
15 changes: 5 additions & 10 deletions appshell/cef_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,14 +355,9 @@ BOOL cef_window::TrackNonClientMouseEvents(bool track/*=true*/)
//Get the Horizontal DPI scaling factor.
UINT cef_window::GetDPIScalingX() const
{
UINT scaleDPIX = 100;
if(mWnd)
{
HDC dc = ::GetDC(mWnd);
float lpx = dc ? GetDeviceCaps(dc,LOGPIXELSX):DEFAULT_WINDOWS_DPI ;
//scale factor as it would look in a default(96dpi) screen. the default will be always 96 logical DPI when scaling is applied in windows.
//see. https://msdn.microsoft.com/en-us/library/ms701681(v=vs.85).aspx
scaleDPIX = (lpx/DEFAULT_WINDOWS_DPI)*100;
}
return scaleDPIX;
HDC dc = GetDC();
float lpx = dc ? GetDeviceCaps(dc,LOGPIXELSX):DEFAULT_WINDOWS_DPI ;
//scale factor as it would look in a default(96dpi) screen. the default will be always 96 logical DPI when scaling is applied in windows.
//see. https://msdn.microsoft.com/en-us/library/ms701681(v=vs.85).aspx
return (lpx/DEFAULT_WINDOWS_DPI)*100;
}
2 changes: 1 addition & 1 deletion appshell/cef_window.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ class cef_window
HDC GetWindowDC()
{ return ::GetWindowDC(mWnd); }

HDC GetDC()
HDC GetDC() const
{ return ::GetDC(mWnd); }

int ReleaseDC(HDC dc)
Expand Down
74 changes: 37 additions & 37 deletions appshell/cefclient.rc
Original file line number Diff line number Diff line change
Expand Up @@ -59,31 +59,31 @@ IDB_RESTORE_BUTTON_1X PNG "res\\restore.pn
IDB_RESTORE_HOVER_BUTTON_1X PNG "res\\restore-hover.png"
IDB_RESTORE_PRESSED_BUTTON_1X PNG "res\\restore-pressed.png"

IDB_CLOSE_BUTTON_125X PNG "res\\1.25x\\close.png"
IDB_CLOSE_HOVER_BUTTON_125X PNG "res\\1.25x\\close-hover.png"
IDB_CLOSE_PRESSED_BUTTON_125X PNG "res\\1.25x\\close-pressed.png"
IDB_MAX_BUTTON_125X PNG "res\\1.25x\\max.png"
IDB_MAX_HOVER_BUTTON_125X PNG "res\\1.25x\\max-hover.png"
IDB_MAX_PRESSED_BUTTON_125X PNG "res\\1.25x\\max-pressed.png"
IDB_MIN_BUTTON_125X PNG "res\\1.25x\\min.png"
IDB_MIN_HOVER_BUTTON_125X PNG "res\\1.25x\\min-hover.png"
IDB_MIN_PRESSED_BUTTON_125X PNG "res\\1.25x\\min-pressed.png"
IDB_RESTORE_BUTTON_125X PNG "res\\1.25x\\restore.png"
IDB_RESTORE_HOVER_BUTTON_125X PNG "res\\1.25x\\restore-hover.png"
IDB_RESTORE_PRESSED_BUTTON_125X PNG "res\\1.25x\\restore-pressed.png"

IDB_CLOSE_BUTTON_150X PNG "res\\1.5x\\close.png"
IDB_CLOSE_HOVER_BUTTON_150X PNG "res\\1.5x\\close-hover.png"
IDB_CLOSE_PRESSED_BUTTON_150X PNG "res\\1.5x\\close-pressed.png"
IDB_MAX_BUTTON_150X PNG "res\\1.5x\\max.png"
IDB_MAX_HOVER_BUTTON_150X PNG "res\\1.5x\\max-hover.png"
IDB_MAX_PRESSED_BUTTON_150X PNG "res\\1.5x\\max-pressed.png"
IDB_MIN_BUTTON_150X PNG "res\\1.5x\\min.png"
IDB_MIN_HOVER_BUTTON_150X PNG "res\\1.5x\\min-hover.png"
IDB_MIN_PRESSED_BUTTON_150X PNG "res\\1.5x\\min-pressed.png"
IDB_RESTORE_BUTTON_150X PNG "res\\1.5x\\restore.png"
IDB_RESTORE_HOVER_BUTTON_150X PNG "res\\1.5x\\restore-hover.png"
IDB_RESTORE_PRESSED_BUTTON_150X PNG "res\\1.5x\\restore-pressed.png"
IDB_CLOSE_BUTTON_1_25X PNG "res\\1.25x\\close.png"
IDB_CLOSE_HOVER_BUTTON_1_25X PNG "res\\1.25x\\close-hover.png"
IDB_CLOSE_PRESSED_BUTTON_1_25X PNG "res\\1.25x\\close-pressed.png"
IDB_MAX_BUTTON_1_25X PNG "res\\1.25x\\max.png"
IDB_MAX_HOVER_BUTTON_1_25X PNG "res\\1.25x\\max-hover.png"
IDB_MAX_PRESSED_BUTTON_1_25X PNG "res\\1.25x\\max-pressed.png"
IDB_MIN_BUTTON_1_25X PNG "res\\1.25x\\min.png"
IDB_MIN_HOVER_BUTTON_1_25X PNG "res\\1.25x\\min-hover.png"
IDB_MIN_PRESSED_BUTTON_1_25X PNG "res\\1.25x\\min-pressed.png"
IDB_RESTORE_BUTTON_1_25X PNG "res\\1.25x\\restore.png"
IDB_RESTORE_HOVER_BUTTON_1_25X PNG "res\\1.25x\\restore-hover.png"
IDB_RESTORE_PRESSED_BUTTON_1_25X PNG "res\\1.25x\\restore-pressed.png"

IDB_CLOSE_BUTTON_1_5X PNG "res\\1.5x\\close.png"
IDB_CLOSE_HOVER_BUTTON_1_5X PNG "res\\1.5x\\close-hover.png"
IDB_CLOSE_PRESSED_BUTTON_1_5X PNG "res\\1.5x\\close-pressed.png"
IDB_MAX_BUTTON_1_5X PNG "res\\1.5x\\max.png"
IDB_MAX_HOVER_BUTTON_1_5X PNG "res\\1.5x\\max-hover.png"
IDB_MAX_PRESSED_BUTTON_1_5X PNG "res\\1.5x\\max-pressed.png"
IDB_MIN_BUTTON_1_5X PNG "res\\1.5x\\min.png"
IDB_MIN_HOVER_BUTTON_1_5X PNG "res\\1.5x\\min-hover.png"
IDB_MIN_PRESSED_BUTTON_1_5X PNG "res\\1.5x\\min-pressed.png"
IDB_RESTORE_BUTTON_1_5X PNG "res\\1.5x\\restore.png"
IDB_RESTORE_HOVER_BUTTON_1_5X PNG "res\\1.5x\\restore-hover.png"
IDB_RESTORE_PRESSED_BUTTON_1_5X PNG "res\\1.5x\\restore-pressed.png"

IDB_CLOSE_BUTTON_2X PNG "res\\2x\\close.png"
IDB_CLOSE_HOVER_BUTTON_2X PNG "res\\2x\\close-hover.png"
Expand All @@ -98,18 +98,18 @@ IDB_RESTORE_BUTTON_2X PNG "res\\2x\\restor
IDB_RESTORE_HOVER_BUTTON_2X PNG "res\\2x\\restore-hover.png"
IDB_RESTORE_PRESSED_BUTTON_2X PNG "res\\2x\\restore-pressed.png"

IDB_CLOSE_BUTTON_250X PNG "res\\2.5x\\close.png"
IDB_CLOSE_HOVER_BUTTON_250X PNG "res\\2.5x\\close-hover.png"
IDB_CLOSE_PRESSED_BUTTON_250X PNG "res\\2.5x\\close-pressed.png"
IDB_MAX_BUTTON_250X PNG "res\\2.5x\\max.png"
IDB_MAX_HOVER_BUTTON_250X PNG "res\\2.5x\\max-hover.png"
IDB_MAX_PRESSED_BUTTON_250X PNG "res\\2.5x\\max-pressed.png"
IDB_MIN_BUTTON_250X PNG "res\\2.5x\\min.png"
IDB_MIN_HOVER_BUTTON_250X PNG "res\\2.5x\\min-hover.png"
IDB_MIN_PRESSED_BUTTON_250X PNG "res\\2.5x\\min-pressed.png"
IDB_RESTORE_BUTTON_250X PNG "res\\2.5x\\restore.png"
IDB_RESTORE_HOVER_BUTTON_250X PNG "res\\2.5x\\restore-hover.png"
IDB_RESTORE_PRESSED_BUTTON_250X PNG "res\\2.5x\\restore-pressed.png"
IDB_CLOSE_BUTTON_2_5X PNG "res\\2.5x\\close.png"
IDB_CLOSE_HOVER_BUTTON_2_5X PNG "res\\2.5x\\close-hover.png"
IDB_CLOSE_PRESSED_BUTTON_2_5X PNG "res\\2.5x\\close-pressed.png"
IDB_MAX_BUTTON_2_5X PNG "res\\2.5x\\max.png"
IDB_MAX_HOVER_BUTTON_2_5X PNG "res\\2.5x\\max-hover.png"
IDB_MAX_PRESSED_BUTTON_2_5X PNG "res\\2.5x\\max-pressed.png"
IDB_MIN_BUTTON_2_5X PNG "res\\2.5x\\min.png"
IDB_MIN_HOVER_BUTTON_2_5X PNG "res\\2.5x\\min-hover.png"
IDB_MIN_PRESSED_BUTTON_2_5X PNG "res\\2.5x\\min-pressed.png"
IDB_RESTORE_BUTTON_2_5X PNG "res\\2.5x\\restore.png"
IDB_RESTORE_HOVER_BUTTON_2_5X PNG "res\\2.5x\\restore-hover.png"
IDB_RESTORE_PRESSED_BUTTON_2_5X PNG "res\\2.5x\\restore-pressed.png"

#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
Expand Down
72 changes: 36 additions & 36 deletions appshell/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,31 +38,31 @@
#define IDB_RESTORE_HOVER_BUTTON_1X 310
#define IDB_RESTORE_PRESSED_BUTTON_1X 311

#define IDB_CLOSE_BUTTON_125X 312
#define IDB_CLOSE_HOVER_BUTTON_125X 313
#define IDB_CLOSE_PRESSED_BUTTON_125X 314
#define IDB_MAX_BUTTON_125X 315
#define IDB_MAX_HOVER_BUTTON_125X 316
#define IDB_MAX_PRESSED_BUTTON_125X 317
#define IDB_MIN_BUTTON_125X 318
#define IDB_MIN_HOVER_BUTTON_125X 319
#define IDB_MIN_PRESSED_BUTTON_125X 320
#define IDB_RESTORE_BUTTON_125X 321
#define IDB_RESTORE_HOVER_BUTTON_125X 322
#define IDB_RESTORE_PRESSED_BUTTON_125X 323
#define IDB_CLOSE_BUTTON_1_25X 312
#define IDB_CLOSE_HOVER_BUTTON_1_25X 313
#define IDB_CLOSE_PRESSED_BUTTON_1_25X 314
#define IDB_MAX_BUTTON_1_25X 315
#define IDB_MAX_HOVER_BUTTON_1_25X 316
#define IDB_MAX_PRESSED_BUTTON_1_25X 317
#define IDB_MIN_BUTTON_1_25X 318
#define IDB_MIN_HOVER_BUTTON_1_25X 319
#define IDB_MIN_PRESSED_BUTTON_1_25X 320
#define IDB_RESTORE_BUTTON_1_25X 321
#define IDB_RESTORE_HOVER_BUTTON_1_25X 322
#define IDB_RESTORE_PRESSED_BUTTON_1_25X 323

#define IDB_CLOSE_BUTTON_150X 324
#define IDB_CLOSE_HOVER_BUTTON_150X 325
#define IDB_CLOSE_PRESSED_BUTTON_150X 326
#define IDB_MAX_BUTTON_150X 327
#define IDB_MAX_HOVER_BUTTON_150X 328
#define IDB_MAX_PRESSED_BUTTON_150X 329
#define IDB_MIN_BUTTON_150X 330
#define IDB_MIN_HOVER_BUTTON_150X 331
#define IDB_MIN_PRESSED_BUTTON_150X 332
#define IDB_RESTORE_BUTTON_150X 333
#define IDB_RESTORE_HOVER_BUTTON_150X 334
#define IDB_RESTORE_PRESSED_BUTTON_150X 335
#define IDB_CLOSE_BUTTON_1_5X 324
#define IDB_CLOSE_HOVER_BUTTON_1_5X 325
#define IDB_CLOSE_PRESSED_BUTTON_1_5X 326
#define IDB_MAX_BUTTON_1_5X 327
#define IDB_MAX_HOVER_BUTTON_1_5X 328
#define IDB_MAX_PRESSED_BUTTON_1_5X 329
#define IDB_MIN_BUTTON_1_5X 330
#define IDB_MIN_HOVER_BUTTON_1_5X 331
#define IDB_MIN_PRESSED_BUTTON_1_5X 332
#define IDB_RESTORE_BUTTON_1_5X 333
#define IDB_RESTORE_HOVER_BUTTON_1_5X 334
#define IDB_RESTORE_PRESSED_BUTTON_1_5X 335

#define IDB_CLOSE_BUTTON_2X 336
#define IDB_CLOSE_HOVER_BUTTON_2X 337
Expand All @@ -77,18 +77,18 @@
#define IDB_RESTORE_PRESSED_BUTTON_2X 346
#define IDB_MAX_HOVER_BUTTON_2X 347

#define IDB_CLOSE_BUTTON_250X 348
#define IDB_CLOSE_HOVER_BUTTON_250X 349
#define IDB_CLOSE_PRESSED_BUTTON_250X 350
#define IDB_MAX_BUTTON_250X 351
#define IDB_MAX_HOVER_BUTTON_250X 352
#define IDB_MAX_PRESSED_BUTTON_250X 353
#define IDB_MIN_BUTTON_250X 354
#define IDB_MIN_HOVER_BUTTON_250X 355
#define IDB_MIN_PRESSED_BUTTON_250X 356
#define IDB_RESTORE_BUTTON_250X 357
#define IDB_RESTORE_HOVER_BUTTON_250X 358
#define IDB_RESTORE_PRESSED_BUTTON_250X 359
#define IDB_CLOSE_BUTTON_2_5X 348
#define IDB_CLOSE_HOVER_BUTTON_2_5X 349
#define IDB_CLOSE_PRESSED_BUTTON_2_5X 350
#define IDB_MAX_BUTTON_2_5X 351
#define IDB_MAX_HOVER_BUTTON_2_5X 352
#define IDB_MAX_PRESSED_BUTTON_2_5X 353
#define IDB_MIN_BUTTON_2_5X 354
#define IDB_MIN_HOVER_BUTTON_2_5X 355
#define IDB_MIN_PRESSED_BUTTON_2_5X 356
#define IDB_RESTORE_BUTTON_2_5X 357
#define IDB_RESTORE_HOVER_BUTTON_2_5X 358
#define IDB_RESTORE_PRESSED_BUTTON_2_5X 359

#define IDS_BINDING 1000
#define IDS_DIALOGS 1001
Expand Down

0 comments on commit 64c5d38

Please sign in to comment.