[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    Re: Review Request 109604: Model to provide easy access to KWin's Clients from QML
From:       Thomas_Lübking <thomas.luebking () gmail ! com>
Date:       2013-03-21 21:06:17
Message-ID: 20130321210617.10972.69283 () vidsolbach ! de
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/109604/#review29660
-----------------------------------------------------------



kwin/scripting/scripting_model.h
<http://git.reviewboard.kde.org/r/109604/#comment22099>

    Exclusion/s?
    "Exclude/s" sounds "nounalized" and -to me- more like a defined list (Ie. window \
A, B and D) than a list of cases.



kwin/scripting/scripting_model.h
<http://git.reviewboard.kde.org/r/109604/#comment22100>

    ... and you don't say "Restricted/s" here either ;-)



kwin/scripting/scripting_model.h
<http://git.reviewboard.kde.org/r/109604/#comment22101>

    ... setExclusions() .. etc.



kwin/scripting/scripting_model.h
<http://git.reviewboard.kde.org/r/109604/#comment22095>

    "BranchFoliage" ;-)
    
    Fwwi, imo there's too much usage of generic "clientGroup" in kwin.
    
    The oldest definition refers to clients with a common leader, then the tabgroup \
was called  that ...



kwin/scripting/scripting_model.h
<http://git.reviewboard.kde.org/r/109604/#comment22096>

    Is it a ForkLevel?



kwin/scripting/scripting_model.cpp
<http://git.reviewboard.kde.org/r/109604/#comment22097>

    if ((excludes & ClientModel::ExcludeDesktopWindows) && client->isDesktop()) {
       return true;
    }
    
    just as note, the current double branching makes it look more complex as it \
actually is.  (But it's your code and i'm not in the position to teach anybody style \
rules ;-)



kwin/scripting/scripting_model.cpp
<http://git.reviewboard.kde.org/r/109604/#comment22098>

    considered to keep m_clients and m_ids as hash/map or at least a pair (implicitly \
documenting "this is assigned and has to be in sync")


Most on terminology, but think about grouping m_ids and m_clients
The last "ClientGroup" lost the connection quite some times ... =)

- Thomas Lübking


