Add tooltips to ColorBar buttons

This commit is contained in:
David Capello 2015-05-09 12:30:05 -03:00
parent 62a3594598
commit 352eff2fd6

View File

@ -44,6 +44,7 @@
#include "ui/separator.h"
#include "ui/splitter.h"
#include "ui/system.h"
#include "ui/tooltips.h"
#include <cstring>
@ -172,6 +173,15 @@ ColorBar::ColorBar(int align)
m_buttons.addItem(theme->get_part(PART_PAL_PRESETS));
m_buttons.addItem(theme->get_part(PART_PAL_OPTIONS));
// Tooltips
TooltipManager* tooltipManager = new TooltipManager();
addChild(tooltipManager);
tooltipManager->addTooltipFor(m_buttons.getItem((int)PalButton::EDIT), "Edit Color", JI_BOTTOM);
tooltipManager->addTooltipFor(m_buttons.getItem((int)PalButton::SORT), "Sort & Gradients", JI_BOTTOM);
tooltipManager->addTooltipFor(m_buttons.getItem((int)PalButton::PRESETS), "Presets", JI_BOTTOM);
tooltipManager->addTooltipFor(m_buttons.getItem((int)PalButton::OPTIONS), "Options", JI_BOTTOM);
tooltipManager->addTooltipFor(&m_remapButton, "Matches old indexes with new indexes", JI_BOTTOM);
onColorButtonChange(getFgColor());
UIContext::instance()->addObserver(this);