Skip to content

Commit bf1280f

Browse files
committed
Add new light theme for Console tabs and tweak dark theme.
1 parent 849a63a commit bf1280f

File tree

3 files changed

+75
-27
lines changed

3 files changed

+75
-27
lines changed

TracyDebugger.module.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static function getModuleInfo() {
2727
'summary' => __('Tracy debugger from Nette with many PW specific custom tools.', __FILE__),
2828
'author' => 'Adrian Jones',
2929
'href' => 'https://processwire.com/talk/forum/58-tracy-debugger/',
30-
'version' => '4.26.61',
30+
'version' => '4.26.62',
3131
'autoload' => 100000, // in PW 3.0.114+ higher numbers are loaded first - we want Tracy first
3232
'singular' => true,
3333
'requires' => 'ProcessWire>=2.7.2, PHP>=5.4.4',
@@ -311,6 +311,7 @@ static public function getDefaultData() {
311311
"forceEditorLinksToTracy" => 1,
312312
"localRootPath" => '',
313313
"aceTheme" => 'tomorrow_night_bright',
314+
"consoleTabsTheme" => 'dark-theme',
314315
"codeFontSize" => 14,
315316
"codeLineHeight" => 24,
316317
"codeShowInvisibles" => true,
@@ -3874,6 +3875,16 @@ public function getModuleConfigInputfields(array $data) {
38743875
$f->attr('value', $data['consoleBackupLimit']);
38753876
$fieldset->add($f);
38763877

3878+
$f = $this->wire('modules')->get("InputfieldSelect");
3879+
$f->attr('name', 'consoleTabsTheme');
3880+
$f->label = __('Tabs Theme', __FILE__);
3881+
$f->columnWidth = 33;
3882+
$f->addOption('dark-theme', 'Dark');
3883+
$f->addOption('light-theme', 'Light');
3884+
$f->required = true;
3885+
if($data['consoleTabsTheme']) $f->attr('value', $data['consoleTabsTheme']);
3886+
$fieldset->add($f);
3887+
38773888
$f = $this->wire('modules')->get("InputfieldTextarea");
38783889
$f->attr('name', 'consoleCodePrefix');
38793890
$f->label = __('Code prefix', __FILE__);

panels/ConsolePanel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1597,7 +1597,7 @@ function loadFAIfNotAlreadyLoaded() {
15971597
15981598
<div style="position: relative; height: calc(100% - 80px)">
15991599
1600-
<div id="tracyConsoleMainContainer" style="position: absolute; height: 100%; width: '.($this->wire('input')->cookie->tracySnippetsPaneCollapsed ? '100%' : 'calc(100% - 290px)').'">
1600+
<div id="tracyConsoleMainContainer" class="'.\TracyDebugger::getDataValue('consoleTabsTheme').'" style="position: absolute; height: 100%; width: '.($this->wire('input')->cookie->tracySnippetsPaneCollapsed ? '100%' : 'calc(100% - 290px)').'">
16011601
16021602
<div id="consoleKeyboardShortcuts" class="keyboardShortcuts tracyHidden">';
16031603
$panel = 'console';
@@ -1655,7 +1655,7 @@ function loadFAIfNotAlreadyLoaded() {
16551655
</div>
16561656
<button id="addTab" title="Add tab" style="font-weight: 600">+</button>
16571657
</div>
1658-
<div style="height: calc(100% - 36px)">
1658+
<div style="height: calc(100% - 31px)">
16591659
<div id="tracyConsoleCode" class="split" style="position: relative; background: #FFFFFF;">
16601660
<div id="tracyConsoleEditor" style="height: 100%; min-height: '.$codeLineHeight.'px"></div>
16611661
</div>

styles/styles.css

Lines changed: 61 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ ul.pw-info-links {
757757
align-items: center;
758758
width: 100%;
759759
min-height: 30px;
760-
background: #282C34;
760+
background: #373b41;
761761
margin: 0;
762762
padding: 0;
763763
}
@@ -767,7 +767,7 @@ ul.pw-info-links {
767767
overflow-x: auto;
768768
overflow-y: hidden;
769769
white-space: nowrap;
770-
background: #282C34;
770+
background: #373b41;
771771
margin: 0;
772772
padding: 0;
773773
}
@@ -798,9 +798,9 @@ ul.pw-info-links {
798798
align-items: center;
799799
flex-shrink: 0;
800800
margin: 0 1px 0 0;
801-
padding: 5px 3px 2px 6px;
802-
height: 30px;
803-
background-color: #3A3F47;
801+
padding: 5px 3px 2px 8px;
802+
height: 35px;
803+
background-color: #2D2D2D;
804804
color: #D0D0D0;
805805
border: none;
806806
cursor: pointer;
@@ -809,13 +809,12 @@ ul.pw-info-links {
809809
}
810810

811811
#tracyTabs button.active {
812-
background-color: #282C34;
812+
background-color: #000000;
813813
color: #FFFFFF;
814-
border-bottom: 2px solid #61AFEF;
815814
}
816815

817816
#tracyTabs button:hover {
818-
background: #4B5258;
817+
background: #000000;
819818
color: #FFFFFF;
820819
}
821820

@@ -852,6 +851,60 @@ ul.pw-info-links {
852851
color: #FFFFFF;
853852
}
854853

854+
#tracyConsoleContainer #addTab {
855+
margin: 0 0 0 5px;
856+
padding: 8px 12px;
857+
font-size: 14px;
858+
line-height: 19px;
859+
background-color: #3E4451;
860+
color: #DCDCDC;
861+
border: none;
862+
cursor: pointer;
863+
transition: background-color 0.3s;
864+
align-self: flex-start;
865+
}
866+
867+
#tracyConsoleContainer #addTab:hover {
868+
background-color: #4B5362;
869+
}
870+
871+
/* Light Theme */
872+
.light-theme #tracyTabsContainer,
873+
.light-theme #tracyTabsWrapper {
874+
background: #EAEAEA;
875+
}
876+
877+
.light-theme #tracyTabsWrapper::-webkit-scrollbar-thumb {
878+
background: #CCC;
879+
}
880+
881+
.light-theme #tracyTabsWrapper::-webkit-scrollbar-thumb:hover {
882+
background: #AAA;
883+
}
884+
885+
.light-theme #tracyTabs button {
886+
background-color: #DDDDDD;
887+
color: #333;
888+
}
889+
890+
.light-theme #tracyTabs button.active,
891+
.light-theme #tracyTabs button:hover {
892+
background-color: #FFFFFF;
893+
color: #000;
894+
}
895+
896+
.light-theme #tracyTabs .close-button {
897+
color: #333;
898+
}
899+
900+
.light-theme #tracyConsoleContainer #addTab {
901+
background-color: #CCC;
902+
color: #333;
903+
}
904+
.light-theme #tracyConsoleContainer #addTab:hover {
905+
background-color: #AAA;
906+
}
907+
855908
/* Show close button when parent button is hovered */
856909
#tracyTabs button:hover .close-button {
857910
visibility: visible !important;
@@ -892,22 +945,6 @@ ul.pw-info-links {
892945
visibility: visible;
893946
}
894947

895-
#tracyConsoleContainer #addTab {
896-
margin: 0 0 0 5px;
897-
padding: 6px 12px;
898-
font-size: 14px;
899-
line-height: 18px;
900-
background-color: #3E4451;
901-
color: #DCDCDC;
902-
border: none;
903-
cursor: pointer;
904-
transition: background-color 0.3s;
905-
align-self: flex-start;
906-
}
907-
908-
#tracyConsoleContainer #addTab:hover {
909-
background-color: #4B5362;
910-
}
911948

912949
#tracy-debug #runInjectButton,
913950
#tracy-debug #historyBack,

0 commit comments

Comments
 (0)