From 41ec4ed68571091f2e2500344a7aeb527a91dc92 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 18 Jul 2020 17:20:32 +0200 Subject: Added standard close button widget class, added tooltips where approriate. --- src/client/hudenginestatus.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/client/hudenginestatus.cc') diff --git a/src/client/hudenginestatus.cc b/src/client/hudenginestatus.cc index ab51709..bae1f3f 100644 --- a/src/client/hudenginestatus.cc +++ b/src/client/hudenginestatus.cc @@ -6,6 +6,7 @@ #include "client/input.h" #include "client/hudenginestatus.h" +#include "client/closeiconbutton.h" #include "core/core.h" #include "core/application.h" #include "ui/ui.h" @@ -24,11 +25,11 @@ HUDEngineStatus::HUDEngineStatus(ui::Widget *parent) : ui::Widget(parent) set_background(false); _button_auto_palette = new ui::Palette(*palette()); - _button_auto = new ui::IconButton(this, "bitmaps/hud/button_auto", "freeflight"); + _button_auto = new ui::IconButton(this, "bitmaps/hud/button_auto", "Cancel autopilot", "freeflight"); _button_auto->set_palette(_button_auto_palette); _button_lock_palette = new ui::Palette(*palette()); - _button_lock = new ui::IconButton(this, "bitmaps/hud/button_lock", "ui_control"); + _button_lock = new ui::IconButton(this, "bitmaps/hud/button_lock", "Lock control", "ui_control"); _button_lock->set_palette(_button_lock_palette); } @@ -115,10 +116,12 @@ void HUDEngineStatus::draw() if (control_lock) { _button_lock_palette->set_foreground(math::Color(1.0f, 0.0f, 0.0f)); + _button_lock->set_tooltip("Unlock control"); } else { // free controls _button_lock_palette->set_foreground(palette()->foreground()); + _button_lock->set_tooltip("Lock control"); } // health bar size -- cgit v1.2.3