Skip to content

Commit db55895

Browse files
CoriouSteveEdson
authored andcommitted
Fix for wrong parameter "templateImage" + allow for changing both font face and font size independently (#8)
* Fix for wrong parameter "templateImage" The param « imageTemplate » should actually be « templateImage ». I haven’t replaced the variables names because that’s not important, even though they are backwards too. * You can change the font and font size independently We were not able to change the font size OR the font face, it had to be both which is incorrect
1 parent 9eb6214 commit db55895

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

src/SteveEdson/BitBar.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,13 +219,23 @@ public function format() {
219219

220220
$this->usedPipe = false;
221221

222-
if ($this->fontFace && $this->fontSize) {
222+
if ($this->fontSize) {
223223
if (!$this->usedPipe) {
224224
$string .= '|';
225225
$this->usedPipe = true;
226226
}
227227

228-
$string .= ' ( \'size=' . $this->fontSize . '\' \'font=' . $this->fontFace . '\' )';
228+
$string .= ' size=' . $this->fontSize;
229+
}
230+
231+
232+
if ($this->fontFace) {
233+
if (!$this->usedPipe) {
234+
$string .= '|';
235+
$this->usedPipe = true;
236+
}
237+
238+
$string .= ' font=' . $this->fontFace;
229239
}
230240

231241
if ($this->colour) {
@@ -312,7 +322,7 @@ public function format() {
312322
}
313323

314324
if($this->imageIsTemplate) {
315-
$string .= ' imageTemplate="' . $this->image . '"';
325+
$string .= ' templateImage="' . $this->image . '"';
316326
} else {
317327
$string .= ' image="' . $this->image . '"';
318328
}

0 commit comments

Comments
 (0)