On March 20, 2013, 12:07 p.m., Martin Gräßlin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/109604/
> -----------------------------------------------------------
> 
> (Updated March 20, 2013, 12:07 p.m.)
> 
> 
> Review request for kwin and Plasma.
> 
> 
> Description
> -------
> 
> Model to provide easy access to KWin's Clients from QML
> 
> A new ClientModel is added which provides multiple different views on
> KWin's Clients. The model is organized as a tree model supporting the
> following levels:
> * activities
> * virtual desktops
> * screens
> * none
> 
> The levels can be ordered in whatever way one wants. That is the tree
> structure can have an ordering of activities then virtual desktops or
> the other way around.
> 
> In addition the model provides Exclude flags  to exclude clients of
> certain types. E.g. it's possible to exclude all windows which are not on
> the current desktop or all windows which are of type dock.
> 
> The model gets automatically updated whenever a Client is added/removed
> or changes a state in a way that it should be excluded/included. This is
> currently still rather limited, as some signals from KWin core are not
> yet available. Also the model does not yet react on screen, desktop and
> activity changes.
> 
> The ClientModel is not directly exported to QML. Instead there are
> specific sub classes for certain common orderings. This solutions is
> chosen to workaround some limitations of QML. The initial idea was to
> use a property taking a list of the levels, but this doesn't work because
> we are not notified when the QDeclarativeListProperty changes.
> 
> Currently the following models are provided to QML:
> * ClientModel -> no restrictions
> * ClientModelByScreen -> ordering by screen
> * ClientModelByScreenAndDesktop -> screen, then desktop
> 
> These can be used to get all Clients:
> ClientModel {
> }
> 
> Or to get the classic Present Windows on current desktop:
> ClientModelByScreen {
> excludes: ClientModel.ExcludeOtherDesktops | ClientModel.ExcludeNotAcceptingFocus | \
> ... }
> 
> Or to get the classic Present Windows on all desktops:
> ClientModelByScreen {
> excludes: ClientModel.ExcludeNotAcceptingFocus | ...
> }
> 
> Or our well known desktop grid:
> ClientModelByScreenAndDesktop {
> id: desktopGrid
> excludes: ClientModel.ExcludeNotAcceptingFocus | ...
> }
> 
> To support filtering as known by the Present Windows effect one can use
> a ClientFilterModel, which is a QSortFilterProxyModel filtering on
> window caption, role and class:
> ClientFilterModel {
> id: filterModel
> clientModel: desktopGrid
> filter: filterItem.text
> }
> 
> In case it's a tree level obviously QML does not support this correctly.
> So we need to use a VisualDataModel:
> VisualDataModel {
> id: clientModel
> model: filterModel
> Component.onCompleted: {
> clientModel.rootIndex = modelIndex(0);
> clientModel.rootIndex = modelIndex(0);
> clientModel.delegate = thumbnailDelegate;
> }
> }
> 
> As we can see, the rootIndex has to be set to the level which contains
> the Clients. Also it seems to be important to create the delegate after
> the model index has been set. The idea is to have only one ClientModel
> and multiple VisualDataModels if multiple views on the data is needed.
> 
> The model has been tested with a painful modeltest session. It looks good
> so far modulo the listed limitations and that modeltest is not liking
> closing Yakuake in the ClientModelByScreenAndDesktop setup, though it
> works fine in real world testing.
> 
> ===
> Support saturation/brightness in ThumbnailItem
> 
> Two new properties saturation and brightness are added to the
> ThumbnailItem which can be set from QML.
> 
> The properties are honoured by the Scene when rendering the thumbnail.
> ===
> 
> Plasma devs are added to get access to their QML knowledge :-)
> 
> 
> Diffs
> -----
> 
> kwin/CMakeLists.txt ecddc55ed89cb4fcb143561e57534b1bb4ea3832 
> kwin/scene.cpp 939f000f0c3d09ffacccb0b25c50f83f0010ef47 
> kwin/scripting/scripting.cpp e124827174317ab6adbfdb90cec796a02e7bd2b7 
> kwin/scripting/scripting_model.h PRE-CREATION 
> kwin/scripting/scripting_model.cpp PRE-CREATION 
> kwin/thumbnailitem.h f7dc4fe621e9cf2786794d1be55930ce79ca5c7c 
> kwin/thumbnailitem.cpp 66b665a685188767201ada7d5cfbb32a0ea7ff0a 
> 
> Diff: http://git.reviewboard.kde.org/r/109604/diff/
> 
> 
> Testing
> -------
> 
> 
> File Attachments
> ----------------
> 
> Example PresentWindows/DesktopGrid QML
> http://git.reviewboard.kde.org/media/uploaded/files/2013/03/20/main.qml
> WindowItemComponent.qml - needed for the example
> http://git.reviewboard.kde.org/media/uploaded/files/2013/03/20/WindowItemComponent.qml
>  
> 
> Thanks,
> 
> Martin Gräßlin
> 
> 


