Skrooge plasma dashboard: stuck with QML
Hi Guys, I know you're in the process of updating the QML. Maybe some of my questions will get their answers from there, or maybe they will help identifying where some additional clarifications might be needed. My code is in: https://projects.kde.org/projects/extragear/office/skrooge/repository/show?rev=plasma- dashboard (in the plasma-dashboard branch) The QML code that is the subject of this mail is in plugins/applet/advice-qml I'm doing this in 4.7.90 (unstable archlinux packages) 1) widget size: --- even though I specified the widget size, if the dashboard contains only QML widgets, they appear with a very small width: http://wstaw.org/m/2011/12/20/plasma-desktopVB1577.png http://wstaw.org/m/2011/12/20/plasma-desktopav1577.png As soon as I add a C++ widget, the size is correctly computed: http://wstaw.org/m/2011/12/20/plasma-desktopbb1577.png If I remove the C++ widget, the size gets wrong again. Any idea what could be the cause for this ? 2) PlasmaComponents.Label font size: -- For some reason, the font size there is significantly larger than in basic QML Text component. Any idea why ? 3) ListView highlight: --- With the aforementionned code, I can't seem to get the expected behaviour on highlighting items in the list. Any idea why ? Thanks in advance for any help, and keep up the good work. I'm already hooked at QML :) Guillaume ___ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel
Re: Skrooge plasma dashboard: stuck with QML
On Wed, Dec 21, 2011 at 4:55 AM, Guillaume DE BURE < guillaume.deb...@gmail.com> wrote: > I'm doing this in 4.7.90 (unstable archlinux packages) > You should probably move to KDE compiled from git source. > > 1) widget size: > --- > even though I specified the widget size, if the dashboard contains only QML > widgets, they appear with a very small width: > http://wstaw.org/m/2011/12/20/plasma-desktopVB1577.png > http://wstaw.org/m/2011/12/20/plasma-desktopav1577.png > > As soon as I add a C++ widget, the size is correctly computed: > http://wstaw.org/m/2011/12/20/plasma-desktopbb1577.png > > Try adding "X-Plasma-DefaultSize=600,600" in metadata.desktop and instead of width/height: 600 in main.qml, do the following: property int minimumWidth: 600 property int minimumHeight: 600 This might produce expected behavior. > > 2) PlasmaComponents.Label font size: > -- > For some reason, the font size there is significantly larger than in basic > QML > Text component. Any idea why ? > You can simply use Text component wherever you just want to display text. > > 3) ListView highlight: > --- > With the aforementionned code, I can't seem to get the expected behaviour > on > highlighting items in the list. Any idea why ? > > The highlight follows the currentItem. So you need to add a MouseArea in your delegate with hoverEnabled: true and onEntered: list.currentIndex = index This will make the hovered item your list's current item and the highlight will follow it. Cheers, Viranch ___ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel
Re: Re: Skrooge plasma dashboard: stuck with QML
Le mercredi 21 décembre 2011 10:52:48 Viranch Mehta a écrit : > On Wed, Dec 21, 2011 at 4:55 AM, Guillaume DE BURE < > guillaume.deb...@gmail.com> wrote: > > > I'm doing this in 4.7.90 (unstable archlinux packages) > > > > You should probably move to KDE compiled from git source. Probably :) but these unstable packages are a good balance between bleeding edge and easy installation. > > > > > > 1) widget size: > > --- > > even though I specified the widget size, if the dashboard contains only QML > > widgets, they appear with a very small width: > > http://wstaw.org/m/2011/12/20/plasma-desktopVB1577.png > > http://wstaw.org/m/2011/12/20/plasma-desktopav1577.png > > > > As soon as I add a C++ widget, the size is correctly computed: > > http://wstaw.org/m/2011/12/20/plasma-desktopbb1577.png > > > > > Try adding "X-Plasma-DefaultSize=600,600" in metadata.desktop and instead of > width/height: 600 in main.qml, do the following: > property int minimumWidth: 600 > property int minimumHeight: 600 > > This might produce expected behavior. Yes, that worked, thanks :) Any explanation on why the basic width / height didn't work ? > > > > > > 2) PlasmaComponents.Label font size: > > -- > > For some reason, the font size there is significantly larger than in basic > > QML > > Text component. Any idea why ? > > > > You can simply use Text component wherever you just want to display text. Noted. > > > > > > 3) ListView highlight: > > --- > > With the aforementionned code, I can't seem to get the expected behaviour > > on > > highlighting items in the list. Any idea why ? > > > > > The highlight follows the currentItem. So you need to add a MouseArea in > your > delegate with hoverEnabled: true and onEntered: list.currentIndex = index > This will make the hovered item your list's current item and the highlight > will > follow it. Thanks for the advice, but I found something else that suits my needs quite well : PlasmaComponents.ListItem :) Since it is already a MouseArea, I guess implementing the highlight there will be easier. > > Cheers, > Viranch Thanks for the help, I pushed the changes if someone is interested. ___ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel