build: use a different colored app icon and a non-default STATUS_PORT for dev builds

By default the desktop app uses port 30305, unless a value is specifically set
in environment variable `STATUS_PORT`. For convenience of those developing the
app and running development builds, while simultaneously running production
builds (a.k.a. packaged builds, whether built locally or in CI), have `make
run` invoke `bin/nim_status_client` with `STATUS_PORT=30306`. That value can
still be overriden by manually invoking `make run` with a different value,
e.g. `make STATUS_PORT=30307 run` and `STATUS_PORT=30307 make run` are both
valid and achieve the same effect. NOTE: the port "sticks" in the database
after the first clean run, so when changing ports developers will need to
delete the data dir within their local repository, else the existing database
for dev builds will be stuck using whatever port was used previously. In the
future, we can figure out a means to always update the port setting in the
database just after the login event (but see #1505).

Also, for development builds use an icon (for the running app) that is
orangered (`#ff4500`) instead of the official blue color. This makes it much
easier to select between a running production instance and development instance
when Cmd-Tab'ing (on macOS, or equiv on Linux and Windows) through open
applications. Not all icons displayed at runtime have been changed in this
manner for development builds, just the main application icon, and that seems
to be sufficient to achieve the desired effect; though in the future we could
do similar for notification icon, menu bar icon, etc.
This commit is contained in:
Michael Bradley, Jr 2020-12-15 19:15:44 -06:00 committed by Iuri Matias
parent ba48b266a9
commit 13daa540e4
5 changed files with 24 additions and 1 deletions

View File

@ -443,22 +443,26 @@ clean: | clean-common
run: rcc $(RUN_TARGET)
NIM_STATUS_CLIENT_DEV ?= t
STATUS_PORT ?= 30306
run-linux:
echo -e "\e[92mRunning:\e[39m bin/nim_status_client"
NIM_STATUS_CLIENT_DEV="$(NIM_STATUS_CLIENT_DEV)" \
LD_LIBRARY_PATH="$(QT5_LIBDIR)":"$(STATUSGO_LIBDIR)" \
STATUS_PORT="$(STATUS_PORT)" \
./bin/nim_status_client
run-macos:
echo -e "\e[92mRunning:\e[39m bin/nim_status_client"
NIM_STATUS_CLIENT_DEV="$(NIM_STATUS_CLIENT_DEV)" \
STATUS_PORT="$(STATUS_PORT)" \
./bin/nim_status_client
run-windows: $(NIM_WINDOWS_PREBUILT_DLLS)
echo -e "\e[92mRunning:\e[39m bin/nim_status_client.exe"
NIM_STATUS_CLIENT_DEV="$(NIM_STATUS_CLIENT_DEV)" \
PATH="$(shell pwd)"/"$(shell dirname "$(DOTHERSIDE)")":"$(STATUSGO_LIBDIR)":"$(shell pwd)"/"$(shell dirname "$(NIM_WINDOWS_PREBUILT_DLLS)")":"$(PATH)" \
STATUS_PORT="$(STATUS_PORT)" \
./bin/nim_status_client.exe
endif # "variables.mk" was not included

View File

@ -47,9 +47,11 @@ proc mainProc() =
if getEnv("NIM_STATUS_CLIENT_DEV").string == "":
"/../Resources/status-icon.icns"
else:
"/../status-icon.icns"
"/../status-dev-icon.icns"
elif defined(windows) and getEnv("NIM_STATUS_CLIENT_DEV").string == "":
"/../resources/status.svg"
elif getEnv("NIM_STATUS_CLIENT_DEV").string != "":
"/../status-dev.svg"
else:
"/../status.svg"
app.icon(app.applicationDirPath & statusAppIcon)

BIN
status-dev-icon.icns Normal file

Binary file not shown.

17
status-dev.svg Normal file
View File

@ -0,0 +1,17 @@
<svg width="1024" height="1024" viewBox="0 0 1024 1024" fill="none" xmlns="http://www.w3.org/2000/svg">
<g filter="url(#filter0_d)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M512 60.0073C262.365 60 60 262.362 60 512C60 761.638 262.365 964 512 964C761.635 964 964 761.631 964 512C964 262.369 761.635 60.0073 512 60.0073Z" fill="white"/>
</g>
<path fill-rule="evenodd" clip-rule="evenodd" d="M588.242 507.825C534.068 510.947 500.117 498.327 445.935 501.457C432.497 502.211 419.152 504.159 406.057 507.277C414.055 407.079 484.967 319.428 581.397 313.857C640.572 310.443 699.719 346.978 702.926 406.29C706.083 464.585 661.634 503.584 588.25 507.818L588.242 507.825ZM442.764 712.775C386.074 715.978 329.421 681.774 326.345 626.272C323.319 571.713 365.909 535.214 436.21 531.251C488.102 528.327 520.632 540.142 572.524 537.21C585.391 536.505 598.173 534.682 610.726 531.763C603.078 625.534 535.147 707.569 442.764 712.775ZM512 60.0073C262.365 60 60 262.362 60 512C60 761.638 262.365 964 512 964C761.635 964 964 761.631 964 512C964 262.369 761.635 60 512 60" fill="orangered"/>
<defs>
<filter id="filter0_d" x="35" y="60.0073" width="954" height="962.993" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/>
<feOffset dy="34"/>
<feGaussianBlur stdDeviation="12.5"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow" result="shape"/>
</filter>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.