This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Plasmoid with GridView in CompactRepresentation

Tags: None
(comma "," separated)
piotrkakol
Registered Member
Posts
4
Karma
0
Hello.

I loved the binary clock widget in Plasma4 and it hasn't been ported to Plasma5 so I decided to write it myself.
I am able to add a label to the task bar and I want to add a GridView instead (which would emulate my binary clock after filling some cells).
Could you guide me how to do that? Is it even possible or do I have to make 86400 separate images and switch between them?

Here's my CompactRepresentation.qml with a label:
Code: Select all
import QtQuick 2.0
import QtQuick.Layouts 1.1
import org.kde.plasma.components 2.0    as PlasmaComponents
import org.kde.plasma.core 2.0          as PlasmaCore

Item
{
    id: root

    Layout.preferredWidth:  date_label.width  + 14   // 2 px of separation
    Layout.maximumWidth:    date_label.width  + 14
    Layout.preferredHeight: date_label.height + 20
    Layout.maximumHeight:   date_label.height + 20

    PlasmaCore.DataSource
    {
        id:                 time_src
        engine:             "time"
        connectedSources:   ["Local"]
        interval:           1000            // 1 sec (period to refresh)
    }

    PlasmaComponents.Label
    {
        id:                 date_label
        text:               "A"
        anchors.centerIn:   parent
    }
}
piotrkakol
Registered Member
Posts
4
Karma
0
If it's impossible you can also disabuse me or give a hint of how to best implement the binary clock.


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], sandyvee, Sogou [Bot]