D27481: [WIP]Panel spacer that can center things

2020-02-19 Thread Marco Martin
mart added a comment.


  demo of adding 2 spacers and centering mode
  F8112648: vokoscreen-2020-02-19_13-43-02.mp4 


REPOSITORY
  R120 Plasma Workspace

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

To: mart, #plasma, #vdg
Cc: broulik, ngraham, plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, 
jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, alexeymin, himcesjf, 
lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart


D27481: [WIP]Panel spacer that can center things

2020-02-19 Thread Marco Martin
mart updated this revision to Diff 75988.
mart added a comment.


  - put the second spacer at the beginning

REPOSITORY
  R120 Plasma Workspace

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D27481?vs=75980=75988

BRANCH
  mart/panelSpacer

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

AFFECTED FILES
  applets/CMakeLists.txt
  applets/panelspacer/CMakeLists.txt
  applets/panelspacer/Messages.sh
  applets/panelspacer/contents/config/main.xml
  applets/panelspacer/contents/ui/main.qml
  applets/panelspacer/metadata.desktop
  applets/panelspacer/package/contents/config/main.xml
  applets/panelspacer/package/contents/ui/main.qml
  applets/panelspacer/package/metadata.desktop
  applets/panelspacer/plugin/CMakeLists.txt
  applets/panelspacer/plugin/panelspacer.cpp
  applets/panelspacer/plugin/panelspacer.h
  shell/panelconfigview.cpp

To: mart, #plasma, #vdg
Cc: broulik, ngraham, plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, 
jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, alexeymin, himcesjf, 
lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart


D27481: [WIP]Panel spacer that can center things

2020-02-19 Thread Marco Martin
mart updated this revision to Diff 75980.
mart marked 3 inline comments as done.
mart added a comment.


  - use a binding
  - use twinlayouts only when both are expanding

REPOSITORY
  R120 Plasma Workspace

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D27481?vs=75925=75980

BRANCH
  mart/panelSpacer

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

AFFECTED FILES
  applets/CMakeLists.txt
  applets/panelspacer/CMakeLists.txt
  applets/panelspacer/Messages.sh
  applets/panelspacer/contents/config/main.xml
  applets/panelspacer/contents/ui/main.qml
  applets/panelspacer/metadata.desktop
  applets/panelspacer/package/contents/config/main.xml
  applets/panelspacer/package/contents/ui/main.qml
  applets/panelspacer/package/metadata.desktop
  applets/panelspacer/plugin/CMakeLists.txt
  applets/panelspacer/plugin/panelspacer.cpp
  applets/panelspacer/plugin/panelspacer.h

To: mart, #plasma, #vdg
Cc: broulik, ngraham, plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, 
jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, alexeymin, himcesjf, 
lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart


D27481: [WIP]Panel spacer that can center things

2020-02-19 Thread Marco Martin
mart added inline comments.

INLINE COMMENTS

> broulik wrote in main.qml:30
> Why that?

no idea, is from the old applet and appears useless (also phab gets confused 
and doesn't understand the move of main.qml to a subfolder)

> broulik wrote in main.qml:77
> Does `Qt.callLater(foo)` work? It also compresses subsequent calls to the 
> same method (i.e. doesn't work with a closure)

yep, works

REPOSITORY
  R120 Plasma Workspace

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

To: mart, #plasma, #vdg
Cc: broulik, ngraham, plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, 
jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, alexeymin, himcesjf, 
lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart


D27481: [WIP]Panel spacer that can center things

2020-02-19 Thread Kai Uwe Broulik
broulik added inline comments.

INLINE COMMENTS

> main.xml:15
>  length in pixels of the spacer. Configuration effective only 
> if expanding is set to false.
> +-1
>  

Please mention in the label what `-1` means

> main.qml:30
> +
> +z: 
> +property bool horizontal: plasmoid.formFactor !== 
> PlasmaCore.Types.Vertical

Why that?

> main.qml:68
> +action.checkable = true;
> +action.checked = plasmoid.configuration.expanding;
> +

Could be a `Qt.binding`?

> main.qml:77
> +// Every time this binding gets reevaluated we want to queue a 
> recomputation of the size hints
> +relayoutTimer.restart();
> +if (!twinSpacer || !panelLayout || !leftTwin || !rightTwin) {

Does `Qt.callLater(foo)` work? It also compresses subsequent calls to the same 
method (i.e. doesn't work with a closure)

> main.qml:95
> +for (var i in panelLayout.children) {
> +if (!panelLayout.children[i].visible) {
> +continue;

Please cache `panelLayout.children[i]` in a variable to make the code below 
somewhat more readable

REPOSITORY
  R120 Plasma Workspace

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

To: mart, #plasma, #vdg
Cc: broulik, ngraham, plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, 
jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, alexeymin, himcesjf, 
lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart


D27481: [WIP]Panel spacer that can center things

2020-02-18 Thread Nathaniel Graham
ngraham added a comment.


  Super cool feature! This was one of the things I was missing for D24223 
.

REPOSITORY
  R120 Plasma Workspace

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

To: mart, #plasma, #vdg
Cc: ngraham, plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, 
jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, alexeymin, himcesjf, 
lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart


D27481: [WIP]Panel spacer that can center things

2020-02-18 Thread Marco Martin
mart added a comment.


  Implementation-wise could make sense for the implementation be in the panel 
itself, tough it may be difficult to control from the external panel 
configuration tool
  
  Usability-wise i think would be fine if the first spacer is added at the end 
of the panel, and the second at the beginning, trigering the centering for the 
whole panel contents, tough again is a bit difficult to trigger from the 
external panel configuration toolbar

REPOSITORY
  R120 Plasma Workspace

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

To: mart, #plasma, #vdg
Cc: plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, 
fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, 
ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart


D27481: [WIP]Panel spacer that can center things

2020-02-18 Thread Marco Martin
mart created this revision.
mart added reviewers: Plasma, VDG.
Herald added a project: Plasma.
Herald added a subscriber: plasma-devel.
mart requested review of this revision.

REVISION SUMMARY
  - Make the panel spacer take a lot more space when is in expanding mode, so 
much
  
  to "win" against the taskbar and collapse it to its minimum size (seems the
  most expected behavior after some discussions in vdg channel)
  
  - make it paint a background when in edit mode
  - when two spacers are present in the panel, they try to center all the 
content
  
  that is in between them (if possible), so that is always at the center of the 
panel,
  even if there is more content on one side rather than the other

REPOSITORY
  R120 Plasma Workspace

BRANCH
  mart/panelSpacer

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

AFFECTED FILES
  applets/CMakeLists.txt
  applets/panelspacer/CMakeLists.txt
  applets/panelspacer/Messages.sh
  applets/panelspacer/contents/config/main.xml
  applets/panelspacer/contents/ui/main.qml
  applets/panelspacer/metadata.desktop
  applets/panelspacer/package/contents/config/main.xml
  applets/panelspacer/package/contents/ui/main.qml
  applets/panelspacer/package/metadata.desktop
  applets/panelspacer/plugin/CMakeLists.txt
  applets/panelspacer/plugin/panelspacer.cpp
  applets/panelspacer/plugin/panelspacer.h

To: mart, #plasma, #vdg
Cc: plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, 
fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, 
ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart