<table><tr><td style="">iasensio added a subscriber: hchain.<br />iasensio added inline comments.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D28152">View Revision</a></tr></table><br /><div><strong>INLINE COMMENTS</strong><div><div style="margin: 6px 0 12px 0;"><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D28152#inline-159873">View Inline</a><span style="color: #4b4d51; font-weight: bold;">broulik</span> wrote in <span style="color: #4b4d51; font-weight: bold;">kcmrules.cpp:140</span></div>
<div style="margin: 8px 0; padding: 0 12px; color: #74777D;"><p style="padding: 0; margin: 8px;">Could this be done in-memory without a temp file?</p></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Yes, I want to talk to <a href="https://phabricator.kde.org/p/hchain/" style="
border-color: #f1f7ff;
color: #19558d;
background-color: #f1f7ff;
border: 1px solid transparent;
border-radius: 3px;
font-weight: bold;
padding: 0 4px;">@hchain</a> and see to expand the <tt style="background: #ebebeb; font-size: 13px;">RuleBookSettings</tt> class to work with a list of <tt style="background: #ebebeb; font-size: 13px;">RuleSettings</tt> objects instead of <tt style="background: #ebebeb; font-size: 13px;">Rules</tt>, and avoid this intermediate step.</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D28152#inline-159895">View Inline</a><span style="color: #4b4d51; font-weight: bold;">broulik</span> wrote in <span style="color: #4b4d51; font-weight: bold;">OptionsComboBox.qml:41</span></div>
<div style="margin: 8px 0; padding: 0 12px; color: #74777D;"><p style="padding: 0; margin: 8px;">Kudos for using <tt style="background: #ebebeb; font-size: 13px;">onActivated</tt> rather than <tt style="background: #ebebeb; font-size: 13px;">onCurrentIndexChanged</tt>! ;)</p>
<p style="padding: 0; margin: 8px;">However, you can probably make this a binding</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">readonly property var currentValue: values[index]</pre></div>
<p style="padding: 0; margin: 8px;">or perhaps a <tt style="background: #ebebeb; font-size: 13px;">string</tt> property, even</p></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">That approach fails for me (<tt style="background: #ebebeb; font-size: 13px;">QCoreApplication::postEvent: Unexpected null receiver</tt>), even with some protections</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D28152#inline-159897">View Inline</a><span style="color: #4b4d51; font-weight: bold;">broulik</span> wrote in <span style="color: #4b4d51; font-weight: bold;">RuleItemDelegate.qml:28</span></div>
<div style="margin: 8px 0; padding: 0 12px; color: #74777D;"><p style="padding: 0; margin: 8px;">Needed?</p></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Not really. In fact keyboard navigation works slightly better without setting <tt style="background: #ebebeb; font-size: 13px;">focus</tt></p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D28152#inline-159900">View Inline</a><span style="color: #4b4d51; font-weight: bold;">broulik</span> wrote in <span style="color: #4b4d51; font-weight: bold;">RuleItemDelegate.qml:67</span></div>
<div style="margin: 8px 0; padding: 0 12px; color: #74777D;"><p style="padding: 0; margin: 8px;">I think you better set that on the <tt style="background: #ebebeb; font-size: 13px;">Label</tt> and remove this item, so the description can always span the full width?</p></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">This helps keeping the description sizes more constant between delegates, so it looks more like a real table.</p>
<p style="padding: 0; margin: 8px;">Setting <tt style="background: #ebebeb; font-size: 13px;">Layout.fillWidth:true</tt> on the <tt style="background: #ebebeb; font-size: 13px;">Label</tt>produces this<br />
<a href="https://phabricator.kde.org/F8186870" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;">F8186870: Screenshot_20200320_233750.png</a></p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D28152#inline-159907">View Inline</a><span style="color: #4b4d51; font-weight: bold;">broulik</span> wrote in <span style="color: #4b4d51; font-weight: bold;">RulesEditor.qml:115</span></div>
<div style="margin: 8px 0; padding: 0 12px; color: #74777D;"><p style="padding: 0; margin: 8px;">You can't do word puzzles with <tt style="background: #ebebeb; font-size: 13px;">i18n</tt> like this. It needs to be one consecuetive string.</p></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">I will probably set this text on the C++ side as you suggested in another comment.<br />
This feels a bit alien here.</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D28152#inline-159908">View Inline</a><span style="color: #4b4d51; font-weight: bold;">broulik</span> wrote in <span style="color: #4b4d51; font-weight: bold;">RulesList.qml:42</span></div>
<div style="margin: 8px 0; padding: 0 12px; color: #74777D;"><p style="padding: 0; margin: 8px;">I think it does that for you already?</p></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Quite, but not fully. If <tt style="background: #ebebeb; font-size: 13px;">clip</tt> is not set here, the content seems to overlap the frame. <br />
Maybe that's a bug in <tt style="background: #ebebeb; font-size: 13px;">ScrollViewKCM</tt>.</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D28152#inline-159879">View Inline</a><span style="color: #4b4d51; font-weight: bold;">broulik</span> wrote in <span style="color: #4b4d51; font-weight: bold;">ruleitem.h:39</span></div>
<div style="margin: 8px 0; padding: 0 12px; color: #74777D;"><p style="padding: 0; margin: 8px;">I /think/ if you based your class on <tt style="background: #ebebeb; font-size: 13px;">QMetaObject::Type</tt> you can generalize it a lot without putting <tt style="background: #ebebeb; font-size: 13px;">switch</tt> statements for your types in it? However, there's also <tt style="background: #ebebeb; font-size: 13px;">Coordinate</tt> and <tt style="background: #ebebeb; font-size: 13px;">Shortcut</tt>, so maybe not.</p></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">I definitely want to go with a nicer approach for this thing, but for now is the simplest way I found. <a href="https://phabricator.kde.org/p/hchain/" style="
border-color: #f1f7ff;
color: #19558d;
background-color: #f1f7ff;
border: 1px solid transparent;
border-radius: 3px;
font-weight: bold;
padding: 0 4px;">@hchain</a> suggested to use a template, ideally, using the type on the KConfigXT schema.</p>
<p style="padding: 0; margin: 8px;">Currently <tt style="background: #ebebeb; font-size: 13px;">RuleItem::Type</tt> has a double meaning: it sets the stored type and the edit field in the UI. And anyway, <tt style="background: #ebebeb; font-size: 13px;">Coordinate</tt> just maps to a <tt style="background: #ebebeb; font-size: 13px;">QPoint</tt> or <tt style="background: #ebebeb; font-size: 13px;">QSize</tt>, and <tt style="background: #ebebeb; font-size: 13px;">Shortcut</tt> a <tt style="background: #ebebeb; font-size: 13px;">QKeySequence</tt>.</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D28152#inline-159882">View Inline</a><span style="color: #4b4d51; font-weight: bold;">broulik</span> wrote in <span style="color: #4b4d51; font-weight: bold;">rulesdialog.cpp:34</span></div>
<div style="margin: 8px 0; padding: 0 12px; color: #74777D;"><p style="padding: 0; margin: 8px;">Where is this class being used from?</p></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">It's called by kwin when selecting <tt style="background: #ebebeb; font-size: 13px;">Edit Specific Window/App Properties</tt> from the window menu. Here I just kept the interface with that entry point unchanged, but it is within a custom executable, so it should probably be replaced by a full QML dialog by changing <tt style="background: #ebebeb; font-size: 13px;">main.cpp</tt>.</p></div></div></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R108 KWin</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D28152">https://phabricator.kde.org/D28152</a></div></div><br /><div><strong>To: </strong>iasensio, Plasma, KWin, VDG<br /><strong>Cc: </strong>hchain, broulik, zzag, kwin, dmenig, manueljlin, Orage, cacarry, LeGast00n, The-Feren-OS-Dev, cblack, konkinartem, ian, jguidon, Ghost6, jraleigh, zachus, fbampaloukas, squeakypancakes, alexde, IohannesPetros, GB_2, mkulinski, trickyricky26, ragreen, jackyalcine, iodelay, crozbo, ndavis, bwowk, ZrenBot, firef, ngraham, alexeymin, skadinna, himcesjf, lesliezhai, ali-mohamed, hardening, romangg, jensreuterberg, aaronhoneycutt, abetts, sebas, apol, ahiemstra, mbohlender, mart<br /></div>