[Attachment #5 (text/html)]

<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;">  <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/109604/">http://git.reviewboard.kde.org/r/109604/</a>
  </td>
    </tr>
   </table>
   <br />











<div>




<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="http://git.reviewboard.kde.org/r/109604/diff/1/?file=120514#file120514line59" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kwin/scripting/scripting_model.h</a>  <span style="font-weight: normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th>  <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">59</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span \
class="n">Q_DECLARE_FLAGS</span><span class="p">(</span><span \
class="n">Excludes</span><span class="p">,</span> <span class="n">Exclude</span><span \
class="p">)</span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Exclusion/s? &quot;Exclude/s&quot; sounds &quot;nounalized&quot; and -to \
me- more like a defined list (Ie. window A, B and D) than a list of cases.</pre> \
</div> <br />

<div>




<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="http://git.reviewboard.kde.org/r/109604/diff/1/?file=120514#file120514line67" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kwin/scripting/scripting_model.h</a>  <span style="font-weight: normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th>  <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">67</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span \
class="n">Q_DECLARE_FLAGS</span><span class="p">(</span><span \
class="n">LevelRestrictions</span><span class="p">,</span> <span \
class="n">LevelRestriction</span><span class="p">)</span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">... and you \
don&#39;t say &quot;Restricted/s&quot; here either ;-)</pre> </div>
<br />

<div>




<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="http://git.reviewboard.kde.org/r/109604/diff/1/?file=120514#file120514line77" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kwin/scripting/scripting_model.h</a>  <span style="font-weight: normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th>  <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">77</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span \
class="kt">void</span> <span class="nf">setExcludes</span><span \
class="p">(</span><span class="n">ClientModel</span><span class="o">::</span><span \
class="n">Excludes</span> <span class="n">excludes</span><span \
class="p">);</span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">... \
setExclusions() .. etc.</pre> </div>
<br />

<div>




<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="http://git.reviewboard.kde.org/r/109604/diff/1/?file=120514#file120514line115" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kwin/scripting/scripting_model.h</a>  <span style="font-weight: normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th>  <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">115</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span \
class="n">class</span> <span class="n">ClientGroup</span> <span class="o">:</span> \
<span class="n">public</span> <span class="n">QObject</span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">&quot;BranchFoliage&quot; ;-)

Fwwi, imo there&#39;s too much usage of generic &quot;clientGroup&quot; in kwin.

The oldest definition refers to clients with a common leader, then the tabgroup was \
called  that ...</pre> </div>
<br />

<div>




<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="http://git.reviewboard.kde.org/r/109604/diff/1/?file=120514#file120514line232" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kwin/scripting/scripting_model.h</a>  <span style="font-weight: normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th>  <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">232</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span \
class="n">class</span> <span class="n">Level</span> <span class="o">:</span> <span \
class="n">public</span> <span class="n">AbstractLevel</span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Is it a \
ForkLevel?</pre> </div>
<br />

<div>




<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="http://git.reviewboard.kde.org/r/109604/diff/1/?file=120515#file120515line86" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kwin/scripting/scripting_model.cpp</a>  <span style="font-weight: \
normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th>  <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">86</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span \
class="k">if</span> <span class="p">(</span><span class="n">excludes</span> <span \
class="o">&amp;</span> <span class="n">ClientModel</span><span \
class="o">::</span><span class="n">ExcludeDesktopWindows</span><span \
class="p">)</span> <span class="p">{</span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">if \
((excludes &amp; ClientModel::ExcludeDesktopWindows) &amp;&amp; \
client-&gt;isDesktop()) {  return true;
}

just as note, the current double branching makes it look more complex as it actually \
is. (But it&#39;s your code and i&#39;m not in the position to teach anybody style \
rules ;-)</pre> </div>
<br />

<div>




<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="http://git.reviewboard.kde.org/r/109604/diff/1/?file=120515#file120515line190" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kwin/scripting/scripting_model.cpp</a>  <span style="font-weight: \
normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th>  <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">190</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span \
class="n">m_clients</span><span class="p">.</span><span \
class="n">removeAt</span><span class="p">(</span><span class="n">index</span><span \
class="p">);</span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">considered \
to keep m_clients and m_ids as hash/map or at least a pair (implicitly documenting \
&quot;this is assigned and has to be in sync&quot;)</pre> </div>
<br />



 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Most on terminology, but \
think about grouping m_ids and m_clients The last &quot;ClientGroup&quot; lost the \
connection quite some times ... =)</pre>

<p>- Thomas</p>


<br />
<p>On March 20th, 2013, 12:07 p.m. UTC, Martin Gräßlin wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for kwin and Plasma.</div>
<div>By Martin Gräßlin.</div>


<p style="color: grey;"><i>Updated March 20, 2013, 12:07 p.m.</i></p>






<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Model to provide easy access to KWin&#39;s Clients from QML

A new ClientModel is added which provides multiple different views on
KWin&#39;s Clients. The model is organized as a tree model supporting the
following levels:
* activities
* virtual desktops
* screens
* none

The levels can be ordered in whatever way one wants. That is the tree
structure can have an ordering of activities then virtual desktops or
the other way around.

In addition the model provides Exclude flags  to exclude clients of
certain types. E.g. it&#39;s possible to exclude all windows which are not on
the current desktop or all windows which are of type dock.

