Fix clicking on a user data popup widgets

The textbox used in the tooltip was getting all clicks from the user. So on the user data popup we have to 1) don't set the title bar text, 2) if the title bar is not set the text box is hidden so will not eat all click messages.
This commit is contained in:
David Capello 2017-03-09 16:15:39 -03:00
parent e2a94b094a
commit 62db0c73a3
4 changed files with 14 additions and 5 deletions

View File

@ -519,7 +519,6 @@ in_front_toolip = For all kind of layers (background and transparents)
title = Undo History
[user_data]
title = User Data
user_data = User Data:
color = Color:

View File

@ -874,6 +874,10 @@
<background part="tooltip_arrow" />
</style>
<style id="tooltip_face">
<background color="tooltip_face" />
</style>
<style id="tooltip_text">
<background color="tooltip_face" />
<text color="tooltip_text" align="left" />

View File

@ -1,8 +1,8 @@
<!-- Aseprite -->
<!-- Copyright (C) 2001-2016 by David Capello -->
<!-- Copyright (C) 2001-2017 by David Capello -->
<gui>
<tipwindow id="user_data" text="@.title">
<vbox>
<tipwindow id="user_data">
<vbox style="tooltip_face">
<label text="@.user_data" style="tooltip_text" />
<entry id="text" magnet="true" maxsize="65535" minwidth="128" expansive="true" />
<hbox>

View File

@ -135,6 +135,7 @@ TipWindow::TipWindow(const std::string& text)
// Here we build our own custimized label for the window
// (a text box).
m_textBox->setVisible(false);
addChild(m_textBox);
setText(text);
@ -251,7 +252,12 @@ void TipWindow::onPaint(PaintEvent& ev)
void TipWindow::onBuildTitleLabel()
{
m_textBox->setText(text());
if (!text().empty()) {
m_textBox->setVisible(true);
m_textBox->setText(text());
}
else
m_textBox->setVisible(false);
}
} // namespace ui