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

List:       kde-panel-devel
Subject:    D7246: Tooltips
From:       Martin_Flöser <noreply () phabricator ! kde ! org>
Date:       2017-12-27 11:53:11
Message-ID: 20171227115311.40514.B43EE22CE654B3BF () phabricator ! kde ! org
[Download RAW message or body]

graesslin requested changes to this revision.
graesslin added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> CMakeLists.txt:27
> Test
> +    Widgets
> )

I don't see Widgets used anywhere.

> CMakeLists.txt:1
> +add_definitions(-DTRANSLATION_DOMAIN="kcmkwindecoration")
> +

This is not kcmkwin, but kdecoration

> CMakeLists.txt:22
> Qt5::Gui
> +        Qt5::Widgets
> PRIVATE

I don't see Widgets used anywhere

> decorationbutton.cpp:302
> connect(this, &DecorationButton::hoveredChanged, this, updateSlot);
> +    connect(this, &DecorationButton::hoveredChanged, this, \
> &DecorationButton::showTooltip); connect(this, &DecorationButton::pressedChanged, \
> this, updateSlot);

If I see correctly this could become a lambda function which would not require to add \
a showTooltip method

> decorationbutton.cpp:512-513
> +
> +    //TODO: change offset to something valuable
> +    hovered ? emit showtooltip(type) : hidetooltip();
> +

