mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-01 06:30:26 +00:00
Show the dive computer name in the profile window
And clean up some obsolete Gtk related stuff that is no longer relevant for the Qt port. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
656b58f205
commit
880870b46c
1 changed files with 7 additions and 24 deletions
|
@ -189,8 +189,6 @@ void ProfileGraphicsView::plot(struct dive *dive)
|
||||||
|
|
||||||
struct divecomputer *dc = &dive->dc;
|
struct divecomputer *dc = &dive->dc;
|
||||||
|
|
||||||
// This was passed around in the Cairo version / needed?
|
|
||||||
// const char *nickname;
|
|
||||||
|
|
||||||
// Fix this for printing / screen later.
|
// Fix this for printing / screen later.
|
||||||
// plot_set_scale(scale_mode_t);
|
// plot_set_scale(scale_mode_t);
|
||||||
|
@ -224,13 +222,6 @@ void ProfileGraphicsView::plot(struct dive *dive)
|
||||||
*/
|
*/
|
||||||
calculate_max_limits(dive, dc, &gc);
|
calculate_max_limits(dive, dc, &gc);
|
||||||
|
|
||||||
/*
|
|
||||||
* We don't use "cairo_translate()" because that doesn't
|
|
||||||
* scale line width etc. But the actual scaling we need
|
|
||||||
* do set up ourselves..
|
|
||||||
*
|
|
||||||
* Snif. What a pity.
|
|
||||||
*/
|
|
||||||
QRectF drawing_area = scene()->sceneRect();
|
QRectF drawing_area = scene()->sceneRect();
|
||||||
gc.maxx = (drawing_area.width() - 2 * drawing_area.x());
|
gc.maxx = (drawing_area.width() - 2 * drawing_area.x());
|
||||||
gc.maxy = (drawing_area.height() - 2 * drawing_area.y());
|
gc.maxy = (drawing_area.height() - 2 * drawing_area.y());
|
||||||
|
@ -256,29 +247,21 @@ void ProfileGraphicsView::plot(struct dive *dive)
|
||||||
plot_depth_text(gc, pi);
|
plot_depth_text(gc, pi);
|
||||||
plot_cylinder_pressure_text(gc, pi);
|
plot_cylinder_pressure_text(gc, pi);
|
||||||
plot_deco_text(gc, pi);
|
plot_deco_text(gc, pi);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Bounding box last */
|
gc.leftx = 0; gc.rightx = 1.0;
|
||||||
gc->leftx = 0; gc->rightx = 1.0;
|
gc.topy = 0; gc.bottomy = 1.0;
|
||||||
gc->topy = 0; gc->bottomy = 1.0;
|
|
||||||
|
|
||||||
set_source_rgba(gc, BOUNDING_BOX);
|
|
||||||
cairo_set_line_width_scaled(gc->cr, 1);
|
|
||||||
move_to(gc, 0, 0);
|
|
||||||
line_to(gc, 0, 1);
|
|
||||||
line_to(gc, 1, 1);
|
|
||||||
line_to(gc, 1, 0);
|
|
||||||
cairo_close_path(gc->cr);
|
|
||||||
cairo_stroke(gc->cr);
|
|
||||||
|
|
||||||
/* Put the dive computer name in the lower left corner */
|
/* Put the dive computer name in the lower left corner */
|
||||||
|
const char *nickname;
|
||||||
nickname = get_dc_nickname(dc->model, dc->deviceid);
|
nickname = get_dc_nickname(dc->model, dc->deviceid);
|
||||||
if (!nickname || *nickname == '\0')
|
if (!nickname || *nickname == '\0')
|
||||||
nickname = dc->model;
|
nickname = dc->model;
|
||||||
if (nickname) {
|
if (nickname) {
|
||||||
static const text_render_options_t computer = {DC_TEXT_SIZE, TIME_TEXT, LEFT, MIDDLE};
|
text_render_options_t computer = {DC_TEXT_SIZE, TIME_TEXT, LEFT, MIDDLE};
|
||||||
plot_text(gc, &computer, 0, 1, "%s", nickname);
|
plot_text(&computer, 0, 1, nickname);
|
||||||
}
|
}
|
||||||
|
#if 0
|
||||||
if (PP_GRAPHS_ENABLED) {
|
if (PP_GRAPHS_ENABLED) {
|
||||||
plot_pp_gas_profile(gc, pi);
|
plot_pp_gas_profile(gc, pi);
|
||||||
plot_pp_text(gc, pi);
|
plot_pp_text(gc, pi);
|
||||||
|
|
Loading…
Reference in a new issue