From b9784ee4ba8982d2fbe1da16be951d0b60b9865b Mon Sep 17 00:00:00 2001 From: Srevin Saju Date: Sun, 10 May 2020 14:32:18 +0300 Subject: [PATCH 1/2] Inidicate color on tooltip --- guiscrcpy/launcher.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/guiscrcpy/launcher.py b/guiscrcpy/launcher.py index 5555c9d5..4fdc4a67 100644 --- a/guiscrcpy/launcher.py +++ b/guiscrcpy/launcher.py @@ -753,13 +753,15 @@ def scan_config_devices_update_list_view(self): status='Disconnected' ) ) - + __sha = hashlib.sha256( + str(i).encode()).hexdigest()[5:5+6] devices_view_list_item.setToolTip( - "Device: {d}\n" + "Device: {d}\n" "Status: {s}".format( d=i, s="Disconnected. Right click 'ping' to attempt " "reconnect", + color=__sha ) ) devices_view_list_item.setFont(QFont('Noto Sans', pointSize=8)) @@ -879,8 +881,11 @@ def scan_devices_update_list_view(self): status=i['status'] ) ) + __sha = hashlib.sha256( + str(i['identifier']).encode() + ).hexdigest()[5:5 + 6] devices_view_list_item.setToolTip( - "Device: {d}\n" + "Device: {d}\n" "Model: {m}\n" "Alias: {a}\n" "Status: {s}\n" @@ -891,7 +896,8 @@ def scan_devices_update_list_view(self): a=i['product'], s=i['status'], t=i['transport_id'], - p=paired + p=paired, + color=__sha ) ) From ed5f4c0efcfa398ca7c4c6e4095961e82b301c70 Mon Sep 17 00:00:00 2001 From: Srevin Saju Date: Sun, 10 May 2020 14:43:26 +0300 Subject: [PATCH 2/2] Add color hinting on title only --- guiscrcpy/launcher.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/guiscrcpy/launcher.py b/guiscrcpy/launcher.py index 4fdc4a67..d30c5ce4 100644 --- a/guiscrcpy/launcher.py +++ b/guiscrcpy/launcher.py @@ -885,11 +885,14 @@ def scan_devices_update_list_view(self): str(i['identifier']).encode() ).hexdigest()[5:5 + 6] devices_view_list_item.setToolTip( - "Device: {d}\n" - "Model: {m}\n" - "Alias: {a}\n" - "Status: {s}\n" - "Transport ID: {t}\n" + "Device: " + "" + "{d}\n" + "
" + "Model: {m}\n
" + "Alias: {a}\n
" + "Status: {s}\n
" + "Transport ID: {t}\n
" "Paired: {p}".format( d=i['identifier'], m=i['model'], @@ -897,7 +900,8 @@ def scan_devices_update_list_view(self): s=i['status'], t=i['transport_id'], p=paired, - color=__sha + color=__sha, + inv_color=str(hex(0xFFFFFF - int(__sha, 16))[2:]) ) )