mirror of
https://codeberg.org/armin/trommelkiste.git
synced 2026-09-01 12:20:46 +02:00
Show git version and build date in editor footer
This commit is contained in:
parent
73a8193e5d
commit
ff96ab1a69
2 changed files with 46 additions and 2 deletions
|
|
@ -23,6 +23,7 @@ static constexpr int COL_RINGMOD = COL_REVERB + KNOB_W + KNOB_GAP;
|
|||
static constexpr int COL_DESTR = COL_RINGMOD + KNOB_W + KNOB_GAP;
|
||||
static constexpr int COL_SHUFFLE = COL_DESTR + KNOB_W + KNOB_GAP;
|
||||
static constexpr int TOTAL_W = COL_SHUFFLE + KNOB_W;
|
||||
static constexpr int FOOTER_H = 24;
|
||||
|
||||
// Header knob x positions (compact layout)
|
||||
static constexpr int HDR_KNOB = 36;
|
||||
|
|
@ -190,7 +191,7 @@ TrommelkisteEditor::TrommelkisteEditor(TrommelkisteProcessor& p)
|
|||
setLookAndFeel(&lnf);
|
||||
lnf.fontScale = 1.5f;
|
||||
uiScale = 1.5f;
|
||||
setSize(scaled(TOTAL_W), scaled(TOP + NUM_TRACKS * ROW_H));
|
||||
setSize(scaled(TOTAL_W), scaled(TOP + NUM_TRACKS * ROW_H + FOOTER_H));
|
||||
setResizable(false, false);
|
||||
setWantsKeyboardFocus(false);
|
||||
|
||||
|
|
@ -430,7 +431,7 @@ void TrommelkisteEditor::scaleChanged()
|
|||
{
|
||||
uiScale = scales[selId - 1];
|
||||
lnf.fontScale = uiScale;
|
||||
setSize(scaled(TOTAL_W), scaled(TOP + NUM_TRACKS * ROW_H));
|
||||
setSize(scaled(TOTAL_W), scaled(TOP + NUM_TRACKS * ROW_H + FOOTER_H));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -583,6 +584,20 @@ void TrommelkisteEditor::paint(Graphics& g)
|
|||
g.drawRect(scaled(COL_FILE), scaled(ry), scaled(COL_DELAY - 8 - COL_FILE), scaled(ROW_H), scaled(2));
|
||||
}
|
||||
}
|
||||
|
||||
// Footer: git version + build date
|
||||
const int footerY = TOP + NUM_TRACKS * ROW_H;
|
||||
g.setColour(lnf.accent.withAlpha(0.3f));
|
||||
g.fillRect(scaled(10), scaled(footerY), scaled(getWidth() - 20), scaled(1));
|
||||
|
||||
const String footer = String(TROMMELKISTE_GIT_VERSION) + " (" +
|
||||
String(TROMMELKISTE_GIT_REVISION) + ") \u00b7 " +
|
||||
String(TROMMELKISTE_GIT_BRANCH) + " \u00b7 built " +
|
||||
String(TROMMELKISTE_BUILD_DATE);
|
||||
g.setColour(Colours::white.withAlpha(0.45f));
|
||||
g.setFont(font(9.0f, uiScale));
|
||||
g.drawText(footer, scaled(10), scaled(footerY + 6), scaled(getWidth() - 20),
|
||||
scaled(FOOTER_H - 8), Justification::centred);
|
||||
}
|
||||
|
||||
void TrommelkisteEditor::resized()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue