添加界面ToolTip

This commit is contained in:
qiqi 2023-06-02 15:44:16 +08:00 committed by He Sir
parent 9290c71214
commit ce4f761a3c
10 changed files with 30 additions and 7 deletions

View File

@ -5,7 +5,7 @@ import QtQuick.Controls 2.5
MouseArea {
id: control
hoverEnabled: true
ToolTip.text: qsTr("Open the label selection interface")
ToolTip.text: comment
ToolTip.visible: control.containsMouse
states: State {
when: control.activeFocus

View File

@ -64,6 +64,7 @@ Item {
property string id: model.id
property string name: model.name
property string icon: model.icon
property string comment: model.comment // label tooltip
property int toTop: model.top
property bool recentInstall: model.recentInstall
sourceComponent: {

View File

@ -196,8 +196,11 @@ Item {
model: appPageHeaderUtils.model(PluginGroup.Button)
delegate: AppControls2.RoundButton {
width: height; height: ListView.view ? ListView.view.height : 0
width: height
height: ListView.view ? ListView.view.height : 0
buttonIcon: model.icon
ToolTip.text: qsTr("Search App")
ToolTip.visible: containsMouse
onClicked: {
root.state = "search";
// model

View File

@ -224,7 +224,8 @@ RowLayout {
hoverEnabled: true
width: 170; height: width
acceptedButtons: Qt.LeftButton | Qt.RightButton
ToolTip.text: name
ToolTip.visible: iconText.truncated && containsMouse
AppControls2.StyleBackground {
anchors.fill: parent
useStyleTransparent: false
@ -323,7 +324,8 @@ RowLayout {
hoverEnabled: true
width: 170; height: width
acceptedButtons: Qt.LeftButton | Qt.RightButton
ToolTip.text: name
ToolTip.visible: folderText.truncated && containsMouse
AppControls2.StyleBackground {
anchors.fill: parent
useStyleTransparent: false
@ -350,8 +352,8 @@ RowLayout {
AppControls2.FolderIcon {
id: folderIcon
width: 96
height: 96
width: 86
height: 86
rows: 4; columns: 4
spacing: 2; padding: 8
icons: icon
@ -361,6 +363,7 @@ RowLayout {
}
AppControls2.StyleText {
id: folderText
anchors.bottom: parent.bottom
anchors.bottomMargin: 20
width: parent.width
@ -465,6 +468,7 @@ RowLayout {
height: GridView.view.cellHeight
MouseArea {
id: labelAppsMouseArea
anchors.centerIn: parent
hoverEnabled: true
width: 170; height: width
@ -483,6 +487,8 @@ RowLayout {
appIcon: modelData.icon
spacing: 8
textHighLight: true
ToolTip.text: modelData.name
ToolTip.visible: textTruncated && labelAppsMouseArea.containsMouse
}
}

View File

@ -59,6 +59,8 @@ Item {
id: buttonMouseArea
hoverEnabled: true
anchors.fill: parent
ToolTip.text: qsTr("Contract")
ToolTip.visible: containsMouse
onClicked: mainWindow.exitFullScreen()
activeFocusOnTab: true
Keys.onPressed: {

View File

@ -40,6 +40,8 @@ RowLayout {
Layout.fillWidth: true
Layout.maximumWidth: height
activeFocusOnTab: true
ToolTip.text: qsTr("Switch Sort Type")
ToolTip.visible: containsMouse
highlight: mainWindow.isFullScreen
autoHighLight: !mainWindow.isFullScreen
@ -62,6 +64,9 @@ RowLayout {
Layout.fillHeight: true
Layout.maximumWidth: 16
Layout.maximumHeight: 16
ToolTip.text: qsTr("Sort Type Options")
ToolTip.visible: containsMouse
hoverEnabled: true
activeFocusOnTab: true
Keys.onPressed: {

View File

@ -76,6 +76,9 @@ Item {
id: buttonMouseArea
hoverEnabled: true
anchors.fill: parent
ToolTip.text: qsTr("Expand")
ToolTip.visible: containsMouse
onClicked: mainWindow.isFullScreen = true
activeFocusOnTab: true
Keys.onPressed: {

View File

@ -141,6 +141,8 @@ UkuiMenuExtension {
appIcon: model.icon
display: Display.TextUnderIcon
scale: (control.containsPress && !icon.hold) ? 1.1 : 1.0
ToolTip.visible: textTruncated && control.containsMouse
ToolTip.text: model.name
Behavior on scale {
NumberAnimation { duration: 300; easing.type: Easing.InOutCubic }

View File

@ -201,6 +201,7 @@ void AppCategoryPlugin::generateData(QVector<DataEntity> &data)
}
DataEntity label;
label.setComment(tr("Open Function Sort Menu"));
label.setType(DataType::Label);
label.setId(item.label.id());
label.setName(item.label.displayName());

View File

@ -162,7 +162,7 @@ void AppLetterSortPlugin::addAppToLabel(const QString &labelName, QVector<DataEn
if (!apps.isEmpty()) {
DataEntity dataEntity;
dataEntity.setComment(tr("Letter sort button"));
dataEntity.setComment(tr("Open Letter Sort Menu"));
dataEntity.setName(labelName);
dataEntity.setId(labelName);
dataEntity.setType(DataType::Label);