Skip to content

Commit

Permalink
Merge pull request #23 from marco-calautti/win-darkmode
Browse files Browse the repository at this point in the history
Win darkmode
  • Loading branch information
marco-calautti authored Dec 26, 2023
2 parents 5f5bcdd + 786e33e commit 2229724
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 16 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,32 @@ on:
pull_request:
branches: [ "master" ]

workflow_dispatch:

env:
BUILD_TYPE: Release
wxBUILD_SHARED: OFF
wxBUILD_USE_STATIC_RUNTIME: ON

jobs:
build-win32-msvc2019:
build-win-msvc2022:

runs-on: windows-2019
runs-on: windows-2022

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -G "Visual Studio 16 2019" -A Win32 -T v141_xp -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DwxBUILD_SHARED=${{env.wxBUILD_SHARED}} -DwxBUILD_USE_STATIC_RUNTIME=${{env.wxBUILD_USE_STATIC_RUNTIME}}
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DwxBUILD_SHARED=${{env.wxBUILD_SHARED}} -DwxBUILD_USE_STATIC_RUNTIME=${{env.wxBUILD_USE_STATIC_RUNTIME}}

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel 2

- uses: actions/upload-artifact@v3
with:
name: windows_bin_x86
name: windows_bin_x64
path: ${{github.workspace}}/build/app/Release/DeltaPatcher.exe

build-linux:
Expand Down Expand Up @@ -58,9 +60,9 @@ jobs:
name: linux_bin_gtk3_x86_64
path: ${{github.workspace}}/build/app/DeltaPatcher

build-macos1015-universal:
build-macos11-universal:

runs-on: macos-10.15
runs-on: macos-11

steps:
- uses: actions/checkout@v3
Expand All @@ -74,10 +76,10 @@ jobs:
run: |
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel 2
cd ${{github.workspace}}/build/app
zip -r macos10.15_bin_universal.zip DeltaPatcher.app/
zip -r macos11_bin_universal.zip DeltaPatcher.app/
- uses: actions/upload-artifact@v3
with:
name: macos10.15_bin_universal
path: ${{github.workspace}}/build/app/macos10.15_bin_universal.zip
name: macos11_bin_universal
path: ${{github.workspace}}/build/app/macos11_bin_universal.zip
3 changes: 3 additions & 0 deletions app/src/DPApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ bool DPApp::OnInit(){
locale.AddCatalog(wxT("deltapatcher"));
}
*/
#ifdef __WXMSW__
wxApp::MSWEnableDarkMode();
#endif
DeltaPatcherMainDialog* dialog=new DeltaPatcherMainDialog(NULL,patchName);

SetTopWindow(dialog);
Expand Down
7 changes: 4 additions & 3 deletions app/src/gui/DeltaPatcherDecodePanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <wx/filename.h>
#include <gui/DeltaPatcherDecodePanel.h>
#include <wx/filedlg.h>
#include <wx/generic/msgdlgg.h>

#include <gui/icons/open.xpm>
#include <gui/icons/save.xpm>
Expand Down Expand Up @@ -69,7 +70,7 @@ void DeltaPatcherDecodePanel::OnOpenPatch( wxCommandEvent& event )
void DeltaPatcherDecodePanel::OnApplyPatch( wxCommandEvent& event )
{
if(patchField->IsEmpty()||originalField->IsEmpty()){
wxMessageBox(_("Fill all the textboxes first!"),_("Warning"),wxICON_EXCLAMATION,this);
wxGenericMessageDialog(this, _("Fill all the textboxes first!"),_("Warning"),wxICON_EXCLAMATION).ShowModal();
return;
}

Expand Down Expand Up @@ -182,14 +183,14 @@ void DeltaPatcherDecodePanel::OnThreadUpdate(wxThreadEvent& evt)

if(code!=0){
logger->Log(Logger::LOG_ERROR,message);
wxMessageBox(_("An error has occurred!\nSee log for more information."),_("Warning"),wxICON_EXCLAMATION,this);
wxGenericMessageDialog(this,_("An error has occurred!\nSee log for more information."),_("Warning"),wxICON_EXCLAMATION).ShowModal();
}else{
if(!keepOriginalCheck->IsChecked()){ //we must not keep the original file
wxRemoveFile(threadOriginal);
wxRenameFile(threadModified,threadOriginal);
}
logger->Log(Logger::LOG_MESSAGE,_("Patch successfully applied!"));
wxMessageBox(_("Patch successfully applied!"),_("Notice"),wxICON_INFORMATION,this);
wxGenericMessageDialog(this,_("Patch successfully applied!"),_("Notice"),wxICON_INFORMATION).ShowModal();
}
}

Expand Down
7 changes: 4 additions & 3 deletions app/src/gui/DeltaPatcherEncodePanel.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <wx/filename.h>
#include <wx/filedlg.h>

#include <gui/DeltaPatcherEncodePanel.h>
#include <gui/DeltaPatcherDropHandler.h>
#include <gui/DeltaPatcherDropTarget.h>
Expand Down Expand Up @@ -147,7 +148,7 @@ void DeltaPatcherEncodePanel::OnSavePatch( wxCommandEvent& event )
void DeltaPatcherEncodePanel::OnCreatePatch( wxCommandEvent& event )
{
if(patchField->IsEmpty()||originalField->IsEmpty()||modifiedField->IsEmpty()){
wxMessageBox(_("Fill all the textboxes first!"),_("Warning"),wxICON_EXCLAMATION,this);
wxGenericMessageDialog(this,_("Fill all the textboxes first!"),_("Warning"),wxICON_EXCLAMATION);
return;
}

Expand Down Expand Up @@ -279,10 +280,10 @@ void DeltaPatcherEncodePanel::OnThreadUpdate(wxThreadEvent& evt)

if(code!=0){
logger->Log(Logger::LOG_ERROR,message);
wxMessageBox(_("An error has occurred!\nSee log for more information."),_("Warning"),wxICON_EXCLAMATION,this);
wxGenericMessageDialog(this,_("An error has occurred!\nSee log for more information."),_("Warning"),wxICON_EXCLAMATION);
}else{
logger->Log(Logger::LOG_MESSAGE,_("Patch successfully created!"));
wxMessageBox(_("Patch successfully created!"),_("Notice"),wxICON_INFORMATION,this);
wxGenericMessageDialog(this,_("Patch successfully created!"),_("Notice"),wxICON_INFORMATION);
}
}

Expand Down
2 changes: 1 addition & 1 deletion libs/wxWidgets
Submodule wxWidgets updated 4764 files

0 comments on commit 2229724

Please sign in to comment.