[Kde-games-devel] Review Request 110137: PopupItem QML component for KGamePopupItem
Albert Astals Cid
aacid at kde.org
Wed Apr 24 20:33:16 UTC 2013
> On April 23, 2013, 10:12 p.m., Albert Astals Cid wrote:
> > declarativeimports/qml/PopupItem.qml, line 40
> > <http://git.reviewboard.kde.org/r/110137/diff/1/?file=140650#file140650line40>
> >
> > Is this hardcoded to that color in the cpp too?
>
> Viranch Mehta wrote:
> this is the color of KStatefulBrush, I took the color specs by printing it in cpp.
But that's not correct, KStatefulBrush depends on the theme and lots of other stuff, you can't take the color and hardcode it.
> On April 23, 2013, 10:12 p.m., Albert Astals Cid wrote:
> > declarativeimports/qml/PopupItem.qml, line 49
> > <http://git.reviewboard.kde.org/r/110137/diff/1/?file=140650#file140650line49>
> >
> > This hardcoded 32 feels a bit wrong, can we get something better? Is this what the cpp code is using?
> >
> > Also i guess that instead duplicating the logic is easier if you do somehing like
> > height: width
>
> Viranch Mehta wrote:
> yes, the cpp is using "dialog-information" kicon with 32x32 hardcoded default size.
>
> although the cpp also lets us pass a custom QPixmap (of whatever size) to be used as the icon, which qml doesn't. dunno if such a flexibility is necessary as no game is using it. QML is already providing option to show the icon or not, and to specify an alternate KIcon name. but this would not let us set any other desired size of icon than 32x32.
>
> should the QML allow us to pass any hand-made Image element to be used as the icon? that way we can control pretty much anything about the icon image.
>
> +1 on height: width
If we don't need the feature, let's not add it just for the sake of adding it, it's just more complexity. What i'd do is let people set the iconName and the size (width or height) that should be enough.
- Albert
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/110137/#review31467
-----------------------------------------------------------
On April 23, 2013, 7:51 p.m., Viranch Mehta wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/110137/
> -----------------------------------------------------------
>
> (Updated April 23, 2013, 7:51 p.m.)
>
>
> Review request for KDE Games.
>
>
> Description
> -------
>
> Implements a QML component KgCore.PopupItem for KGamePopupItem widget. Most of the properties of KGamePopupItem are provided by PopupItem, except ability to set the background brush (can set background color instead), and ability to set a custom QPixmap as icon (can set KIcon's name instead and switch showing icon on/off instead).
>
> Although one of the critical downside is it cannot set theme based background and text colors. Not sure how to overcome this. But at least we have the component for starting to use in ports.
>
>
> Diffs
> -----
>
> declarativeimports/qml/PopupItem.qml PRE-CREATION
> declarativeimports/qml/qmldir 79aae32
>
> Diff: http://git.reviewboard.kde.org/r/110137/diff/
>
>
> Testing
> -------
>
> The KMines port (viranch/qtquick branch in kmines) uses this component (src/qml/main.qml) for showing "paused" message when game is paused/unpaused. works as expected except themed colors.
>
>
> Thanks,
>
> Viranch Mehta
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-games-devel/attachments/20130424/d0eaf684/attachment.html>
More information about the kde-games-devel
mailing list