mirror of
https://github.com/alexkay/spek.git
synced 2025-04-17 00:52:20 +03:00
Draw file properties
This commit is contained in:
parent
98b2cb0ab8
commit
38cc7f2343
@ -136,6 +136,16 @@ void SpekSpectrogram::render(wxDC& dc)
|
||||
// Draw the spectrogram.
|
||||
wxBitmap bmp(this->image.Scale(w - LPAD - RPAD, h - TPAD - BPAD /*TODO:, wxIMAGE_QUALITY_HIGH*/));
|
||||
dc.DrawBitmap(bmp, LPAD, TPAD);
|
||||
|
||||
// File name.
|
||||
dc.SetFont(large_font);
|
||||
// TODO: ellipsize
|
||||
dc.DrawText(this->path, LPAD, TPAD - 2 * GAP - normal_height - large_height);
|
||||
|
||||
// File properties.
|
||||
dc.SetFont(normal_font);
|
||||
// TODO: ellipsize
|
||||
dc.DrawText(this->desc, LPAD, TPAD - GAP - normal_height);
|
||||
}
|
||||
|
||||
// Border around the spectrogram.
|
||||
|
@ -92,25 +92,6 @@ namespace Spek {
|
||||
cr.translate (LPAD, TPAD);
|
||||
rate_ruler.draw (cr, layout);
|
||||
cr.identity_matrix ();
|
||||
|
||||
// File properties.
|
||||
cr.move_to (LPAD, TPAD - GAP);
|
||||
layout.set_font_description (FontDescription.from_string (
|
||||
"Sans " + (9 * FONT_SCALE).to_string ()));
|
||||
layout.set_width ((int) (w - LPAD - RPAD) * Pango.SCALE);
|
||||
layout.set_ellipsize (EllipsizeMode.END);
|
||||
layout.set_text (info, -1);
|
||||
cairo_show_layout_line (cr, layout.get_line (0));
|
||||
layout.get_pixel_size (out text_width, out text_height);
|
||||
|
||||
// File name.
|
||||
cr.move_to (LPAD, TPAD - 2 * GAP - text_height);
|
||||
layout.set_font_description (FontDescription.from_string (
|
||||
"Sans Bold " + (10 * FONT_SCALE).to_string ()));
|
||||
layout.set_width ((int) (w - LPAD - RPAD) * Pango.SCALE);
|
||||
layout.set_ellipsize (EllipsizeMode.START);
|
||||
layout.set_text (file_name, -1);
|
||||
cairo_show_layout_line (cr, layout.get_line (0));
|
||||
}
|
||||
|
||||
// Prepare to draw the ruler.
|
||||
|
Loading…
x
Reference in New Issue
Block a user