Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: fix tooltip in the checkBox and RadioButton #5623

Merged
merged 2 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions QMLComponents/components/JASP/Controls/CheckBox.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
// <http://www.gnu.org/licenses/>.
//

import QtQuick 2.11
import QtQuick.Controls 2.4
import QtQuick.Layouts 1.3 as L
import JASP 1.0
import QtQuick
import QtQuick.Controls as QtC
import JASP


CheckBoxBase
Expand Down Expand Up @@ -53,8 +52,7 @@ CheckBoxBase
function click() { control.toggle(); }
function toggle() { control.toggle(); }


CheckBox
QtC.CheckBox
{
id: control
padding: jaspTheme.jaspControlPadding
Expand Down
9 changes: 4 additions & 5 deletions QMLComponents/components/JASP/Controls/RadioButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
// <http://www.gnu.org/licenses/>.
//

import QtQuick 2.11
import QtQuick.Controls 2.4
import JASP 1.0
import QtQuick
import QtQuick.Controls as QtC
import JASP


RadioButtonBase
Expand Down Expand Up @@ -51,8 +51,7 @@ RadioButtonBase
function click() { clicked(); }
onClicked: { radioButton.clickHandler(); }


RadioButton
QtC.RadioButton
{
id: control
padding: jaspTheme.jaspControlPadding
Expand Down
8 changes: 6 additions & 2 deletions QMLComponents/controls/jaspcontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@ const QStringList JASPControl::_optionReservedNames = {"data", "version"};
QMap<QQmlEngine*, QQmlComponent*> JASPControl::_mouseAreaComponentMap;
QByteArray JASPControl::_mouseAreaDef = "\
import QtQuick\n\
import QtQuick.Controls\n\
MouseArea {\n\
z: 5\n\
anchors.fill: parent\n\
acceptedButtons: Qt.NoButton\n\
ToolTip.timeout: jaspTheme.toolTipTimeout\n\
ToolTip.delay: jaspTheme.toolTipDelay\n\
ToolTip.text: parent ? parent.toolTip : ''\n\
ToolTip.visible: ToolTip.text && containsMouse\n\
}";

QQmlComponent* JASPControl::getMouseAreaComponent(QQmlEngine* engine)
Expand Down Expand Up @@ -53,7 +58,6 @@ JASPControl::JASPControl(QQuickItem *parent) : QQuickItem(parent)
connect(this, &JASPControl::indentChanged, [this] () { QQmlProperty(this, "Layout.leftMargin", qmlContext(this)).write( (indent() && JaspTheme::currentTheme()) ? JaspTheme::currentTheme()->indentationLength() : 0); });
connect(this, &JASPControl::debugChanged, [this] () { _setBackgroundColor(); _setVisible(); } );
connect(this, &JASPControl::parentDebugChanged, [this] () { _setBackgroundColor(); _setVisible(); } );
connect(this, &JASPControl::toolTipChanged, [this] () { QQmlProperty(this, "ToolTip.text", qmlContext(this)).write(toolTip()); } );
connect(this, &JASPControl::boundValueChanged, this, &JASPControl::_resetBindingValue);
connect(this, &JASPControl::activeFocusChanged, this, &JASPControl::_setFocus);
connect(this, &JASPControl::activeFocusChanged, this, &JASPControl::_notifyFormOfActiveFocus);
Expand Down Expand Up @@ -707,7 +711,7 @@ JASPControl *JASPControl::parentListViewEx() const
bool JASPControl::hovered() const
{
if (_mouseAreaObj)
return _mouseAreaObj->property("hovered").toBool();
return _mouseAreaObj->property("containsMouse").toBool();
else
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion QMLComponents/jasptheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ private slots:
theme_timeType _hoverTime = 400,
_fileMenuSlideDuration = 150,
_toolTipDelay = 500,
_toolTipTimeout =60000;
_toolTipTimeout = 5000;

QFont _font,
_fontLink,
Expand Down
Loading