Instead of emitting the signal please invoke the method requestShowTooltip directly \
(I don't think we need to queue it)

> decorationbutton.h:155-156
> 
> +    //* show tooltip
> +    void showTooltip(bool);
> +

I think this method is not needed (see comment about the lambda connection)

> decorationbutton.h:158
> +
> +    QString typeToString( DecorationButtonType type );
> +

This should not be in the public header. Please move to private

> decorationbutton.h:167-168
> void doubleClicked();
> +    void showtooltip(QString);
> +    void hidetooltip();
> 

I don't think we need those signals.

> decoratedclientprivate.h:79-80
> 
> +    virtual void requestShowToolTip(QString &text) = 0;
> +    virtual void requestHideToolTip() = 0;
> virtual void requestClose() = 0;

If we add pure virtuals we need to increase the so version of the private libraru.

REPOSITORY
  R129 Window Decoration Library

REVISION DETAIL
  https://phabricator.kde.org/D7246

To: McPain, #breeze, #plasma, graesslin
Cc: ngraham, broulik, plasma-devel, #breeze, ZrenBot, progwolff, lesliezhai, \
ali-mohamed, jensreuterberg, abetts, sebas, apol, mart


[Attachment #3 (unknown)]

<table><tr><td style="">graesslin requested changes to this revision.<br />graesslin \
added inline comments.<br />This revision now requires changes to proceed. </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/D7246" \
rel="noreferrer">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/D7246#inline-43100" rel="noreferrer">View \
Inline</a><span style="color: #4b4d51; font-weight: \
bold;">CMakeLists.txt:27</span></div> <div style="font: 11px/15px &quot;Menlo&quot;, \
&quot;Consolas&quot;, &quot;Monaco&quot;, monospace; white-space: pre-wrap; clear: \
both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; ">    \
Test </div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, \
.6);">    Widgets </div><div style="padding: 0 8px; margin: 0 4px; ">)
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">I \
don&#039;t see Widgets used anywhere.</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/D7246#inline-43099" rel="noreferrer">View \
Inline</a><span style="color: #4b4d51; font-weight: \
bold;">CMakeLists.txt:1</span></div> <div style="font: 11px/15px &quot;Menlo&quot;, \
&quot;Consolas&quot;, &quot;Monaco&quot;, monospace; white-space: pre-wrap; clear: \
both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; \
background: rgba(151, 234, 151, \
.6);">add_definitions(-DTRANSLATION_DOMAIN=&quot;kcmkwindecoration&quot;) \
</div></div></div> <div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; \
margin: 8px;">This is not kcmkwin, but kdecoration</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/D7246#inline-43101" rel="noreferrer">View \
Inline</a><span style="color: #4b4d51; font-weight: \
bold;">CMakeLists.txt:22</span></div> <div style="font: 11px/15px &quot;Menlo&quot;, \
&quot;Consolas&quot;, &quot;Monaco&quot;, monospace; white-space: pre-wrap; clear: \
both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; ">       \
Qt5::Gui </div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, \
151, .6);">        Qt5::Widgets </div><div style="padding: 0 8px; margin: 0 4px; ">   \
PRIVATE </div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">I \
don&#039;t see Widgets used anywhere</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/D7246#inline-43106" rel="noreferrer">View \
Inline</a><span style="color: #4b4d51; font-weight: \
bold;">decorationbutton.cpp:302</span></div> <div style="font: 11px/15px \
&quot;Menlo&quot;, &quot;Consolas&quot;, &quot;Monaco&quot;, monospace; white-space: \
pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; \
margin: 0 4px; ">    <span class="n">connect</span><span class="p">(</span><span \
style="color: #aa4000">this</span><span class="p">,</span> <span style="color: \
#aa2211">&amp;</span><span class="n">DecorationButton</span><span style="color: \
#aa2211">::</span><span class="n">hoveredChanged</span><span class="p">,</span> <span \
style="color: #aa4000">this</span><span class="p">,</span> <span \
class="n">updateSlot</span><span class="p">);</span> </div><div style="padding: 0 \
8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span \
class="n">connect</span><span class="p">(</span><span style="color: \
#aa4000">this</span><span class="p">,</span> <span style="color: \
#aa2211">&amp;</span><span class="n">DecorationButton</span><span style="color: \
#aa2211">::</span><span class="n">hoveredChanged</span><span class="p">,</span> <span \
style="color: #aa4000">this</span><span class="p">,</span> <span style="color: \
#aa2211">&amp;</span><span class="n">DecorationButton</span><span style="color: \
#aa2211">::</span><span class="n">showTooltip</span><span class="p">);</span> \
</div><div style="padding: 0 8px; margin: 0 4px; ">    <span \
class="n">connect</span><span class="p">(</span><span style="color: \
#aa4000">this</span><span class="p">,</span> <span style="color: \
#aa2211">&amp;</span><span class="n">DecorationButton</span><span style="color: \
#aa2211">::</span><span class="n">pressedChanged</span><span class="p">,</span> <span \
style="color: #aa4000">this</span><span class="p">,</span> <span \
class="n">updateSlot</span><span class="p">);</span> </div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">If I \
see correctly this could become a lambda function which would not require to add a \
showTooltip method</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/D7246#inline-43109" \
rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: \
bold;">decorationbutton.cpp:512-513</span></div> <div style="font: 11px/15px \
&quot;Menlo&quot;, &quot;Consolas&quot;, &quot;Monaco&quot;, monospace; white-space: \
pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; \
margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span style="color: \
#74777d">//TODO: change offset to something valuable</span> </div><div \
style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span \
class="n">hovered</span> <span style="color: #aa2211">?</span> <span \
class="n">emit</span> <span class="n">showtooltip</span><span class="p">(</span><span \
class="n">type</span><span class="p">)</span> <span style="color: #aa2211">:</span> \
<span class="n">hidetooltip</span><span class="p">();</span> </div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: \
8px;">Instead of emitting the signal please invoke the method requestShowTooltip \
directly (I don&#039;t think we need to queue it)</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/D7246#inline-43103" rel="noreferrer">View \
Inline</a><span style="color: #4b4d51; font-weight: \
bold;">decorationbutton.h:155-156</span></div> <div style="font: 11px/15px \
&quot;Menlo&quot;, &quot;Consolas&quot;, &quot;Monaco&quot;, monospace; white-space: \
pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; \
margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span style="color: \
#74777d">//* show tooltip</span> </div><div style="padding: 0 8px; margin: 0 4px; \
background: rgba(151, 234, 151, .6);">    <span style="color: #aa4000">void</span> \
<span style="color: #004012">showTooltip</span><span class="p">(</span><span \
style="color: #aa4000">bool</span><span class="p">);</span> </div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">I \
think this method is not needed (see comment about the lambda \
connection)</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/D7246#inline-43102" \
rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: \
bold;">decorationbutton.h:158</span></div> <div style="font: 11px/15px \
&quot;Menlo&quot;, &quot;Consolas&quot;, &quot;Monaco&quot;, monospace; white-space: \
pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; \
margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span \
class="n">QString</span> <span style="color: #004012">typeToString</span><span \
class="p">(</span> <span class="n">DecorationButtonType</span> <span \
class="n">type</span> <span class="p">);</span> </div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">This \
should not be in the public header. Please move to private</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/D7246#inline-43108" rel="noreferrer">View \
Inline</a><span style="color: #4b4d51; font-weight: \
bold;">decorationbutton.h:167-168</span></div> <div style="font: 11px/15px \
&quot;Menlo&quot;, &quot;Consolas&quot;, &quot;Monaco&quot;, monospace; white-space: \
pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; \
margin: 0 4px; ">    <span style="color: #aa4000">void</span> <span style="color: \
#004012">doubleClicked</span><span class="p">();</span> </div><div style="padding: 0 \
8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span style="color: \
#aa4000">void</span> <span style="color: #004012">showtooltip</span><span \
class="p">(</span><span class="n">QString</span><span class="p">);</span> </div><div \
style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span \
style="color: #aa4000">void</span> <span style="color: \
#004012">hidetooltip</span><span class="p">();</span> </div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">I \
don&#039;t think we need those signals.</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/D7246#inline-43105" rel="noreferrer">View \
Inline</a><span style="color: #4b4d51; font-weight: \
bold;">decoratedclientprivate.h:79-80</span></div> <div style="font: 11px/15px \
&quot;Menlo&quot;, &quot;Consolas&quot;, &quot;Monaco&quot;, monospace; white-space: \
pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; \
margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span \
class="n">virtual</span> <span style="color: #aa4000">void</span> <span style="color: \
#004012">requestShowToolTip</span><span class="p">(</span><span \
class="n">QString</span> <span style="color: #aa2211">&amp;</span><span \
class="n">text</span><span class="p">)</span> <span style="color: #aa2211">=</span> \
<span style="color: #601200">0</span><span class="p">;</span> </div><div \
style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span \
class="n">virtual</span> <span style="color: #aa4000">void</span> <span style="color: \
#004012">requestHideToolTip</span><span class="p">()</span> <span style="color: \
#aa2211">=</span> <span style="color: #601200">0</span><span class="p">;</span> \
</div><div style="padding: 0 8px; margin: 0 4px; ">    <span class="n">virtual</span> \
<span style="color: #aa4000">void</span> <span style="color: \
#004012">requestClose</span><span class="p">()</span> <span style="color: \
#aa2211">=</span> <span style="color: #601200">0</span><span class="p">;</span> \
</div></div></div> <div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; \
margin: 8px;">If we add pure virtuals we need to increase the so version of the \
private libraru.</p></div></div></div></div></div><br \
/><div><strong>REPOSITORY</strong><div><div>R129 Window Decoration \
Library</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a \
href="https://phabricator.kde.org/D7246" \
rel="noreferrer">https://phabricator.kde.org/D7246</a></div></div><br \
/><div><strong>To: </strong>McPain, Breeze, Plasma, graesslin<br /><strong>Cc: \
</strong>ngraham, broulik, plasma-devel, Breeze, ZrenBot, progwolff, lesliezhai, \
ali-mohamed, jensreuterberg, abetts, sebas, apol, mart<br /></div>



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

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