Fix tooltip in SpriteProperties dialog

This commit is contained in:
David Capello 2018-12-13 15:25:31 -03:00
parent 7e638cddcc
commit 36edf3f842
2 changed files with 10 additions and 1 deletions

View File

@ -21,7 +21,7 @@
<label text="@.transparent_color" />
<hbox>
<hbox id="transparent_color_placeholder" tooltip="@.transparent_color_tooltip" />
<hbox id="transparent_color_placeholder" />
</hbox>
<label text="@.pixel_ratio" />

View File

@ -16,6 +16,7 @@
#include "app/commands/command.h"
#include "app/context_access.h"
#include "app/doc_api.h"
#include "app/i18n/strings.h"
#include "app/modules/gui.h"
#include "app/pref/preferences.h"
#include "app/tx.h"
@ -117,6 +118,14 @@ void SpritePropertiesCommand::onExecute(Context* context)
ColorButtonOptions());
window.transparentColorPlaceholder()->addChild(color_button);
// TODO add a way to get or create an existent TooltipManager
TooltipManager* tooltipManager = new TooltipManager;
window.addChild(tooltipManager);
tooltipManager->addTooltipFor(
color_button,
Strings::sprite_properties_transparent_color_tooltip(),
LEFT);
}
else {
window.transparentColorPlaceholder()->addChild(new Label("(only for indexed images)"));