The model gets automatically updated whenever a Client is added/removed
or changes a state in a way that it should be excluded/included. This is
currently still rather limited, as some signals from KWin core are not
yet available. Also the model does not yet react on screen, desktop and
activity changes.

The ClientModel is not directly exported to QML. Instead there are
specific sub classes for certain common orderings. This solutions is
chosen to workaround some limitations of QML. The initial idea was to
use a property taking a list of the levels, but this doesn&#39;t work because
we are not notified when the QDeclarativeListProperty changes.

Currently the following models are provided to QML:
* ClientModel -&gt; no restrictions
* ClientModelByScreen -&gt; ordering by screen
* ClientModelByScreenAndDesktop -&gt; screen, then desktop

These can be used to get all Clients:
ClientModel {
}

Or to get the classic Present Windows on current desktop:
ClientModelByScreen {
    excludes: ClientModel.ExcludeOtherDesktops | ClientModel.ExcludeNotAcceptingFocus \
| ... }

Or to get the classic Present Windows on all desktops:
ClientModelByScreen {
    excludes: ClientModel.ExcludeNotAcceptingFocus | ...
}

Or our well known desktop grid:
ClientModelByScreenAndDesktop {
    id: desktopGrid
    excludes: ClientModel.ExcludeNotAcceptingFocus | ...
}

To support filtering as known by the Present Windows effect one can use
a ClientFilterModel, which is a QSortFilterProxyModel filtering on
window caption, role and class:
ClientFilterModel {
    id: filterModel
    clientModel: desktopGrid
    filter: filterItem.text
}

In case it&#39;s a tree level obviously QML does not support this correctly.
So we need to use a VisualDataModel:
VisualDataModel {
    id: clientModel
    model: filterModel
    Component.onCompleted: {
        clientModel.rootIndex = modelIndex(0);
        clientModel.rootIndex = modelIndex(0);
        clientModel.delegate = thumbnailDelegate;
    }
}

As we can see, the rootIndex has to be set to the level which contains
the Clients. Also it seems to be important to create the delegate after
the model index has been set. The idea is to have only one ClientModel
and multiple VisualDataModels if multiple views on the data is needed.

The model has been tested with a painful modeltest session. It looks good
so far modulo the listed limitations and that modeltest is not liking
closing Yakuake in the ClientModelByScreenAndDesktop setup, though it
works fine in real world testing.

===
Support saturation/brightness in ThumbnailItem

Two new properties saturation and brightness are added to the
ThumbnailItem which can be set from QML.

The properties are honoured by the Scene when rendering the thumbnail.
===

Plasma devs are added to get access to their QML knowledge :-)</pre>
  </td>
 </tr>
</table>





<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>kwin/CMakeLists.txt <span style="color: \
grey">(ecddc55ed89cb4fcb143561e57534b1bb4ea3832)</span></li>

 <li>kwin/scene.cpp <span style="color: \
grey">(939f000f0c3d09ffacccb0b25c50f83f0010ef47)</span></li>

 <li>kwin/scripting/scripting.cpp <span style="color: \
grey">(e124827174317ab6adbfdb90cec796a02e7bd2b7)</span></li>

 <li>kwin/scripting/scripting_model.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>kwin/scripting/scripting_model.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>kwin/thumbnailitem.h <span style="color: \
grey">(f7dc4fe621e9cf2786794d1be55930ce79ca5c7c)</span></li>

 <li>kwin/thumbnailitem.cpp <span style="color: \
grey">(66b665a685188767201ada7d5cfbb32a0ea7ff0a)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/109604/diff/" style="margin-left: \
3em;">View Diff</a></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">File Attachments \
</h1>

<ul>

 <li><a href="http://git.reviewboard.kde.org/media/uploaded/files/2013/03/20/main.qml">Example \
PresentWindows/DesktopGrid QML</a></li>

 <li><a href="http://git.reviewboard.kde.org/media/uploaded/files/2013/03/20/WindowItemComponent.qml">WindowItemComponent.qml \
- needed for the example</a></li>

</ul>





  </td>
 </tr>
</table>








  </div>
 </body>
</html>



_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic