小编aci*_*ms4的帖子

如何以编程方式显示/隐藏 KDE plasmoid 的工具提示?

有没有办法使等离子工具提示以编程方式显示/隐藏?

我尝试在ToolTipArea紧凑表示上设置 a ,并尝试用 a 触发它Timer- 它不起作用(常规工具提示不断显示,但仅在悬停于等离子图标(又名compactRepresentation)时:

import QtQuick 2.0
import QtQuick.Layouts 1.1
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents
import org.kde.plasma.extras 2.0 as PlasmaExtras

Item {
    Layout.preferredWidth: 200
    Layout.preferredHeight: 300

    Plasmoid.preferredRepresentation: Plasmoid.compactRepresentation

    Plasmoid.compactRepresentation: Item
    {
        anchors.fill: parent

        MouseArea
        {
            onClicked:
            {
                 plasmoid.expanded = !plasmoid.expanded
            }
        }

        PlasmaCore.ToolTipArea
        {
            id: toolTip
            width: parent.width
            height: parent.height
            anchors.fill: parent
            mainItem: tooltipContentItem
            active: false
            interactive: true
        }

        Timer
        {
            interval: 3000 …
Run Code Online (Sandbox Code Playgroud)

tooltip plasmoid qml kde-plasma

5
推荐指数
0
解决办法
236
查看次数

UIkit 3 的过滤器组件:使用 URL 哈希设置活动过滤器 - 无法使用 JS 更改活动过滤器

我正在尝试将哈希值传递给 URL 以设置 UIkit 过滤器。

<div uk-filter="target:.js-filter">
    <ul>
        <li class="uk-active" uk-filter-control><a href="#">All</a></li>
        <li uk-filter-control="filter:[data-color='blue'];"><a href="#"></a></li>
        <li uk-filter-control="filter:[data-color='white'];"><a href="#"></a></li>
    </ul>
    <ul class="js-filter">
        <li data-color="blue"></li>
        <li data-color="white"></li>
    </ul>
</div>
Run Code Online (Sandbox Code Playgroud)

因此,例如,如果我访问http://example.com/#white,该内容仅显示白色项目(并且“白色”过滤器控件处于活动状态)。

我找不到任何关于如何使用 UIkit 3 实现这一目标的明确示例(这是关于 UIkit 2 的)。对于像我这样的菜鸟来说,文档似乎不清楚,因为不清楚targetselActive选项所指的是什么。但是,我正在尝试以下操作:

<script>
document.addEventListener("DOMContentLoaded", function(event){
    hash = document.location.hash;
    console.log("Hash: " + hash);

    if ( hash !== "" ) {
        var filter = document.querySelector('.js-filter');

        UIkit.filter( filter, {
            target: 'li [data-color:' + hash + ']',
            selActive: true,
        });
    } …
Run Code Online (Sandbox Code Playgroud)

javascript filtering getuikit

2
推荐指数
1
解决办法
3542
查看次数

标签 统计

filtering ×1

getuikit ×1

javascript ×1

kde-plasma ×1

plasmoid ×1

qml ×1

tooltip ×1