diff --git a/README.md b/README.md index b451a4c..d2b350e 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ This script automatically copies the resources and creates shortcuts to ensure e - Run `install.ps1` in an administrator powershell prompt - requires admin access to i) modify registry entries to change file association to script and ii) copy icons and stylesheet to intel Quartus directory - Optional: Rename or remove the old shortcut. This depends on your installation (Mine is under `C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Intel FPGA 23.1std.1.993 Lite Edition\Quartus Prime Lite Edition 23.1std.1.993`) +- RTL view: Select custom theme for dark mode colors ## Images @@ -21,6 +22,8 @@ This script automatically copies the resources and creates shortcuts to ensure e ![Dark mode report view image](sample2.png) +![Dark mode RTL view image](sample3.png) + ## Attribution See `LICENSE.md` for diff --git a/dark_icons/light/window_close.png b/dark_icons/light/window_close.png new file mode 100644 index 0000000..79f16fe Binary files /dev/null and b/dark_icons/light/window_close.png differ diff --git a/dark_icons/light/window_close@2x.png b/dark_icons/light/window_close@2x.png new file mode 100644 index 0000000..7152832 Binary files /dev/null and b/dark_icons/light/window_close@2x.png differ diff --git a/dark_icons/light/window_close_disabled.png b/dark_icons/light/window_close_disabled.png new file mode 100644 index 0000000..6fafd3a Binary files /dev/null and b/dark_icons/light/window_close_disabled.png differ diff --git a/dark_icons/light/window_close_disabled@2x.png b/dark_icons/light/window_close_disabled@2x.png new file mode 100644 index 0000000..0a852da Binary files /dev/null and b/dark_icons/light/window_close_disabled@2x.png differ diff --git a/dark_icons/light/window_close_focus.png b/dark_icons/light/window_close_focus.png new file mode 100644 index 0000000..5745d2a Binary files /dev/null and b/dark_icons/light/window_close_focus.png differ diff --git a/dark_icons/light/window_close_focus@2x.png b/dark_icons/light/window_close_focus@2x.png new file mode 100644 index 0000000..f5bc168 Binary files /dev/null and b/dark_icons/light/window_close_focus@2x.png differ diff --git a/dark_icons/light/window_close_pressed.png b/dark_icons/light/window_close_pressed.png new file mode 100644 index 0000000..c8dca67 Binary files /dev/null and b/dark_icons/light/window_close_pressed.png differ diff --git a/dark_icons/light/window_close_pressed@2x.png b/dark_icons/light/window_close_pressed@2x.png new file mode 100644 index 0000000..d0ec9a5 Binary files /dev/null and b/dark_icons/light/window_close_pressed@2x.png differ diff --git a/darkstyle.qss b/darkstyle.qss index 74bcf26..2001b2c 100644 --- a/darkstyle.qss +++ b/darkstyle.qss @@ -37,6 +37,28 @@ QToolBar * { padding: 0px; } +/* For some reason I can't set the background color of the window manager tabs +in RTL viewer, so I am just going to make it have the defualt white background +and black text */ +NUIQ_MDI_AREA QTabBar::tab { + color: #19232D; +} + +NUIQ_MDI_AREA QTabBar::close-button { + border: 0; + margin: 0; + padding: 4px; + image: url(":/dark_icons/light/window_close.png"); +} + +NUIQ_MDI_AREA QTabBar::close-button:hover { + image: url(":/dark_icons/light/window_close_focus.png"); +} + +NUIQ_MDI_AREA QTabBar::close-button:pressed { + image: url(":/dark_icons/light/window_close_pressed.png"); +} + /* QWidget ---------------------------------------------------------------- --------------------------------------------------------------------------- */ diff --git a/install.ps1 b/install.ps1 index 17a7304..3910591 100644 --- a/install.ps1 +++ b/install.ps1 @@ -47,7 +47,7 @@ $WScriptShell = New-Object -ComObject WScript.Shell $shortcut = $WScriptShell.CreateShortcut("$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Quartus.lnk") $shortcut.TargetPath = "wscript.exe" $shortcut.Arguments = "`"$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Quartus.vbs`"" -$shortcut.WorkingDirectory = "D:\intelFPGA_lite\23.1std" +$shortcut.WorkingDirectory = $(Split-Path $installPath) $shortcut.IconLocation = "$installPath\bin64\quartus.exe,0" $shortcut.Save() @@ -57,7 +57,8 @@ $scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path $content = Get-Content "$scriptDir\darkstyle.qss" $styleWithPath = $content -replace 'url\(":/dark_icons', "url(`"$($installPath -replace '\\', '/')/ZZZ_dark_icons" Set-Content -Path "$installPath\darkstyle.qss" -Value $styleWithPath -Copy-Item -Path "$scriptDir\dark_icons" -Destination "$installPath\ZZZ_dark_icons" -Recurse -Force +New-Item -Force -Type Directory "$installPath\ZZZ_dark_icons" +Copy-Item -Path "$scriptDir\dark_icons\*" -Destination "$installPath\ZZZ_dark_icons" -Recurse -Force Write-Output "Rewrite registry entries for file association open commands" @@ -85,13 +86,14 @@ $quartusSettingsPath = "$HOME\quartus2.qreg" if (Test-Path $quartusSettingsPath) { $suffix = 1 do { - $quartusBakPath = [System.IO.Path]::ChangeExtension($quartusSettingsPath, "$suffix" + [System.IO.Path]::GetExtension($quartusSettingsPath)) + $quartusBakPath = [System.IO.Path]::ChangeExtension($quartusSettingsPath, "$suffix" + "_backup" + [System.IO.Path]::GetExtension($quartusSettingsPath)) $suffix++ } while (Test-Path $quartusBakPath) } Copy-Item -Path $quartusSettingsPath -Destination $quartusBakPath $replacements = @{ + # Scintilla based text editor "Altera_Foundation_Class\\AFCQ_TED_KEYWORD_COLOR.+" = "Altera_Foundation_Class\AFCQ_TED_KEYWORD_COLOR=@Variant(\0\0\0\x43\x1\xff\xff\xff\xff\xff\xff\xff\xff\0\0)" "Altera_Foundation_Class\\AFCQ_TED_NORMAL_COLOR.+" = "Altera_Foundation_Class\AFCQ_TED_NORMAL_COLOR=@Variant(\0\0\0\x43\x1\xff\xff\xdf\xdf\xe1\xe1\xe2\xe2\0\0)" "Altera_Foundation_Class\\AFCQ_TED_BACKGROUND_COLOR.+" = "Altera_Foundation_Class\AFCQ_TED_BACKGROUND_COLOR=@Variant(\0\0\0\x43\x1\xff\xff\x19\x19##--\0\0)" @@ -109,6 +111,20 @@ $replacements = @{ "Altera_Foundation_Class\\AFCQ_TED_STRING_COLOR.+" = "Altera_Foundation_Class\AFCQ_TED_STRING_COLOR=@Variant(\0\0\0\x43\x1\xff\xff\xe8\xe8\0\0\xe8\xe8\0\0)" "Altera_Foundation_Class\\AFCQ_TED_IDENTIFIER_COLOR.+" = "Altera_Foundation_Class\AFCQ_TED_IDENTIFIER_COLOR=@Variant(\0\0\0\x43\x1\xff\xff\xe8\xe8\0\0\xe8\xe8\0\0)" "Altera_Foundation_Class\\AFCQ_MSW_INFO_COLOR.+=" = "Altera_Foundation_Class\AFCQ_MSW_INFO_COLOR=@Variant(\0\0\0\x43\x1\xff\xff\0\0\xc0\xc0\0\0\0\0)" + + # RTL viewer + "Altera_Foundation_Class\\AFCQ_NUI_BACKGROUND_COLOR.+" = "Altera_Foundation_Class\AFCQ_NUI_BACKGROUND_COLOR=@Variant(\0\0\0\x43\x1\xff\xff\x19\x19##--\0\0)" + "Altera_Foundation_Class\\AFCQ_NUI_INSTANE_FONT_COLOR.+" = "Altera_Foundation_Class\AFCQ_NUI_INSTANE_FONT_COLOR=@Variant(\0\0\0\x43\x1\xff\xff\xff\xff\0\0\xff\xff\0\0)" + "Altera_Foundation_Class\\AFCQ_NUI_RIPPER_COLOR.+" = "Altera_Foundation_Class\AFCQ_NUI_RIPPER_COLOR=@Variant(\0\0\0\x43\x1\xff\xff\0\0\xff\xff\xff\xff\0\0)" + "Altera_Foundation_Class\\AFCQ_NUI_NET_COLOR.+" = "Altera_Foundation_Class\AFCQ_NUI_NET_COLOR=@Variant(\0\0\0\x43\x1\xff\xff\xff\xff\xff\xff\0\0\0\0)" + "Altera_Foundation_Class\\AFCQ_NUI_PIN_COLOR.+" = "Altera_Foundation_Class\AFCQ_NUI_PIN_COLOR=@Variant(\0\0\0\x43\x1\xff\xff\0\0\xff\xff\xff\xff\0\0)" + "Altera_Foundation_Class\\AFCQ_NUI_PORT_COLOR.+" = "Altera_Foundation_Class\AFCQ_NUI_PORT_COLOR=@Variant(\0\0\0\x43\x1\xff\xff\0\0\xff\xff\xff\xff\0\0)" + "Altera_Foundation_Class\\AFCQ_NUI_PRIMITIVE_COLOR.+" = "Altera_Foundation_Class\AFCQ_NUI_PRIMITIVE_COLOR=@Variant(\0\0\0\x43\x1\xff\xff\x1a\x1arr\xbb\xbb\0\0)" + "Altera_Foundation_Class\\AFCQ_NUI_SELECTION_COLOR.+" = "Altera_Foundation_Class\AFCQ_NUI_SELECTION_COLOR=@Variant(\0\0\0\x43\x1\xff\xff\xff\xff\0\0\0\0\0\0)" + "Altera_Foundation_Class\\AFCQ_NUI_INSTANCE_COLOR.+" = "Altera_Foundation_Class\AFCQ_NUI_INSTANCE_COLOR=@Variant(\0\0\0\x43\x1\xff\xff\0\0\x80\x80\0\0\0\0)" + "Altera_Foundation_Class\\AFCQ_NUI_INSTANCE_REGION_COLOR.+" = "Altera_Foundation_Class\AFCQ_NUI_INSTANCE_REGION_COLOR=@Variant(\0\0\0\x43\x1\xff\xff\x37\x37\x41\x41OO\0\0)" + "Altera_Foundation_Class\\AFCQ_NUI_INSTANCE_ATOM_COLOR.+" = "Altera_Foundation_Class\AFCQ_NUI_INSTANCE_ATOM_COLOR=@Variant(\0\0\0\x43\x1\xff\xff\x1a\x1arr\xbb\xbb\0\0)" + "Altera_Foundation_Class\\AFCQ_NUI_ENCRYPTED_INSTANCE_COLOR.+" = "Altera_Foundation_Class\AFCQ_NUI_ENCRYPTED_INSTANCE_COLOR=@Variant(\0\0\0\x43\x1\xff\xff\x45\x45SSdd\0\0)" } $quartusSettings = Get-Content -Path $quartusSettingsPath -Raw foreach ($key in $replacements.Keys) { diff --git a/sample3.png b/sample3.png new file mode 100644 index 0000000..f160e9d Binary files /dev/null and b/sample3.png differ