mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-25 01:57:47 +01:00
add dark theme
This commit is contained in:
parent
8b772680dc
commit
b42c3e1d49
@ -45,6 +45,27 @@ void __fastcall TConfigForm::LanguageImgClick(TObject *Sender)
|
|||||||
Application->Terminate();
|
Application->Terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void __fastcall TConfigForm::ThemePnlClick(TObject *Sender)
|
||||||
|
{
|
||||||
|
auto *ini = new TIniFile(".\\ddraw.ini");
|
||||||
|
auto theme =
|
||||||
|
ThemePnl->Color == (TColor)RGB(31, 31, 31) ? "Cobalt XEMedia" : "Windows10";
|
||||||
|
|
||||||
|
ini->WriteString("ddraw", "configtheme", theme);
|
||||||
|
|
||||||
|
delete ini;
|
||||||
|
|
||||||
|
ShellExecute(
|
||||||
|
NULL,
|
||||||
|
L"open",
|
||||||
|
Application->ExeName.w_str(),
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
SW_SHOWNORMAL);
|
||||||
|
|
||||||
|
Application->Terminate();
|
||||||
|
}
|
||||||
|
|
||||||
void __fastcall TConfigForm::RestoreDefaultsBtnClick(TObject *Sender)
|
void __fastcall TConfigForm::RestoreDefaultsBtnClick(TObject *Sender)
|
||||||
{
|
{
|
||||||
if (Application->MessageBox(
|
if (Application->MessageBox(
|
||||||
@ -660,6 +681,18 @@ void __fastcall TConfigForm::FormCreate(TObject *Sender)
|
|||||||
|
|
||||||
auto *ini = new TIniFile(".\\ddraw.ini");
|
auto *ini = new TIniFile(".\\ddraw.ini");
|
||||||
|
|
||||||
|
if (ini->ReadString("ddraw", "configtheme", "Windows10") == "Cobalt XEMedia") {
|
||||||
|
|
||||||
|
ThemePnl->Color = (TColor)RGB(243, 243, 243);
|
||||||
|
DisplayPnl->StyleElements = TStyleElements(seFont + seClient + seBorder);
|
||||||
|
AdvancedPnl->StyleElements = TStyleElements(seFont + seClient + seBorder);
|
||||||
|
HotkeyPnl->StyleElements = TStyleElements(seFont + seClient + seBorder);
|
||||||
|
CompatibilityPnl->StyleElements = TStyleElements(seFont + seClient + seBorder);
|
||||||
|
|
||||||
|
MenuPnl->StyleElements = TStyleElements(seFont);
|
||||||
|
MenuPnl->Color = (TColor)RGB(31, 31, 31);
|
||||||
|
}
|
||||||
|
|
||||||
ApplyTranslation(ini);
|
ApplyTranslation(ini);
|
||||||
|
|
||||||
/* Display Settings */
|
/* Display Settings */
|
||||||
|
@ -2778,7 +2778,7 @@ object ConfigForm: TConfigForm
|
|||||||
OnPaint = PboxPaint
|
OnPaint = PboxPaint
|
||||||
end
|
end
|
||||||
object LanguageImg: TImage
|
object LanguageImg: TImage
|
||||||
Left = 477
|
Left = 453
|
||||||
Top = 8
|
Top = 8
|
||||||
Width = 16
|
Width = 16
|
||||||
Height = 11
|
Height = 11
|
||||||
@ -2805,7 +2805,6 @@ object ConfigForm: TConfigForm
|
|||||||
Stretch = True
|
Stretch = True
|
||||||
Visible = False
|
Visible = False
|
||||||
OnClick = LanguageImgClick
|
OnClick = LanguageImgClick
|
||||||
ExplicitLeft = 569
|
|
||||||
end
|
end
|
||||||
object PresentationCbx: TComboBox
|
object PresentationCbx: TComboBox
|
||||||
Left = 41
|
Left = 41
|
||||||
@ -2866,6 +2865,20 @@ object ConfigForm: TConfigForm
|
|||||||
TabOrder = 4
|
TabOrder = 4
|
||||||
OnClick = DevmodeChkClick
|
OnClick = DevmodeChkClick
|
||||||
end
|
end
|
||||||
|
object ThemePnl: TPanel
|
||||||
|
Left = 475
|
||||||
|
Top = 8
|
||||||
|
Width = 16
|
||||||
|
Height = 11
|
||||||
|
Anchors = [akTop, akRight]
|
||||||
|
BevelOuter = bvNone
|
||||||
|
Color = 2039583
|
||||||
|
ParentBackground = False
|
||||||
|
TabOrder = 5
|
||||||
|
StyleElements = [seFont, seBorder]
|
||||||
|
OnClick = ThemePnlClick
|
||||||
|
ExplicitLeft = 471
|
||||||
|
end
|
||||||
end
|
end
|
||||||
object CompatibilityPnl: TPanel
|
object CompatibilityPnl: TPanel
|
||||||
Left = 233
|
Left = 233
|
||||||
@ -3579,7 +3592,7 @@ object ConfigForm: TConfigForm
|
|||||||
Top = 440
|
Top = 440
|
||||||
Width = 227
|
Width = 227
|
||||||
Height = 22
|
Height = 22
|
||||||
Anchors = [akLeft, akTop, akRight]
|
Anchors = [akLeft, akRight, akBottom]
|
||||||
Caption = 'Restore default settings'
|
Caption = 'Restore default settings'
|
||||||
Flat = True
|
Flat = True
|
||||||
Font.Charset = DEFAULT_CHARSET
|
Font.Charset = DEFAULT_CHARSET
|
||||||
|
@ -80,6 +80,7 @@ __published: // Von der IDE verwaltete Komponenten
|
|||||||
TEdit *ScreenshotEdt;
|
TEdit *ScreenshotEdt;
|
||||||
TComboBox *ShaderD3DCbx;
|
TComboBox *ShaderD3DCbx;
|
||||||
TSpeedButton *RestoreDefaultsBtn;
|
TSpeedButton *RestoreDefaultsBtn;
|
||||||
|
TPanel *ThemePnl;
|
||||||
void __fastcall DisplayBtnClick(TObject *Sender);
|
void __fastcall DisplayBtnClick(TObject *Sender);
|
||||||
void __fastcall AdvancedBtnClick(TObject *Sender);
|
void __fastcall AdvancedBtnClick(TObject *Sender);
|
||||||
void __fastcall CompatibilityBtnClick(TObject *Sender);
|
void __fastcall CompatibilityBtnClick(TObject *Sender);
|
||||||
@ -109,6 +110,7 @@ __published: // Von der IDE verwaltete Komponenten
|
|||||||
void __fastcall HotkeyEdtKeyUp(TObject *Sender, WORD &Key, TShiftState Shift);
|
void __fastcall HotkeyEdtKeyUp(TObject *Sender, WORD &Key, TShiftState Shift);
|
||||||
void __fastcall ShaderD3DCbxChange(TObject *Sender);
|
void __fastcall ShaderD3DCbxChange(TObject *Sender);
|
||||||
void __fastcall RestoreDefaultsBtnClick(TObject *Sender);
|
void __fastcall RestoreDefaultsBtnClick(TObject *Sender);
|
||||||
|
void __fastcall ThemePnlClick(TObject *Sender);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@
|
|||||||
<IncludePath>cnc-ddraw\config\;$(IncludePath)</IncludePath>
|
<IncludePath>cnc-ddraw\config\;$(IncludePath)</IncludePath>
|
||||||
<ILINK_LibraryPath>cnc-ddraw\config\;$(ILINK_LibraryPath)</ILINK_LibraryPath>
|
<ILINK_LibraryPath>cnc-ddraw\config\;$(ILINK_LibraryPath)</ILINK_LibraryPath>
|
||||||
<SanitizedProjectName>cnc-ddraw_config</SanitizedProjectName>
|
<SanitizedProjectName>cnc-ddraw_config</SanitizedProjectName>
|
||||||
<Custom_Styles>Windows10|VCLSTYLE|$(BDSCOMMONDIR)\Styles\Windows10.vsf</Custom_Styles>
|
<Custom_Styles>Windows10|VCLSTYLE|$(BDSCOMMONDIR)\Styles\Windows10.vsf;"Cobalt XEMedia|VCLSTYLE|$(BDSCOMMONDIR)\Styles\CobaltXEMedia.vsf"</Custom_Styles>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Base_Win32)'!=''">
|
<PropertyGroup Condition="'$(Base_Win32)'!=''">
|
||||||
<PackageImports>adortl;appanalytics;bcbie;bcbsmp;bindcomp;bindcompdbx;bindcompfmx;bindcompvcl;bindengine;CloudService;CustomIPTransport;dbexpress;dbrtl;dbxcds;DbxClientDriver;DbxCommonDriver;DBXInterBaseDriver;DBXMySQLDriver;DBXSqliteDriver;dsnap;dsnapcon;dsnapxml;FireDAC;FireDACADSDriver;FireDACCommon;FireDACCommonDriver;FireDACCommonODBC;FireDACIBDriver;FireDACMSAccDriver;FireDACMySQLDriver;FireDACPgDriver;FireDACSqliteDriver;fmx;fmxase;fmxdae;fmxFireDAC;fmxobj;IndyCore;IndyIPClient;IndyIPCommon;IndyIPServer;IndyProtocols;IndySystem;inet;inetdb;inetdbxpress;RESTBackendComponents;RESTComponents;rtl;soapmidas;soaprtl;soapserver;svn;tethering;vcl;vclactnband;vcldb;vcldsnap;vclFireDAC;vclie;vclimg;VCLRESTComponents;VclSmp;vcltouch;vclwinx;vclx;xmlrtl;$(PackageImports)</PackageImports>
|
<PackageImports>adortl;appanalytics;bcbie;bcbsmp;bindcomp;bindcompdbx;bindcompfmx;bindcompvcl;bindengine;CloudService;CustomIPTransport;dbexpress;dbrtl;dbxcds;DbxClientDriver;DbxCommonDriver;DBXInterBaseDriver;DBXMySQLDriver;DBXSqliteDriver;dsnap;dsnapcon;dsnapxml;FireDAC;FireDACADSDriver;FireDACCommon;FireDACCommonDriver;FireDACCommonODBC;FireDACIBDriver;FireDACMSAccDriver;FireDACMySQLDriver;FireDACPgDriver;FireDACSqliteDriver;fmx;fmxase;fmxdae;fmxFireDAC;fmxobj;IndyCore;IndyIPClient;IndyIPCommon;IndyIPServer;IndyProtocols;IndySystem;inet;inetdb;inetdbxpress;RESTBackendComponents;RESTComponents;rtl;soapmidas;soaprtl;soapserver;svn;tethering;vcl;vclactnband;vcldb;vcldsnap;vclFireDAC;vclie;vclimg;VCLRESTComponents;VclSmp;vcltouch;vclwinx;vclx;xmlrtl;$(PackageImports)</PackageImports>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
#include <vcl.h>
|
#include <vcl.h>
|
||||||
|
#include <IniFiles.hpp>
|
||||||
#pragma hdrstop
|
#pragma hdrstop
|
||||||
#include <tchar.h>
|
#include <tchar.h>
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
@ -14,7 +15,15 @@ int WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, int)
|
|||||||
{
|
{
|
||||||
Application->Initialize();
|
Application->Initialize();
|
||||||
Application->MainFormOnTaskBar = true;
|
Application->MainFormOnTaskBar = true;
|
||||||
TStyleManager::TrySetStyle("Windows10");
|
|
||||||
|
auto *ini = new TIniFile(".\\ddraw.ini");
|
||||||
|
auto theme = ini->ReadString("ddraw", "configtheme", "Windows10");
|
||||||
|
|
||||||
|
TStyleManager::TrySetStyle(
|
||||||
|
theme == "Cobalt XEMedia" ? "Cobalt XEMedia" : "Windows10");
|
||||||
|
|
||||||
|
delete ini;
|
||||||
|
|
||||||
Application->CreateForm(__classid(TConfigForm), &ConfigForm);
|
Application->CreateForm(__classid(TConfigForm), &ConfigForm);
|
||||||
Application->Run();
|
Application->Run();
|
||||||
}
|
}
|
||||||
|
@ -300,6 +300,9 @@ static void cfg_create_ini()
|
|||||||
"; cnc-ddraw config program language, possible values: auto, english, chinese, german, spanish, russian, hungarian, french, italian\n"
|
"; cnc-ddraw config program language, possible values: auto, english, chinese, german, spanish, russian, hungarian, french, italian\n"
|
||||||
"configlang=auto\n"
|
"configlang=auto\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; cnc-ddraw config program theme, possible values: Windows10, Cobalt XEMedia\n"
|
||||||
|
"configtheme=Windows10\n"
|
||||||
|
"\n"
|
||||||
"; Where should screenshots be saved\n"
|
"; Where should screenshots be saved\n"
|
||||||
"screenshotdir=.\\Screenshots\\\n"
|
"screenshotdir=.\\Screenshots\\\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user